diff --git a/interface/lib/shelluser_blacklist b/interface/lib/shelluser_blacklist new file mode 100644 index 0000000000000000000000000000000000000000..c49d825517c765d210f0ad090c29b3ced7b7c2b6 --- /dev/null +++ b/interface/lib/shelluser_blacklist @@ -0,0 +1,34 @@ +root +daemon +bin +sys +sync +games +man +lp +mail +news +uucp +proxy +www-data +wwwrun +apache +backup +list +irc +gnats +nobody +Debian-exim +statd +identd +sshd +mysql +postgres +postfix +clamav +amavis +vmail +getmail +ispconfig +courier +dovecot \ No newline at end of file diff --git a/interface/web/sites/shell_user_edit.php b/interface/web/sites/shell_user_edit.php index 633ef46da55092d2b994a7cedf9f90e2203e7f56..299d1b0e6b1f64210ef58d4fb78d913dce1561d1 100644 --- a/interface/web/sites/shell_user_edit.php +++ b/interface/web/sites/shell_user_edit.php @@ -72,6 +72,17 @@ class page_action extends tform_actions { parent::onShowNew(); } + function onBeforeInsert() { + global $app, $conf; + + // check if the username is not blacklisted + $blacklist = file(ISPC_LIB_PATH.'/shelluser_blacklist'); + foreach($blacklist as $line) { + if(strtolower(trim($line)) == strtolower(trim($this->dataRecord['username']))) $app->tform->errorMessage .= 'The username is not allowed.'; + } + unset($blacklist); + } + function onAfterInsert() { global $app, $conf; @@ -86,6 +97,17 @@ class page_action extends tform_actions { } + function onBeforeUpdate() { + global $app, $conf; + + // check if the username is not blacklisted + $blacklist = file(ISPC_LIB_PATH.'/shelluser_blacklist'); + foreach($blacklist as $line) { + if(strtolower(trim($line)) == strtolower(trim($this->dataRecord['username']))) $app->tform->errorMessage .= 'The username is not allowed.'; + } + unset($blacklist); + } + function onAfterUpdate() { global $app, $conf;