View Single Post
  #2  
Old 9th December 2008, 14:29
johnake's Avatar
johnake johnake is offline
Senior Member
 
Join Date: Dec 2007
Posts: 52
Default
in your signup.php file near:

PHP Code:
<tr valign=top><td align="right" class="heading">Email address:</td><td align=left><input type="text" size="40" name="email" /> 
append:
PHP Code:
<select name="maildomain"><option value="@gmail.com">@gmail.com</option><option value="@yahoo.com">@yahoo.com</option></select
you can use as many option values as you may.

in takesignup.php:

PHP Code:
if (!mkglobal("wantusername:wantpassword:passagain:email))
die(); 
replace with:
PHP Code:
if (!mkglobal("wantusername:wantpassword:passagain:email:maildomain))
die(); 
PHP Code:
if (!validemail($email))
    
bark("That doesn't look like a valid email address."); 
replace with:

PHP Code:
if (!validemail($email.$maildomain))
    
bark("That doesn't look like a valid email address."); 
replace:
PHP Code:
$a = (@mysql_fetch_row(@mysql_query("select count(*) from users where email='$email'"))) or die(mysql_error()); 
with:
PHP Code:
$a = (@mysql_fetch_row(@mysql_query("select count(*) from users where email='$email.$maildomain'"))) or die(mysql_error()); 
and in the big query:

INSERT INTO users (username, passhash, secret, editsecret, email....

where you see $email

replace it with $email.$domain.

And thats about it!

An alternative solution is to create a table like maildomain where you can put allowed domains.

Note: this is done with tbdev source. Didn't had the time of installing tstrike but the differences are not that great.

Cheers.
__________________
PHP Code:
class mySelf extends World
   
{
       public 
$health;
       private 
$friends;
       protected 
$love;
  
   public function 
__construct()
  {
       
$this->health 100;
       
$this->friends 2;
       
$this->love true;
  }
  protected function 
__love()
  { 
      
//has a bug... for the moment...
      //will fix it later.. until then:
      
sleep(15*365*24*3600);
  }


Last edited by johnake; 9th December 2008 at 14:35.
Reply With Quote