diff options
author | plegall <plg@piwigo.org> | 2013-10-30 12:54:46 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2013-10-30 12:54:46 +0000 |
commit | df6718f3f868b226328ff292f2b5d13f054850ea (patch) | |
tree | 9e072dcce0034e64c6f9b6dba7c0a8e704a603df /include/ws_functions.inc.php | |
parent | f79ae0902b1fedac5cd5eb66d06c3f9fd7703146 (diff) |
feature 1668, user manager redesign: ability to add a new user (call to pwg.users.add through AJAX)
Move the "send connection settings" code to function register_user (avoid code duplication).
git-svn-id: http://piwigo.org/svn/trunk@25237 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/ws_functions.inc.php')
-rw-r--r-- | include/ws_functions.inc.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php index b86fe6fd6..8faf96260 100644 --- a/include/ws_functions.inc.php +++ b/include/ws_functions.inc.php @@ -3561,7 +3561,24 @@ SELECT user_id, group_id */ function ws_users_add($params, &$service) { - $user_id = register_user($params['username'], $params['password'], $params['email'], false, $errors); + global $conf; + + if ($conf['double_password_type_in_admin']) + { + if ($params['password'] != $params['password_confirm']) + { + return new PwgError(WS_ERR_INVALID_PARAM, l10n('The passwords do not match')); + } + } + + $user_id = register_user( + $params['username'], + $params['password'], + $params['email'], + false, // notify admin + $errors, + $params['send_password_by_mail'] + ); if (!$user_id) { |