diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2009-10-31 16:16:47 -0700 | 
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-10-31 16:16:47 -0700 | 
| commit | 1c428df9e090b8e7e9dfa3ec5d924b8169190b42 (patch) | |
| tree | 24f9d45973a0032d27c1286b8871b7f8af6d2021 /modules/user | |
| parent | c3dcfd136bea8ec4b627a7d38f618ac97c9ea4a0 (diff) | |
Revert "Use an event 'check_user_name_exists' to validate the input name is already in use. The parameter is a standard class with the name and an exists flag.  Any event handler should or their result with the exists flag."
This reverts commit 04bf50bfb4241f7c814782c516732d927ff1f457.
Diffstat (limited to 'modules/user')
| -rw-r--r-- | modules/user/controllers/admin_users.php | 4 | ||||
| -rw-r--r-- | modules/user/helpers/user_event.php | 5 | 
2 files changed, 1 insertions, 8 deletions
| diff --git a/modules/user/controllers/admin_users.php b/modules/user/controllers/admin_users.php index 209ce8ae..54541e90 100644 --- a/modules/user/controllers/admin_users.php +++ b/modules/user/controllers/admin_users.php @@ -36,9 +36,7 @@ class Admin_Users_Controller extends Admin_Controller {      $form = $this->_get_user_add_form_admin();      $valid = $form->validate();      $name = $form->add_user->inputs["name"]->value; -    $user_exists_data = (object)array("name" => $name); -    module::event("check_username_exists", $user_exists_data); -    if ($user_exists_data->exists) { +    if ($user = user::lookup_by_name($name)) {        $form->add_user->inputs["name"]->add_error("in_use", 1);        $valid = false;      } diff --git a/modules/user/helpers/user_event.php b/modules/user/helpers/user_event.php index 11b9c56c..cf91812e 100644 --- a/modules/user/helpers/user_event.php +++ b/modules/user/helpers/user_event.php @@ -27,9 +27,4 @@ class user_event_Core {      return $menu;    } - -  static function check_username_exists($data) { -    $user = user::lookup_by_name($data->name); -    $data->exists |= $user ? true : false; -  }  } | 
