- 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
This commit is contained in:
plegall
2005-10-22 09:53:12 +00:00
parent 56f29767a8
commit 11615fcba6
6 changed files with 41 additions and 10 deletions
+10 -2
View File
@@ -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;
}