diff options
author | Sarven Capadisli <csarven@status.net> | 2009-11-04 19:06:10 +0000 |
---|---|---|
committer | Sarven Capadisli <csarven@status.net> | 2009-11-04 19:06:10 +0000 |
commit | eb42ad5635c65dd7c25ea57bd5b6e56114054ae0 (patch) | |
tree | 7173d84c806bb1f4daaea967dfdadb8e7553204a /lib | |
parent | 4f461bc5c383d4febfe07cd5d526fc6ba5218d31 (diff) | |
parent | c403f7fa442d7f8eacb4e2288429c271450d57d2 (diff) |
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
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; |