From 04bf50bfb4241f7c814782c516732d927ff1f457 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 29 Oct 2009 17:09:01 -0700 Subject: 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. --- modules/user/helpers/user_event.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/user/helpers') 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; + } } -- cgit v1.2.3