Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Login handler abstraction
|
||||
* Last Updated: $Date: 2010-11-12 13:07:33 -0500 (Fri, 12 Nov 2010) $
|
||||
* Last Updated: $Date: 2011-09-16 17:49:58 -0400 (Fri, 16 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 7174 $
|
||||
* @version $Revision: 9505 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -39,7 +39,7 @@ class han_login
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $modules = array();
|
||||
protected $modules = array();
|
||||
|
||||
/**
|
||||
* Flag :: ACP Login
|
||||
@@ -94,7 +94,7 @@ class han_login
|
||||
* Constructor
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
@@ -162,7 +162,7 @@ class han_login
|
||||
$_sticky = $_time ? 0 : 1;
|
||||
$_days = $_time ? $this->settings['login_key_expire'] : 365;
|
||||
|
||||
if ( $this->settings['login_change_key'] OR !$member['member_login_key'] OR ( $this->settings['login_key_expire'] AND ( time() > $member['member_login_key_expire'] ) ) )
|
||||
if ( !$member['member_login_key'] OR ( $this->settings['login_key_expire'] AND ( time() > $member['member_login_key_expire'] ) ) )
|
||||
{
|
||||
$member['member_login_key'] = IPSMember::generateAutoLoginKey();
|
||||
|
||||
@@ -217,7 +217,7 @@ class han_login
|
||||
'login_type' => $privacy ) );
|
||||
|
||||
|
||||
if ( isset( $this->request['referer'] ) AND $this->request['referer'] AND $this->request['section'] != 'register' )
|
||||
if ( !empty( $this->request['referer'] ) AND $this->request['section'] != 'register' )
|
||||
{
|
||||
if ( stripos( $this->request['referer'], 'section=register' ) OR stripos( $this->request['referer'], 'section=login' ) OR stripos( $this->request['referer'], 'section=lostpass' ) )
|
||||
{
|
||||
@@ -256,6 +256,12 @@ class han_login
|
||||
|
||||
$this->DB->delete( 'validating', 'member_id=' . $this->registry->member()->getProperty('member_id') . ' AND lost_pass=1' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Run member sync
|
||||
//-----------------------------------------
|
||||
|
||||
IPSLib::runMemberSync( 'onLogin', $member );
|
||||
|
||||
//-----------------------------------------
|
||||
// Redirect them to either the board
|
||||
// index, or where they came from
|
||||
@@ -275,9 +281,6 @@ class han_login
|
||||
// Still here?
|
||||
//-----------------------------------------
|
||||
|
||||
/* Member Sync */
|
||||
IPSLib::runMemberSync( 'onLogin', $member );
|
||||
|
||||
return array( $this->registry->getClass('class_localization')->words['partial_login'], str_replace( '?&', '?', $url . '&s=' . $session_id ) );
|
||||
}
|
||||
|
||||
@@ -292,7 +295,7 @@ class han_login
|
||||
$member = array();
|
||||
$username = '';
|
||||
$email = '';
|
||||
$password = trim( $this->request['password'] );
|
||||
$password = trim( $this->request['ips_password'] );
|
||||
$errors = '';
|
||||
$core = array();
|
||||
|
||||
@@ -300,13 +303,13 @@ class han_login
|
||||
// Is this a username or email address?
|
||||
//-----------------------------------------
|
||||
|
||||
if( IPSText::checkEmailAddress( $this->request['username'] ) )
|
||||
if( IPSText::checkEmailAddress( $this->request['ips_username'] ) )
|
||||
{
|
||||
$email = $this->request['username'];
|
||||
$email = $this->request['ips_username'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$username = $this->request['username'];
|
||||
$username = $this->request['ips_username'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -347,6 +350,10 @@ class han_login
|
||||
{
|
||||
return array( null, null, 'wrong_openid' );
|
||||
}
|
||||
else if( $this->return_code == 'MISSING_EXTENSIONS' )
|
||||
{
|
||||
return array( null, null, 'missing_extensions' );
|
||||
}
|
||||
else if( $this->return_code == 'FLAGGED_REMOTE' )
|
||||
{
|
||||
return array( null, null, 'flagged_remote' );
|
||||
@@ -376,7 +383,7 @@ class han_login
|
||||
$_sticky = $_time ? 0 : 1;
|
||||
$_days = $_time ? $this->settings['login_key_expire'] : 365;
|
||||
|
||||
if ( $this->settings['login_change_key'] OR !$member['member_login_key'] OR ( $this->settings['login_key_expire'] AND ( time() > $member['member_login_key_expire'] ) ) )
|
||||
if ( !$member['member_login_key'] OR ( $this->settings['login_key_expire'] AND ( time() > $member['member_login_key_expire'] ) ) )
|
||||
{
|
||||
$member['member_login_key'] = IPSMember::generateAutoLoginKey();
|
||||
|
||||
@@ -418,7 +425,7 @@ class han_login
|
||||
// Create / Update session
|
||||
//-----------------------------------------
|
||||
|
||||
$privacy = $this->request['anonymous'] ? 1 : 0;
|
||||
$privacy = ( !$this->settings['disable_anonymous'] AND $this->request['anonymous'] ) ? 1 : 0;
|
||||
|
||||
if( $member['g_hide_online_list'] )
|
||||
{
|
||||
@@ -431,7 +438,7 @@ class han_login
|
||||
'login_type' => $privacy ) );
|
||||
|
||||
|
||||
if ( $this->request['referer'] AND $this->request['referer'] AND $this->request['section'] != 'register' )
|
||||
if ( !empty($this->request['referer']) AND $this->request['section'] != 'register' )
|
||||
{
|
||||
if ( stripos( $this->request['referer'], 'section=register' ) OR stripos( $this->request['referer'], 'section=login' ) OR stripos( $this->request['referer'], 'section=lostpass' ) OR stripos( $this->request['referer'], CP_DIRECTORY . '/' ) )
|
||||
{
|
||||
@@ -468,6 +475,16 @@ class han_login
|
||||
|
||||
$this->DB->delete( 'validating', 'member_id=' . $this->registry->member()->getProperty('member_id') . ' AND lost_pass=1' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Run member sync
|
||||
//-----------------------------------------
|
||||
|
||||
$member['plainPassword'] = $password;
|
||||
|
||||
IPSLib::runMemberSync( 'onLogin', $member );
|
||||
|
||||
unset( $member['plainPassword'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Redirect them to either the board
|
||||
// index, or where they came from
|
||||
@@ -486,13 +503,6 @@ class han_login
|
||||
//-----------------------------------------
|
||||
// Still here?
|
||||
//-----------------------------------------
|
||||
|
||||
$member['plainPassword'] = $password;
|
||||
|
||||
/* Member Sync */
|
||||
IPSLib::runMemberSync( 'onLogin', $member );
|
||||
|
||||
unset( $member['plainPassword'] );
|
||||
|
||||
return array( $this->registry->getClass('class_localization')->words['partial_login'], $url );
|
||||
}
|
||||
@@ -500,7 +510,7 @@ class han_login
|
||||
/**
|
||||
* Initialize class
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
@@ -508,8 +518,8 @@ class han_login
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_PATH_CUSTOM_LOGIN . '/login_core.php' );
|
||||
require_once( IPS_PATH_CUSTOM_LOGIN . '/login_interface.php' );
|
||||
require_once( IPS_PATH_CUSTOM_LOGIN . '/login_core.php' );/*noLibHook*/
|
||||
require_once( IPS_PATH_CUSTOM_LOGIN . '/login_interface.php' );/*noLibHook*/
|
||||
|
||||
$classes = array();
|
||||
$configs = array();
|
||||
@@ -527,21 +537,12 @@ class han_login
|
||||
{
|
||||
if( $login_method['login_enabled'] )
|
||||
{
|
||||
if( file_exists( IPS_PATH_CUSTOM_LOGIN . '/' . $login_method['login_folder_name'] . '/auth.php' ) )
|
||||
if( is_file( IPS_PATH_CUSTOM_LOGIN . '/' . $login_method['login_folder_name'] . '/auth.php' ) )
|
||||
{
|
||||
$classes[ $login_method['login_order'] ] = IPS_PATH_CUSTOM_LOGIN . '/' . $login_method['login_folder_name'] . '/auth.php';
|
||||
$configs[ $login_method['login_order'] ] = IPS_PATH_CUSTOM_LOGIN . '/' . $login_method['login_folder_name'] . '/conf.php';
|
||||
$this->login_methods[ $login_method['login_order'] ] = $login_method;
|
||||
$this->login_confs[ $login_method['login_order'] ] = array();
|
||||
|
||||
if( file_exists( $configs[ $login_method['login_order'] ] ) )
|
||||
{
|
||||
$LOGIN_CONF = array();
|
||||
|
||||
require( $configs[ $login_method['login_order'] ] );
|
||||
$this->login_confs[ $login_method['login_order'] ] = $LOGIN_CONF;
|
||||
}
|
||||
|
||||
$this->login_confs[ $login_method['login_order'] ] = $login_method['login_custom_config'] ? @unserialize( $login_method['login_custom_config'] ) : array();
|
||||
|
||||
$classname = IPSLib::loadLibrary( $classes[ $login_method['login_order'] ], 'login_' . $login_method['login_folder_name'] );
|
||||
$this->modules[ $login_method['login_order'] ] = new $classname( $this->registry, $login_method, $this->login_confs[ $login_method['login_order'] ] );
|
||||
}
|
||||
@@ -560,24 +561,14 @@ class han_login
|
||||
|
||||
while( $login_method = $this->DB->fetch() )
|
||||
{
|
||||
if( file_exists( IPS_PATH_CUSTOM_LOGIN . '/' . $login_method['login_folder_name'] . '/auth.php' ) )
|
||||
if( is_file( IPS_PATH_CUSTOM_LOGIN . '/' . $login_method['login_folder_name'] . '/auth.php' ) )
|
||||
{
|
||||
$classes[ $login_method['login_order'] ] = IPS_PATH_CUSTOM_LOGIN . '/' . $login_method['login_folder_name'] . '/auth.php';
|
||||
$configs[ $login_method['login_order'] ] = IPS_PATH_CUSTOM_LOGIN . '/' . $login_method['login_folder_name'] . '/conf.php';
|
||||
$this->login_methods[ $login_method['login_order'] ] = $login_method;
|
||||
$this->login_confs[ $login_method['login_order'] ] = $login_method['login_custom_config'] ? @unserialize( $login_method['login_custom_config'] ) : array();
|
||||
|
||||
if( file_exists( $configs[ $login_method['login_order'] ] ) )
|
||||
{
|
||||
$LOGIN_CONF = array();
|
||||
|
||||
require( $configs[ $login_method['login_order'] ] );
|
||||
$this->login_confs[ $login_method['login_order'] ] = $LOGIN_CONF;
|
||||
}
|
||||
|
||||
$classname = "login_" . $login_method['login_folder_name'];
|
||||
|
||||
require_once( $classes[ $login_method['login_order'] ] );
|
||||
$this->modules[ $login_method['login_order'] ] = new $classname( $this->registry, $login_method, $this->login_confs[ $login_method['login_order'] ] );
|
||||
$classToLoad = IPSLib::loadLibrary( $classes[ $login_method['login_order'] ], 'login_' . $login_method['login_folder_name'] );
|
||||
$this->modules[ $login_method['login_order'] ] = new $classToLoad( $this->registry, $login_method, $this->login_confs[ $login_method['login_order'] ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -595,10 +586,9 @@ class han_login
|
||||
$classes[ 0 ] = IPS_PATH_CUSTOM_LOGIN . '/internal/auth.php';
|
||||
$this->login_methods[ 0 ] = $login_method;
|
||||
$this->login_confs[ 0 ] = array();
|
||||
$classname = "login_internal";
|
||||
|
||||
require_once( $classes[ 0 ] );
|
||||
$this->modules[ 0 ] = new $classname( $this->registry, $login_method, array() );
|
||||
$classToLoad = IPSLib::loadLibrary( $classes[ 0 ], 'login_internal' );
|
||||
$this->modules[ 0 ] = new $classToLoad( $this->registry, $login_method, array() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -853,14 +843,14 @@ class han_login
|
||||
$obj_reference->nameExistsCheck( $nameToCheck, $memberData, $fieldToCheck );
|
||||
$this->return_code = $obj_reference->return_code;
|
||||
|
||||
if( $this->return_code AND !in_array( $this->return_code, array( 'NAME_NOT_IN_USE', 'METHOD_NOT_DEFINED', 'WRONG_AUTH', 'WRONG_OPENID' ) ) )
|
||||
if( $this->return_code AND !in_array( $this->return_code, array( 'NAME_NOT_IN_USE', 'METHOD_NOT_DEFINED', 'WRONG_AUTH', 'WRONG_OPENID', 'MISSING_EXTENSIONS' ) ) )
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( $this->return_code AND !in_array( $this->return_code, array( 'NAME_NOT_IN_USE', 'METHOD_NOT_DEFINED', 'WRONG_AUTH', 'WRONG_OPENID' ) ) )
|
||||
if( $this->return_code AND !in_array( $this->return_code, array( 'NAME_NOT_IN_USE', 'METHOD_NOT_DEFINED', 'WRONG_AUTH', 'WRONG_OPENID', 'MISSING_EXTENSIONS' ) ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -887,14 +877,14 @@ class han_login
|
||||
$obj_reference->emailExistsCheck( $email );
|
||||
$this->return_code = $obj_reference->return_code;
|
||||
|
||||
if( $this->return_code AND !in_array( $this->return_code, array( 'EMAIL_NOT_IN_USE', 'METHOD_NOT_DEFINED', 'WRONG_AUTH', 'WRONG_OPENID' ) ) )
|
||||
if( $this->return_code AND !in_array( $this->return_code, array( 'EMAIL_NOT_IN_USE', 'METHOD_NOT_DEFINED', 'WRONG_AUTH', 'WRONG_OPENID', 'MISSING_EXTENSIONS' ) ) )
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( $this->return_code AND !in_array( $this->return_code, array( 'EMAIL_NOT_IN_USE', 'METHOD_NOT_DEFINED', 'WRONG_AUTH', 'WRONG_OPENID' ) ) )
|
||||
if( $this->return_code AND !in_array( $this->return_code, array( 'EMAIL_NOT_IN_USE', 'METHOD_NOT_DEFINED', 'WRONG_AUTH', 'WRONG_OPENID', 'MISSING_EXTENSIONS' ) ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -1016,6 +1006,12 @@ class han_login
|
||||
|
||||
foreach( $this->login_methods as $k => $method )
|
||||
{
|
||||
/* @link http://community.invisionpower.com/tracker/issue-27425-misleading-enter-username-or-email-text */
|
||||
if( in_array( $method['login_folder_name'], array( 'openid', 'live' ) ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if( $method['login_user_id'] == 'either' )
|
||||
{
|
||||
$username = true;
|
||||
|
||||
Reference in new issue
Block a user