Skip to content

Commit dbbafff

Browse files
committed
Patch from Filip that enables settting of sys_user.modules and sys_user.startmodule via client_add remote API call
1 parent 5384ed0 commit dbbafff

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

interface/lib/classes/remoting_lib.inc.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,8 +664,20 @@ function ispconfig_sysuser_add($params,$insert_id){
664664
global $app,$sql1;
665665
$username = $app->db->quote($params["username"]);
666666
$password = $app->db->quote($params["password"]);
667-
$modules = 'mail,sites,dns,tools';
668-
$startmodule = 'mail';
667+
if(!isset($params['modules'])) {
668+
$modules = 'dashboard,mail,sites,dns,tools';
669+
} else {
670+
$modules = $app->db->quote($params['modules']);
671+
}
672+
if(!isset($params['startmodule'])) {
673+
$startmodule = 'dashboard';
674+
} else {
675+
$startmodule = $app->db->quote($params["startmodule"]);
676+
if(!preg_match('/'.$startmodule.'/',$modules)) {
677+
$_modules = explode(',',$modules);
678+
$startmodule=$_modules[0];
679+
}
680+
}
669681
$usertheme = $app->db->quote($params["usertheme"]);
670682
$type = 'user';
671683
$active = 1;

0 commit comments

Comments
 (0)