diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-11-04 13:06:55 -0500 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-11-04 13:06:55 -0500 |
commit | a82df5fae8b5d71d4545f27e7aa6cc561160922a (patch) | |
tree | db16ae14f26e896689782be4b09d46c802a15ce8 /lib | |
parent | 384a50a7800abde62e040ea57872dc06c0519047 (diff) |
Added a CheckPassword event
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/util.php b/lib/util.php index bf7282858..46aa7f901 100644 --- a/lib/util.php +++ b/lib/util.php @@ -127,8 +127,17 @@ function common_check_user($nickname, $password) if (is_null($user) || $user === false) { return false; } else { - if (0 == strcmp(common_munge_password($password, $user->id), - $user->password)) { + $authenticated = false; + Event::handle('CheckPassword', array($nickname, $password, &$authenticated)); + if(! $authenticated){ + //no handler asserted the user, so check ourselves + if (0 == strcmp(common_munge_password($password, $user->id), + $user->password)) { + //internal checking passed + $authenticated = true; + } + } + if($authenticated){ return $user; } else { return false; |