summaryrefslogtreecommitdiff
path: root/modules/user/helpers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-10-29 17:09:01 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-10-29 17:09:01 -0700
commit04bf50bfb4241f7c814782c516732d927ff1f457 (patch)
tree0877e4010b7242cf5eba51cb6fddd1c99630472d /modules/user/helpers
parent392e24e56b4afa0e8752fd740f613f5556955342 (diff)
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.
Diffstat (limited to 'modules/user/helpers')
-rw-r--r--modules/user/helpers/user_event.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/user/helpers/user_event.php b/modules/user/helpers/user_event.php
index 1ac7f333..e3dbacb7 100644
--- a/modules/user/helpers/user_event.php
+++ b/modules/user/helpers/user_event.php
@@ -28,4 +28,9 @@ class user_event_Core {
return $menu;
}
+
+ static function check_username_exists($data) {
+ $user = user::lookup_by_name($data->name);
+ $data->exists |= $user ? true : false;
+ }
}