EmailAuthentication enabled by default
The login field said "Username or email address" already, so...
This commit is contained in:
parent
37ce1f4766
commit
030639d02d
|
@ -301,6 +301,7 @@ $default =
|
|||
'Activity' => array(),
|
||||
'Bookmark' => array(),
|
||||
'ClientSideShorten' => array(),
|
||||
'EmailAuthentication' => array(),
|
||||
'Event' => array(),
|
||||
'OpenID' => array(),
|
||||
'Poll' => array(),
|
||||
|
|
|
@ -27,27 +27,26 @@
|
|||
* @link http://status.net/
|
||||
*/
|
||||
|
||||
if (!defined('STATUSNET') && !defined('LACONICA')) {
|
||||
exit(1);
|
||||
}
|
||||
if (!defined('GNUSOCIAL')) { exit(1); }
|
||||
|
||||
class EmailAuthenticationPlugin extends Plugin
|
||||
{
|
||||
//---interface implementation---//
|
||||
// $nickname for this plugin is the user's email address
|
||||
function onStartCheckPassword($nickname, $password, &$authenticatedUser)
|
||||
{
|
||||
if(strpos($nickname, '@'))
|
||||
{
|
||||
$user = User::getKV('email',$nickname);
|
||||
if($user && isset($user->email))
|
||||
{
|
||||
if(common_check_user($user->nickname,$password))
|
||||
{
|
||||
$authenticatedUser = $user;
|
||||
return false;
|
||||
}
|
||||
if (!strpos($nickname, '@')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$user = User::getKV('email', $nickname);
|
||||
if ($user instanceof User && $user->email === $nickname) {
|
||||
if (common_check_user($user->nickname, $password)) {
|
||||
$authenticatedUser = $user;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function onPluginVersion(&$versions)
|
||||
|
|
Loading…
Reference in New Issue
Block a user