fix #27: forbid hostmaster users

This commit is contained in:
Synox 2018-01-09 20:53:14 +01:00
parent 9ef39d7eb8
commit 84270b705a

View file

@ -120,7 +120,14 @@ function _load_emails($mail_ids, $address) {
function _clean_username($username) {
$username = strtolower($username);
$username = preg_replace('/@.*$/', "", $username); // remove part after @
return preg_replace('/[^A-Za-z0-9_.+-]/', "", $username); // remove special characters
$username = preg_replace('/[^A-Za-z0-9_.+-]/', "", $username); // remove special characters
if (in_array($username, array('root', 'admin', 'administrator', 'hostmaster', 'postmaster', 'webmaster'))) {
// Forbidden name!
return '';
}
return $username;
}
function _clean_domain($username) {