diff options
Diffstat (limited to 'src/controllers/Users.class.php')
-rw-r--r-- | src/controllers/Users.class.php | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/controllers/Users.class.php b/src/controllers/Users.class.php index c30461f..1d947e1 100644 --- a/src/controllers/Users.class.php +++ b/src/controllers/Users.class.php @@ -8,8 +8,6 @@ Router::register('users' , 'Users', 'index_dir'); Router::register('users/*' , 'Users', 'individual'); class Users extends Controller { - public static $illegal_names = array('', 'new', 'index'); - // Index Views /////////////////////////////////////////////// public function index($routed, $remainder) { @@ -143,7 +141,7 @@ class Users extends Controller { $vars['errors'] = array(); if ($db->getUID($vars['username'])!==false) $vars['errors'][] = 'user exists'; - if (in_array($vars['username'], self::$illegal_names)) + if (!Auth::isNameLegal($vars['username'])) $vars['errors'][] = 'illegal name'; $matches = ($vars['password1'] == $vars['password2']); if (!$matches) { @@ -187,11 +185,9 @@ class Users extends Controller { if (isset($_POST['auth_name'])) { $new_name = $_POST['auth_name']; if ($new_name != $username) { - if (!in_array($new_name, $this->illegal_names)) { - $changed_name = $user->setName($new_name); - $username = $user->getName(); - $vars['changed name'] = $changed_name; - } + $changed_name = $user->setName($new_name); + $username = $user->getName(); + $vars['changed name'] = $changed_name; } } |