Commit 95d4d5cf authored by Choong Wei Tjeng's avatar Choong Wei Tjeng

Also update sys_user language if it was specified through API client_update

parent 7c05ac39
...@@ -308,7 +308,9 @@ class remoting_lib extends tform_base { ...@@ -308,7 +308,9 @@ class remoting_lib extends tform_base {
global $app; global $app;
$username = $params["username"]; $username = $params["username"];
$clear_password = $params["password"]; $clear_password = $params["password"];
$language = $params['language'];
$client_id = $app->functions->intval($client_id); $client_id = $app->functions->intval($client_id);
if(!isset($params['_ispconfig_pw_crypted']) || $params['_ispconfig_pw_crypted'] != 1) $password = $app->auth->crypt_password(stripslashes($clear_password)); if(!isset($params['_ispconfig_pw_crypted']) || $params['_ispconfig_pw_crypted'] != 1) $password = $app->auth->crypt_password(stripslashes($clear_password));
else $password = $clear_password; else $password = $clear_password;
$params = array($username); $params = array($username);
...@@ -318,8 +320,15 @@ class remoting_lib extends tform_base { ...@@ -318,8 +320,15 @@ class remoting_lib extends tform_base {
} else { } else {
$pwstring ="" ; $pwstring ="" ;
} }
$langstring = '';
if (!empty($language)) {
$langstring = ', language = ?';
$params[] = $language;
}
$params[] = $client_id; $params[] = $client_id;
$sql = "UPDATE sys_user set username = ? $pwstring WHERE client_id = ?"; $sql = "UPDATE sys_user set username = ? $pwstring $langstring WHERE client_id = ?";
$app->db->query($sql, true, $params); $app->db->query($sql, true, $params);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment