Ignore:
Timestamp:
Oct 30, 2013, 1:54:46 PM (10 years ago)
Author:
plg
Message:

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).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/ws_functions.inc.php

    r25196 r25237  
    35623562function ws_users_add($params, &$service)
    35633563{
    3564   $user_id = register_user($params['username'], $params['password'], $params['email'], false, $errors);
     3564  global $conf;
     3565
     3566  if ($conf['double_password_type_in_admin'])
     3567  {
     3568    if ($params['password'] != $params['password_confirm'])
     3569    {
     3570      return new PwgError(WS_ERR_INVALID_PARAM, l10n('The passwords do not match'));
     3571    }
     3572  }
     3573
     3574  $user_id = register_user(
     3575    $params['username'],
     3576    $params['password'],
     3577    $params['email'],
     3578    false, // notify admin
     3579    $errors,
     3580    $params['send_password_by_mail']
     3581    );
    35653582 
    35663583  if (!$user_id)
Note: See TracChangeset for help on using the changeset viewer.