From 11615fcba672808a02920102e74f439a4087f036 Mon Sep 17 00:00:00 2001 From: plegall Date: Sat, 22 Oct 2005 09:53:12 +0000 Subject: - bug 173 fixed: due to phpBB user identifiers management, the method to find the next user identifier has changer to MAX+1. - improvement: information message when new user added - bug fixed: language item "Username" used instead of "login". git-svn-id: http://piwigo.org/svn/trunk@906 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions_user.inc.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'include/functions_user.inc.php') diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php index 25dc3efda..8c02f3324 100644 --- a/include/functions_user.inc.php +++ b/include/functions_user.inc.php @@ -76,8 +76,16 @@ function register_user($login, $password, $mail_address) // if no error until here, registration of the user if (count($errors) == 0) { + // what will be the inserted id ? + $query = ' +SELECT MAX('.$conf['user_fields']['id'].') + 1 + FROM '.USERS_TABLE.' +;'; + list($next_id) = mysql_fetch_array(pwg_query($query)); + $insert = array( + $conf['user_fields']['id'] => $next_id, $conf['user_fields']['username'] => mysql_escape_string($login), $conf['user_fields']['password'] => $conf['pass_convert']($password), $conf['user_fields']['email'] => $mail_address @@ -86,9 +94,9 @@ function register_user($login, $password, $mail_address) include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); mass_inserts(USERS_TABLE, array_keys($insert), array($insert)); - create_user_infos(mysql_insert_id()); + create_user_infos($next_id); } - + return $errors; } -- cgit v1.2.3