Skip to content
Snippets Groups Projects
Commit 95d4d5cf authored by Choong Wei Tjeng's avatar Choong Wei Tjeng
Browse files

Also update sys_user language if it was specified through API client_update

parent 7c05ac39
No related branches found
No related tags found
1 merge request!797Also update sys_user language if it was specified through API client_update
......@@ -308,7 +308,9 @@ class remoting_lib extends tform_base {
global $app;
$username = $params["username"];
$clear_password = $params["password"];
$language = $params['language'];
$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));
else $password = $clear_password;
$params = array($username);
......@@ -318,8 +320,15 @@ class remoting_lib extends tform_base {
} else {
$pwstring ="" ;
}
$langstring = '';
if (!empty($language)) {
$langstring = ', language = ?';
$params[] = $language;
}
$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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment