Commit 416cda95 authored by Till Brehm's avatar Till Brehm

Merge branch 'feature/fix-remoting-sys-user-lang-update' into 'stable-3.1'

Also update sys_user language if it was specified through API client_update

See merge request !797
parents 7c05ac39 95d4d5cf
......@@ -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);
}
......
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