Add parameter enable in WSEditUser to allow update and enable the user if it's disabled.

pull/2487/head
David Nos 10 years ago
parent e798891f04
commit e27a62a568
  1. 5
      main/webservices/registration.soap.php

@ -1789,6 +1789,7 @@ $server->wsdl->addComplexType(
'status' => array('name' => 'status', 'type' => 'xsd:string'), 'status' => array('name' => 'status', 'type' => 'xsd:string'),
'phone' => array('name' => 'phone', 'type' => 'xsd:string'), 'phone' => array('name' => 'phone', 'type' => 'xsd:string'),
'expiration_date' => array('name' => 'expiration_date', 'type' => 'xsd:string'), 'expiration_date' => array('name' => 'expiration_date', 'type' => 'xsd:string'),
'enable' => array('name' => 'enable', 'type' => 'xsd:boolean'),
'extra' => array('name' => 'extra', 'type' => 'tns:extrasList'), 'extra' => array('name' => 'extra', 'type' => 'tns:extrasList'),
'secret_key' => array('name' => 'secret_key', 'type' => 'xsd:string') 'secret_key' => array('name' => 'secret_key', 'type' => 'xsd:string')
) )
@ -1831,7 +1832,7 @@ function WSEditUser($params)
$phone = $params['phone']; $phone = $params['phone'];
$picture_uri = ''; $picture_uri = '';
$expiration_date = $params['expiration_date']; $expiration_date = $params['expiration_date'];
$active = 1; $enable = $params['enable'];
$creator_id = null; $creator_id = null;
$hr_dept_id = 0; $hr_dept_id = 0;
$extra = null; $extra = null;
@ -1850,7 +1851,7 @@ function WSEditUser($params)
if ($user_id == 0) { if ($user_id == 0) {
return 0; return 0;
} else { } else if (empty($enable) || !$enable) {
$sql = "SELECT user_id FROM $table_user $sql = "SELECT user_id FROM $table_user
WHERE user_id ='$user_id' AND active= '0'"; WHERE user_id ='$user_id' AND active= '0'";
$resu = Database::query($sql); $resu = Database::query($sql);

Loading…
Cancel
Save