Login   Register  
PHP Classes
elePHPant
Icontem

Bug in register member function

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Forums Integrator  >  All threads  >  Bug in register member function  >  (Un) Subscribe thread alerts  
Subject:Bug in register member function
Summary:Register function doesn't add user, only groups.
Messages:5
Author:Richard Munroe
Date:2006-08-09 15:35:50
Update:2006-08-16 14:24:53
 

  1. Bug in register member function   Reply  
Picture of Richard Munroe
Richard Munroe
2006-08-09 15:35:50
The following code updates the user table in the register function to include the new user. Insert it in the appropriate place:

$id = $row['user_id'] + 1;
$pass = md5($pass) ;
$sql = "INSERT INTO " .
USERS_TABLE .
" (user_id, username, user_password, user_email) " .
" VALUES (" .
"\"$id\", " .
"\"$login\", " .
"\"$pass\", " .
"\"$email\")" ;
$db->sql_query($sql) ;
$sql = "INSERT INTO " . USER_GROUP_TABLE . " (user_id, group_id, user_pending) VALUES ('".$id."', '".$id."', 0)";

Dick Munroe

p.s. there is no patch data member defined, good form to define it as well.

  2. Re: Bug in register member function   Reply  
Picture of Piotr Malinski
Piotr Malinski
2006-08-10 18:02:35 - In reply to message 1 from Richard Munroe
I'll check it and update the class :)

  3. Re: Bug in register member function   Reply  
Picture of Richard Munroe
Richard Munroe
2006-08-11 12:42:28 - In reply to message 2 from Piotr Malinski
On additional thing, there's a field, something like "user_active" that should probably be set to 0 to indicate that the user isn't currently active on the board.

Best,

Dick Munroe

  4. Re: Bug in register member function   Reply  
Picture of Piotr Malinski
Piotr Malinski
2006-08-12 13:43:11 - In reply to message 3 from Richard Munroe
registration should be ok, inactive user account is optional (see docs.html).

  5. Re: Bug in register member function   Reply  
Picture of Richard Munroe
Richard Munroe
2006-08-16 14:24:53 - In reply to message 4 from Piotr Malinski
You probably want to set the user_regdate as well. It's value is that of the time() function.

Best,

Dick Munroe