aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_user.inc.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2005-10-22 09:53:12 +0000
committerplegall <plg@piwigo.org>2005-10-22 09:53:12 +0000
commit11615fcba672808a02920102e74f439a4087f036 (patch)
treea10371ec47fe9ead9d94a2bf0dbabfbf889a716a /include/functions_user.inc.php
parent56f29767a83b7f616962db2ffde2ae45f46ae831 (diff)
- 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
Diffstat (limited to 'include/functions_user.inc.php')
-rw-r--r--include/functions_user.inc.php12
1 files changed, 10 insertions, 2 deletions
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;
}