Hello there, I am having a bit of a problem. I have created a member registration area... steps are as follows.
User goes to a php form called reg_usernew.php3 the function of this form is to register a new user. I am using phplib for session and auth control...
here is the part of the code that inserts my info into the database...
$db = new DB_user;
$query ="insert into user ( price,name,firstname,street,zip,city,state,email, phone, username, password,perms,duration,end,reg,status) values (";
$query .= "'$price',";
$query .= "'".trim($GLOBALS["name"])."',";
$query .= "'".trim($GLOBALS["firstname"])."',";
$query .= "'".trim($GLOBALS["street"])."',";
$query .= "'".trim($GLOBALS["zip"])."',";
$query .= "'".trim($GLOBALS["city"])."',";
$query .= "'".trim($GLOBALS["state"])."',";
$query .= "'".trim($GLOBALS["email"])."',";
$query .= "'".trim($GLOBALS["phone"])."',";
$query .= "'".trim($GLOBALS["username"])."',";
$query .= "'".trim($GLOBALS["password"])."',";
$query .= "'customer',";
$query .= "'".$GLOBALS["duration"]."',";
$query .= "UNIX_TIMESTAMP()+(".$GLOBALS["duration"]."*86400),";
$query .= "UNIX_TIMESTAMP(),";
$query .= "'NEW'";
$query .= ")";
$db->query($query);
$insert_id = mysql_insert_id();
ok I have a var called status which as you can see is set to NEW in my database I have
status enum('ACTIVE','NEW') DEFAULT 'ACTIVE' NOT NULL,
basically this should keep accounts that are set to NEW to not be able to login until they are set to active....
after the user regs he is sent to another form that askes for some more information. Then an email is sent to them.... the email contains a string in it which when they click goes to a form called approved.php3looks kinda like approved.php3?u=a?blah blah blah...
here is the problem I have tested this when I creat a new account. I can login without having to activate the acount... I am not sure what the heck I am doing wrong... am I supposed to edit something in the phplib files to tell mysql that if the user is set to NEW to not allow them to loggin to the members area?? ANy help would be appreciated. Thanks....