Skip to content

Commit 416cda9

Browse files
author
Till Brehm
committed
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 ispconfig/ispconfig3!797
2 parents 7c05ac3 + 95d4d5c commit 416cda9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

interface/lib/classes/remoting_lib.inc.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,9 @@ function ispconfig_sysuser_update($params, $client_id){
308308
global $app;
309309
$username = $params["username"];
310310
$clear_password = $params["password"];
311+
$language = $params['language'];
311312
$client_id = $app->functions->intval($client_id);
313+
312314
if(!isset($params['_ispconfig_pw_crypted']) || $params['_ispconfig_pw_crypted'] != 1) $password = $app->auth->crypt_password(stripslashes($clear_password));
313315
else $password = $clear_password;
314316
$params = array($username);
@@ -318,8 +320,15 @@ function ispconfig_sysuser_update($params, $client_id){
318320
} else {
319321
$pwstring ="" ;
320322
}
323+
324+
$langstring = '';
325+
if (!empty($language)) {
326+
$langstring = ', language = ?';
327+
$params[] = $language;
328+
}
329+
321330
$params[] = $client_id;
322-
$sql = "UPDATE sys_user set username = ? $pwstring WHERE client_id = ?";
331+
$sql = "UPDATE sys_user set username = ? $pwstring $langstring WHERE client_id = ?";
323332
$app->db->query($sql, true, $params);
324333
}
325334

0 commit comments

Comments
 (0)