forked from GNUsocial/gnu-social
Added a CheckPassword event
This commit is contained in:
13
lib/util.php
13
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;
|
||||
|
Reference in New Issue
Block a user