| | |
| | | } |
| | | |
| | | if($app->system->is_user($data['new']['puser'])) { |
| | | |
| | | //* Remove webfolder protection |
| | | $app->system->web_folder_protection($web['document_root'],false); |
| | | |
| | | // Get the UID of the parent user |
| | | $uid = intval($app->system->getuid($data['new']['puser'])); |
| | | if($uid > $this->min_uid) { |
| | |
| | | exec($command); |
| | | $app->log("Disabling shelluser temporarily: ".$command,LOGLEVEL_DEBUG); |
| | | } |
| | | |
| | | //* Add webfolder protection again |
| | | $app->system->web_folder_protection($web['document_root'],true); |
| | | |
| | | } else { |
| | | $app->log("UID = $uid for shelluser:".$data['new']['username']." not allowed.",LOGLEVEL_ERROR); |
| | |
| | | if($uid > $this->min_uid) { |
| | | // Check if the user that we want to update exists, if not, we insert it |
| | | if($app->system->is_user($data['old']['username'])) { |
| | | /* |
| | | $command = 'usermod'; |
| | | $command .= ' --home '.escapeshellcmd($data['new']['dir']); |
| | | $command .= ' --gid '.escapeshellcmd($data['new']['pgroup']); |
| | |
| | | |
| | | exec($command); |
| | | $app->log("Executed command: $command ",LOGLEVEL_DEBUG); |
| | | */ |
| | | $groupinfo = posix_getgrnam($data['new']['pgroup']); |
| | | $app->system->usermod($data['old']['username'],0, $groupinfo[gid], $data['new']['dir'], $data['new']['shell'], $data['new']['password'], $data['new']['username']); |
| | | $app->log("Updated shelluser: ".$data['old']['username'],LOGLEVEL_DEBUG); |
| | | |
| | | // call the ssh-rsa update function |