Version 3.4.6

This commit is contained in:
Neo committed 2025-12-19 00:40:53 -08:00
1 parent e4478369d8
commit b45ea0dffb
1568 files changed
+155104 -161665

No files matched your search

+1 -1
View File
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
IP.Board
</body>
</html>
+222 -222
View File
@@ -1,223 +1,223 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.4.5
* Static SETUP Classes for IP.Board 3
*
* These classes are not required as objects.
* Last Updated: $Date: 2012-06-29 10:12:14 -0400 (Fri, 29 Jun 2012) $
* </pre>
*
* @author Matt Mecham
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @link http://www.invisionpower.com
* @since 1st December 2008
* @version $Revision: 11007 $
*
*/
/**
* Collection of methods to for installation alone
*
* @author Matt
*/
class IPSInstall
{
/**
* Create admin account
*
* @access public
* @return @e void
*/
static public function createAdminAccount()
{
/* Build Entry */
$_mke_time = ( ipsRegistry::$settings['login_key_expire'] ) ? ( time() + ( intval( ipsRegistry::$settings['login_key_expire'] ) * 86400 ) ) : 0;
$salt = IPSMember::generatePasswordSalt( 5 );
$passhash = IPSMember::generateCompiledPasshash( $salt, md5( IPSSetUp::getSavedData('admin_pass') ) );
$_dname = IPSSetUp::getSavedData('admin_user');
$member = array(
'name' => $_dname,
'members_l_username' => mb_strtolower( $_dname ),
'members_display_name' => $_dname,
'members_l_display_name' => mb_strtolower( $_dname ),
'members_seo_name' => IPSText::makeSeoTitle( $_dname ),
'member_login_key' => IPSMember::generateAutoLoginKey(),
'member_login_key_expire' => $_mke_time,
'title' => 'Администратор',
'email' => IPSSetUp::getSavedData('admin_email') ,
'member_group_id' => 4,
'posts' => 1,
'joined' => time(),
'last_visit' => time(),
'last_activity' => time(),
'ip_address' => my_getenv('REMOTE_ADDR'),
'view_sigs' => 1,
'restrict_post' => 0,
'msg_show_notification' => 1,
'msg_count_total' => 0,
'msg_count_new' => 0,
'coppa_user' => 0,
'language' => IPSLib::getDefaultLanguage(),
'members_auto_dst' => 1,
'member_uploader' => 'flash',
'allow_admin_mails' => 0,
'members_pass_hash' => $passhash,
'members_pass_salt' => $salt,
'has_blog' => '',
'fb_token' => '',
'ignored_users' => '',
'members_cache' => '',
'failed_logins' => '',
'bday_day' => 0,
'bday_month' => 0,
'bday_year' => 0
);
/* Insert: MEMBERS */
ipsRegistry::DB()->setDataType( array( 'name', 'members_display_name', 'members_l_username', 'members_l_display_name' ), 'string' );
ipsRegistry::DB()->insert( 'members', $member );
$member_id = ipsRegistry::DB()->getInsertId();
$member['member_id'] = $member_id;
/* Insert into the custom profile fields DB */
ipsRegistry::DB()->insert( 'pfields_content', array( 'member_id' => $member_id ) );
/* Insert into pp */
ipsRegistry::DB()->insert( 'profile_portal', array(
'pp_member_id' => $member_id,
'pp_setting_count_friends' => 1,
'signature' => '',
'pconversation_filters' => '',
'pp_setting_count_comments' => 1,
'pp_setting_count_visitors' => 1 ) );
}
/**
* Writes out conf_global
*
* @access public
* @return bool File written successfully
*/
static public function writeConfiguration()
{
//-----------------------------------------
// Safe mode?
//-----------------------------------------
$safe_mode = 0;
if ( @get_cfg_var('safe_mode') )
{
$safe_mode = @get_cfg_var('safe_mode');
}
//-----------------------------------------
// Set info array
//-----------------------------------------
$INFO = array(
'sql_driver' => IPSSetUp::getSavedData('sql_driver'),
'sql_host' => IPSSetUp::getSavedData('db_host'),
'sql_database' => IPSSetUp::getSavedData('db_name'),
'sql_user' => IPSSetUp::getSavedData('db_user'),
'sql_pass' => str_replace( '\'', '\\\'', IPSSetUp::getSavedData('db_pass') ),
'sql_tbl_prefix' => IPSSetUp::getSavedData('db_pre'),
'sql_debug' => 0,
'sql_charset' => 'utf8',
'board_start' => time(),
'installed' => 1,
'php_ext' => 'php',
'safe_mode' => $safe_mode,
//'base_url' => IPSSetUp::getSavedData('install_url'),
'board_url' => IPSSetUp::getSavedData('install_url'),
'banned_group' => '5',
'admin_group' => '4',
'guest_group' => '2',
'member_group' => '3',
'auth_group' => '1',
'use_friendly_urls' => 1,
'_jsDebug' => 0
);
//---------------------------------------------
// Any "extra" configs required for this driver?
//---------------------------------------------
foreach( IPSSetUp::getSavedDataAsArray() as $k => $v )
{
if ( preg_match( "#^__sql__#", $k ) )
{
$k = str_replace( "__sql__", "", $k );
$INFO[ $k ] = $v;
}
}
//---------------------------------------------
// Write to disk
//---------------------------------------------
$core_conf = "<"."?php\n";
foreach( $INFO as $k => $v )
{
$core_conf .= '$INFO['."'".$k."'".']'."\t\t\t=\t'".$v."';\n";
}
$core_conf .= "\ndefine('IN_DEV', 0);";
/* Remote archive stuff */
$core_conf .= "\n/* Remote archive DB - complete these details if you\'re using a remote DB for the post archive.\n If content has already been archived in the local DB, this will need transferring and will not be done automatically. */\n";
foreach( array( 'archive_remote_sql_host', 'archive_remote_sql_database', 'archive_remote_sql_user', 'archive_remote_sql_pass', 'archive_remote_sql_charset' ) as $k )
{
$core_conf .= '$INFO['."'".$k."'".']'."\t\t\t=\t'';\n";
}
$core_conf .= "\n".'?'.'>';
/* Write Configuration Files */
$output[] = 'Запись файлов настройки<br />';
$ret = IPSSetUp::writeFile( IPSSetUp::getSavedData('install_dir') . '/conf_global.php' , $core_conf );
/* Now freeze data */
IPSSetUp::freezeSavedData();
return $ret;
}
/**
* Clean up conf global
* Removes data variables
*
* @access public
* @return boolean
*/
static public function cleanConfGlobal()
{
if ( $contents = @file_get_contents( IPSSetUp::getSavedData('install_dir') . '/conf_global.php' ) )
{
if ( $contents )
{
$contents = preg_replace( "#/\*~~DATA~~\*/(.+?)\n/\*\*/#s", "", $contents );
return IPSSetUp::writeFile( IPSSetUp::getSavedData('install_dir') . '/conf_global.php' , $contents );
}
}
return FALSE;
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.4.6
* Static SETUP Classes for IP.Board 3
*
* These classes are not required as objects.
* Last Updated: $Date: 2012-06-29 10:12:14 -0400 (Fri, 29 Jun 2012) $
* </pre>
*
* @author Matt Mecham
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @link http://www.invisionpower.com
* @since 1st December 2008
* @version $Revision: 11007 $
*
*/
/**
* Collection of methods to for installation alone
*
* @author Matt
*/
class IPSInstall
{
/**
* Create admin account
*
* @access public
* @return @e void
*/
static public function createAdminAccount()
{
/* Build Entry */
$_mke_time = ( ipsRegistry::$settings['login_key_expire'] ) ? ( time() + ( intval( ipsRegistry::$settings['login_key_expire'] ) * 86400 ) ) : 0;
$salt = IPSMember::generatePasswordSalt( 5 );
$passhash = IPSMember::generateCompiledPasshash( $salt, md5( IPSSetUp::getSavedData('admin_pass') ) );
$_dname = IPSSetUp::getSavedData('admin_user');
$member = array(
'name' => $_dname,
'members_l_username' => strtolower( $_dname ),
'members_display_name' => $_dname,
'members_l_display_name' => strtolower( $_dname ),
'members_seo_name' => IPSText::makeSeoTitle( $_dname ),
'member_login_key' => IPSMember::generateAutoLoginKey(),
'member_login_key_expire' => $_mke_time,
'title' => 'Administrator',
'email' => IPSSetUp::getSavedData('admin_email') ,
'member_group_id' => 4,
'posts' => 1,
'joined' => time(),
'last_visit' => time(),
'last_activity' => time(),
'ip_address' => my_getenv('REMOTE_ADDR'),
'view_sigs' => 1,
'restrict_post' => 0,
'msg_show_notification' => 1,
'msg_count_total' => 0,
'msg_count_new' => 0,
'coppa_user' => 0,
'language' => IPSLib::getDefaultLanguage(),
'members_auto_dst' => 1,
'member_uploader' => 'flash',
'allow_admin_mails' => 0,
'members_pass_hash' => $passhash,
'members_pass_salt' => $salt,
'has_blog' => '',
'fb_token' => '',
'ignored_users' => '',
'members_cache' => '',
'failed_logins' => '',
'bday_day' => 0,
'bday_month' => 0,
'bday_year' => 0
);
/* Insert: MEMBERS */
ipsRegistry::DB()->setDataType( array( 'name', 'members_display_name', 'members_l_username', 'members_l_display_name' ), 'string' );
ipsRegistry::DB()->insert( 'members', $member );
$member_id = ipsRegistry::DB()->getInsertId();
$member['member_id'] = $member_id;
/* Insert into the custom profile fields DB */
ipsRegistry::DB()->insert( 'pfields_content', array( 'member_id' => $member_id ) );
/* Insert into pp */
ipsRegistry::DB()->insert( 'profile_portal', array(
'pp_member_id' => $member_id,
'pp_setting_count_friends' => 1,
'signature' => '',
'pconversation_filters' => '',
'pp_setting_count_comments' => 1,
'pp_setting_count_visitors' => 1 ) );
}
/**
* Writes out conf_global
*
* @access public
* @return bool File written successfully
*/
static public function writeConfiguration()
{
//-----------------------------------------
// Safe mode?
//-----------------------------------------
$safe_mode = 0;
if ( @get_cfg_var('safe_mode') )
{
$safe_mode = @get_cfg_var('safe_mode');
}
//-----------------------------------------
// Set info array
//-----------------------------------------
$INFO = array(
'sql_driver' => IPSSetUp::getSavedData('sql_driver'),
'sql_host' => IPSSetUp::getSavedData('db_host'),
'sql_database' => IPSSetUp::getSavedData('db_name'),
'sql_user' => IPSSetUp::getSavedData('db_user'),
'sql_pass' => str_replace( '\'', '\\\'', IPSSetUp::getSavedData('db_pass') ),
'sql_tbl_prefix' => IPSSetUp::getSavedData('db_pre'),
'sql_debug' => 0,
'sql_charset' => '',
'board_start' => time(),
'installed' => 1,
'php_ext' => 'php',
'safe_mode' => $safe_mode,
//'base_url' => IPSSetUp::getSavedData('install_url'),
'board_url' => IPSSetUp::getSavedData('install_url'),
'banned_group' => '5',
'admin_group' => '4',
'guest_group' => '2',
'member_group' => '3',
'auth_group' => '1',
'use_friendly_urls' => 1,
'_jsDebug' => 0
);
//---------------------------------------------
// Any "extra" configs required for this driver?
//---------------------------------------------
foreach( IPSSetUp::getSavedDataAsArray() as $k => $v )
{
if ( preg_match( "#^__sql__#", $k ) )
{
$k = str_replace( "__sql__", "", $k );
$INFO[ $k ] = $v;
}
}
//---------------------------------------------
// Write to disk
//---------------------------------------------
$core_conf = "<"."?php\n";
foreach( $INFO as $k => $v )
{
$core_conf .= '$INFO['."'".$k."'".']'."\t\t\t=\t'".$v."';\n";
}
$core_conf .= "\ndefine('IN_DEV', 0);";
/* Remote archive stuff */
$core_conf .= "\n/* Remote archive DB - complete these details if you\'re using a remote DB for the post archive.\n If content has already been archived in the local DB, this will need transferring and will not be done automatically. */\n";
foreach( array( 'archive_remote_sql_host', 'archive_remote_sql_database', 'archive_remote_sql_user', 'archive_remote_sql_pass', 'archive_remote_sql_charset' ) as $k )
{
$core_conf .= '$INFO['."'".$k."'".']'."\t\t\t=\t'';\n";
}
$core_conf .= "\n".'?'.'>';
/* Write Configuration Files */
$output[] = 'Writing configuration files...<br />';
$ret = IPSSetUp::writeFile( IPSSetUp::getSavedData('install_dir') . '/conf_global.php' , $core_conf );
/* Now freeze data */
IPSSetUp::freezeSavedData();
return $ret;
}
/**
* Clean up conf global
* Removes data variables
*
* @access public
* @return boolean
*/
static public function cleanConfGlobal()
{
if ( $contents = @file_get_contents( IPSSetUp::getSavedData('install_dir') . '/conf_global.php' ) )
{
if ( $contents )
{
$contents = preg_replace( "#/\*~~DATA~~\*/(.+?)\n/\*\*/#s", "", $contents );
return IPSSetUp::writeFile( IPSSetUp::getSavedData('install_dir') . '/conf_global.php' , $contents );
}
}
return FALSE;
}
}
@@ -1,301 +1,301 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.4.5
* ipsController for setup
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author Matt Mecham
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @link http://www.invisionpower.com
* @since 1st December 2008
* @version $Revision: 10721 $
*
*/
/**
* Class "Controller"
* A very simple public facing interface to resolve incoming data into
* a command class
*
* @author Matt Mecham
* @since Wednesday 14th May 2008
* @package IP.Board
* @ignore
*/
class ipsController
{
/**
* Registry reference
*
* @access private
* @var object
*/
private $registry;
/**
* Current command
*
* @access public
* @var object
*/
static public $cmd;
/**
* Make us a singleton please
*
* @access private
* @return @e void
*/
private function __construct() { }
/**
* Public facing function to run the controller
*
* @access public
* @return @e void
*/
static public function run()
{
$instance = new ipsController();
$instance->init();
$instance->handleRequest();
}
/**
* Initialize ipsRegistry and this class
*
* @access protected
* @return @e void
*/
protected function init()
{
$this->registry = ipsRegistry::instance();
$this->registry->init();
}
/**
* Handle the incoming request using the command resolver
*
* @access protected
* @return @e void
*/
protected function handleRequest()
{
$cmd_r = new ipsController_CommandResolver();
self::$cmd = $cmd_r->getCommand( $this->registry );
self::$cmd->execute( $this->registry );
}
}
/**
* Class "Command Resolver"
* Resolves the incoming data
*
* @author Matt Mecham
* @since Wednesday 14th May 2008
* @package IP.Board
*/
class ipsController_CommandResolver
{
/**
* Base command
*
* @access private
* @var object
*/
private static $base_cmd;
/**
* AJAX command
*
* @access private
* @var object
*/
private static $ajax_cmd;
/**
* Default command
*
* @access private
* @var object
*/
private static $default_cmd;
/**
* Constructor
*
* @access public
* @return @e void
*/
public function __construct()
{
if ( ! self::$base_cmd )
{
self::$base_cmd = new ReflectionClass( 'ipsCommand' );
self::$default_cmd = new ipsCommand_default();
}
}
/**
* Get the command
*
* @access public
* @param object ipsRegistry reference
* @return object Command object
*/
public function getCommand( ipsRegistry $registry )
{
$module = ipsRegistry::$current_module;
$section = ipsRegistry::$current_section;
$filepath = ( IPS_IS_UPGRADER ) ? IPS_ROOT_PATH . 'setup/applications/upgrade/sections/' : IPS_ROOT_PATH . 'setup/applications/install/sections/';
/* Got a section? */
if ( ! $section )
{
if ( is_file( $filepath . 'index.php' ) )
{
$section = 'index';
}
}
$classname = IPS_APP_COMPONENT . '_' . $section;
if ( is_file( $filepath . 'manualResolver.php' ) )
{
require_once( $filepath . 'manualResolver.php' );/*noLibHook*/
$classname = IPS_APP_COMPONENT . '_' . $module . '_manualResolver';
}
else if ( is_file( $filepath . $section . '.php' ) )
{
require_once( $filepath . $section . '.php' );/*noLibHook*/
}
if ( class_exists( $classname ) )
{
$cmd_class = new ReflectionClass( $classname );
if ( $cmd_class->isSubClassOf( self::$base_cmd ) )
{
return $cmd_class->newInstance();
}
else
{
throw new Exception( "{$section} в модуле {$module} не существует!" );
}
}
# Fudge it to return just the default object
return clone self::$default_cmd;
}
}
abstract class ipsCommand
{
/**#@+
* Registry Object Shortcuts
*
* @access protected
* @var object
*/
protected $registry;
protected $DB;
protected $settings;
public $request;
protected $lang;
protected $member;
protected $memberData;
protected $cache;
protected $caches;
/**#@-*/
/**
* Constructor override
*
* @access public
* @return @e void
*/
final public function __construct()
{
}
/**
* Create registry shortcuts
*
* @access public
* @param object ipsRegistry reference
* @return @e void
*/
public function makeRegistryShortcuts( ipsRegistry $registry )
{
/* Make registry objects */
$this->registry = $registry;
$this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest();
$this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
}
/**
* Execute the commands
*
* @access public
* @param object ipsRegistry reference
* @return @e void
*/
public function execute( ipsRegistry $registry )
{
$this->makeRegistryShortcuts( $registry );
$this->doExecute( $registry );
}
/**
* doExecute, most be override
*
* @access protected
* @param object ipsRegistry reference
* @return @e void
*/
protected abstract function doExecute( ipsRegistry $registry );
}
class ipsCommand_default extends ipsCommand
{
/**
* Main execution method
*
* @access public
* @param object ipsRegistry reference
* @return @e void
*/
protected function doExecute( ipsRegistry $registry )
{
$filepath = IPSLib::getAppDir( IPS_APP_COMPONENT ) . '/modules/' . ipsRegistry::$current_module . '/' . ipsRegistry::$current_section . '.php';
$filepath = str_replace( DOC_IPS_ROOT_PATH, '', $filepath );
//-----------------------------------------
// Uh oh, this is a big one.. (no forums app)
//-----------------------------------------
if ( ! is_file( $filepath ) )
{
print "Command File " . ipsRegistry::$current_module . " missing";
exit();
}
else
{
print "Nothing to do!";
exit();
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.4.6
* ipsController for setup
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author Matt Mecham
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @link http://www.invisionpower.com
* @since 1st December 2008
* @version $Revision: 10721 $
*
*/
/**
* Class "Controller"
* A very simple public facing interface to resolve incoming data into
* a command class
*
* @author Matt Mecham
* @since Wednesday 14th May 2008
* @package IP.Board
* @ignore
*/
class ipsController
{
/**
* Registry reference
*
* @access private
* @var object
*/
private $registry;
/**
* Current command
*
* @access public
* @var object
*/
static public $cmd;
/**
* Make us a singleton please
*
* @access private
* @return @e void
*/
private function __construct() { }
/**
* Public facing function to run the controller
*
* @access public
* @return @e void
*/
static public function run()
{
$instance = new ipsController();
$instance->init();
$instance->handleRequest();
}
/**
* Initialize ipsRegistry and this class
*
* @access protected
* @return @e void
*/
protected function init()
{
$this->registry = ipsRegistry::instance();
$this->registry->init();
}
/**
* Handle the incoming request using the command resolver
*
* @access protected
* @return @e void
*/
protected function handleRequest()
{
$cmd_r = new ipsController_CommandResolver();
self::$cmd = $cmd_r->getCommand( $this->registry );
self::$cmd->execute( $this->registry );
}
}
/**
* Class "Command Resolver"
* Resolves the incoming data
*
* @author Matt Mecham
* @since Wednesday 14th May 2008
* @package IP.Board
*/
class ipsController_CommandResolver
{
/**
* Base command
*
* @access private
* @var object
*/
private static $base_cmd;
/**
* AJAX command
*
* @access private
* @var object
*/
private static $ajax_cmd;
/**
* Default command
*
* @access private
* @var object
*/
private static $default_cmd;
/**
* Constructor
*
* @access public
* @return @e void
*/
public function __construct()
{
if ( ! self::$base_cmd )
{
self::$base_cmd = new ReflectionClass( 'ipsCommand' );
self::$default_cmd = new ipsCommand_default();
}
}
/**
* Get the command
*
* @access public
* @param object ipsRegistry reference
* @return object Command object
*/
public function getCommand( ipsRegistry $registry )
{
$module = ipsRegistry::$current_module;
$section = ipsRegistry::$current_section;
$filepath = ( IPS_IS_UPGRADER ) ? IPS_ROOT_PATH . 'setup/applications/upgrade/sections/' : IPS_ROOT_PATH . 'setup/applications/install/sections/';
/* Got a section? */
if ( ! $section )
{
if ( is_file( $filepath . 'index.php' ) )
{
$section = 'index';
}
}
$classname = IPS_APP_COMPONENT . '_' . $section;
if ( is_file( $filepath . 'manualResolver.php' ) )
{
require_once( $filepath . 'manualResolver.php' );/*noLibHook*/
$classname = IPS_APP_COMPONENT . '_' . $module . '_manualResolver';
}
else if ( is_file( $filepath . $section . '.php' ) )
{
require_once( $filepath . $section . '.php' );/*noLibHook*/
}
if ( class_exists( $classname ) )
{
$cmd_class = new ReflectionClass( $classname );
if ( $cmd_class->isSubClassOf( self::$base_cmd ) )
{
return $cmd_class->newInstance();
}
else
{
throw new Exception( "{$section} in {$module} does not exist!" );
}
}
# Fudge it to return just the default object
return clone self::$default_cmd;
}
}
abstract class ipsCommand
{
/**#@+
* Registry Object Shortcuts
*
* @access protected
* @var object
*/
protected $registry;
protected $DB;
protected $settings;
public $request;
protected $lang;
protected $member;
protected $memberData;
protected $cache;
protected $caches;
/**#@-*/
/**
* Constructor override
*
* @access public
* @return @e void
*/
final public function __construct()
{
}
/**
* Create registry shortcuts
*
* @access public
* @param object ipsRegistry reference
* @return @e void
*/
public function makeRegistryShortcuts( ipsRegistry $registry )
{
/* Make registry objects */
$this->registry = $registry;
$this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest();
$this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
}
/**
* Execute the commands
*
* @access public
* @param object ipsRegistry reference
* @return @e void
*/
public function execute( ipsRegistry $registry )
{
$this->makeRegistryShortcuts( $registry );
$this->doExecute( $registry );
}
/**
* doExecute, most be override
*
* @access protected
* @param object ipsRegistry reference
* @return @e void
*/
protected abstract function doExecute( ipsRegistry $registry );
}
class ipsCommand_default extends ipsCommand
{
/**
* Main execution method
*
* @access public
* @param object ipsRegistry reference
* @return @e void
*/
protected function doExecute( ipsRegistry $registry )
{
$filepath = IPSLib::getAppDir( IPS_APP_COMPONENT ) . '/modules/' . ipsRegistry::$current_module . '/' . ipsRegistry::$current_section . '.php';
$filepath = str_replace( DOC_IPS_ROOT_PATH, '', $filepath );
//-----------------------------------------
// Uh oh, this is a big one.. (no forums app)
//-----------------------------------------
if ( ! is_file( $filepath ) )
{
print "Command File " . ipsRegistry::$current_module . " missing";
exit();
}
else
{
print "Nothing to do!";
exit();
}
}
}
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -3,7 +3,7 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.4.5
* IP.Board v3.4.6
* Static SETUP Classes for IP.Board 3
*
* These classes are not required as objects.
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
IP.Board
</body>
</html>
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
IP.Board
</body>
</html>
File diff suppressed because it is too large. Load diff
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
IP.Board
</body>
</html>
@@ -1,264 +1,264 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.4.5
* Setup sessions class
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author Matt Mecham
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @link http://www.invisionpower.com
* @since 1st December 2008
* @version $Revision: 10721 $
*
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
define( 'IPB_UPGRADER_IP_MATCH', FALSE );
/**
* Sessions class for setup
* @ignore
*/
class sessions extends ips_MemberRegistry
{
/**
* Variable for session validated
*
* @access private
* @var array
*/
private $_data = array();
/**
* Time out seconds
*
* @access private
* @var int
*/
private $_time_out_secs = 86400;
/**
* ACP session id
*
* @access private
* @var string
*/
private $_adsess = '';
/**
* Validated?
*
* @access private
* @var bool
*/
private $_validated = false;
/**
* Message to pass
*
* @access private
* @var string
*/
private $_message;
/**
* Authorize
*
* @access public
* @return @e void
*/
public function __construct()
{
/* Make object */
$this->registry = ipsRegistry::instance();
$this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest();
/* Grab session */
$_s = IPSText::md5Clean( $this->request['s'] );
/* Got a session? */
if ( ! $_s )
{
return $this->_response( 0, '' );
}
else
{
$this->DB->build( array( 'select' => '*',
'from' => 'upgrade_sessions',
'where' => "session_id='" . $_s . "'" ) );
$this->DB->execute();
$_data = $this->DB->fetch();
if ( ! $_data['session_id'] )
{
/* No record found */
return $this->_response( 0, '' );
}
else if ( ! $_data['session_member_id'] )
{
/* No member ID found */
return $this->_response( 0, 'Невозможно получить корректный ID пользователя' );
}
else
{
/* Load member */
self::instance()->data_store = $this->registry->getClass('legacy')->loadMemberData( $_data['session_member_id'] );
/* Member exists? */
if ( ! self::instance()->data_store['email'] )
{
return $this->_response( 0, 'Неверный Email пользователя' );
}
else
{
/* Authenticate */
if ( $_data['session_member_key'] != $this->registry->getClass('legacy')->fetchAuthKey() )
{
return $this->_response( 0, 'Неверный ключ сессии' );
}
else
{
/* ACP access? */
if ( self::instance()->data_store['g_access_cp'] != 1)
{
return $this->_response( 0, 'У вас нет доступа к администраторским функциям' );
}
else
{
$this->_validated = TRUE;
}
}
}
}
}
//--------------------------------------------
// If we're here, we're valid...
//--------------------------------------------
if ( $this->_validated === TRUE )
{
self::setUpMember();
if ( $_data['session_current_time'] < ( time() - $this->_time_out_secs ) )
{
return $this->_response( 0, '' );
}
/* Check IPs? */
else if ( IPB_UPGRADER_IP_MATCH )
{
$first_ip = preg_replace( "/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/", "\\1.\\2.\\3", $_data['session_ip_address'] );
$second_ip = preg_replace( "/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/", "\\1.\\2.\\3", self::instance()->ip_address );
if ( $first_ip != $second_ip )
{
return $this->_response( 0, 'Ваш IP адрес не совпадает ни с одной из наших записей' );
}
}
/* Still here? Lets update the session, then */
$this->DB->update( 'upgrade_sessions', array( 'session_current_time' => time(),
'session_section' => $this->request['section'],
'session_post' => serialize( $_POST ),
'session_get' => serialize( $_GET ) ), 'session_id=\'' . $this->request['s'] . '\'' );
/* If we're hitting the index and we have a valid session, go right to overview */
if ( ! $this->request['section'] OR $this->request['section'] == 'index' )
{
$this->request['section'] = 'overview';
}
return $this->_response( 1, '' );
}
}
/**
* Create a session
*
* @access public
* @param array Array of member Data
* @param string Auth Key
* @return nufink
*/
public function createSession( $member, $authKey )
{
$_bash = time() - $this->_time_out_secs;
$_s = md5( uniqid( microtime(), true ) . self::instance()->ip_address );
if ( $member['member_id'] AND $authKey )
{
$this->DB->delete( 'upgrade_sessions', 'session_current_time < ' . $_bash . ' AND session_section=\'done\'' );
$this->DB->insert( 'upgrade_sessions', array( 'session_id' => $_s,
'session_member_id' => $member['member_id'],
'session_member_key' => $authKey,
'session_start_time' => time(),
'session_current_time' => time(),
'session_ip_address' => self::instance()->ip_address,
'session_section' => 'index',
'session_post' => serialize( array() ),
'session_get' => serialize( array() ),
'session_data' => serialize( array() ),
'session_extra' => '' ) );
return $_s;
}
else
{
return FALSE;
}
}
/**
* Get the validation code
*
* @access public
* @return mixed
*/
public function getStatus()
{
return $this->_validated;
}
/**
* Get the validation message
*
* @access public
* @return string
*/
public function getMessage()
{
return $this->_message;
}
/**
* Set the response
*
* @access protected
* @param bool Validated
* @param string Message
* @return mixed
*/
protected function _response( $validated, $message )
{
$this->_validated = $validated;
$this->_message = $message;
return;
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.4.6
* Setup sessions class
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author Matt Mecham
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @link http://www.invisionpower.com
* @since 1st December 2008
* @version $Revision: 10721 $
*
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
define( 'IPB_UPGRADER_IP_MATCH', FALSE );
/**
* Sessions class for setup
* @ignore
*/
class sessions extends ips_MemberRegistry
{
/**
* Variable for session validated
*
* @access private
* @var array
*/
private $_data = array();
/**
* Time out seconds
*
* @access private
* @var int
*/
private $_time_out_secs = 86400;
/**
* ACP session id
*
* @access private
* @var string
*/
private $_adsess = '';
/**
* Validated?
*
* @access private
* @var bool
*/
private $_validated = false;
/**
* Message to pass
*
* @access private
* @var string
*/
private $_message;
/**
* Authorize
*
* @access public
* @return @e void
*/
public function __construct()
{
/* Make object */
$this->registry = ipsRegistry::instance();
$this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest();
/* Grab session */
$_s = IPSText::md5Clean( $this->request['s'] );
/* Got a session? */
if ( ! $_s )
{
return $this->_response( 0, '' );
}
else
{
$this->DB->build( array( 'select' => '*',
'from' => 'upgrade_sessions',
'where' => "session_id='" . $_s . "'" ) );
$this->DB->execute();
$_data = $this->DB->fetch();
if ( ! $_data['session_id'] )
{
/* No record found */
return $this->_response( 0, '' );
}
else if ( ! $_data['session_member_id'] )
{
/* No member ID found */
return $this->_response( 0, 'Could not retrieve a valid member id' );
}
else
{
/* Load member */
self::instance()->data_store = $this->registry->getClass('legacy')->loadMemberData( $_data['session_member_id'] );
/* Member exists? */
if ( ! self::instance()->data_store['email'] )
{
return $this->_response( 0, 'Member Email invalid' );
}
else
{
/* Authenticate */
if ( $_data['session_member_key'] != $this->registry->getClass('legacy')->fetchAuthKey() )
{
return $this->_response( 0, 'Session not authenticated' );
}
else
{
/* ACP access? */
if ( self::instance()->data_store['g_access_cp'] != 1)
{
return $this->_response( 0, 'You do not have access to the administrative CP' );
}
else
{
$this->_validated = TRUE;
}
}
}
}
}
//--------------------------------------------
// If we're here, we're valid...
//--------------------------------------------
if ( $this->_validated === TRUE )
{
self::setUpMember();
if ( $_data['session_current_time'] < ( time() - $this->_time_out_secs ) )
{
return $this->_response( 0, '' );
}
/* Check IPs? */
else if ( IPB_UPGRADER_IP_MATCH )
{
$first_ip = preg_replace( "/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/", "\\1.\\2.\\3", $_data['session_ip_address'] );
$second_ip = preg_replace( "/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/", "\\1.\\2.\\3", self::instance()->ip_address );
if ( $first_ip != $second_ip )
{
return $this->_response( 0, 'Your current IP address does not match the one in our records' );
}
}
/* Still here? Lets update the session, then */
$this->DB->update( 'upgrade_sessions', array( 'session_current_time' => time(),
'session_section' => $this->request['section'],
'session_post' => serialize( $_POST ),
'session_get' => serialize( $_GET ) ), 'session_id=\'' . $this->request['s'] . '\'' );
/* If we're hitting the index and we have a valid session, go right to overview */
if ( ! $this->request['section'] OR $this->request['section'] == 'index' )
{
$this->request['section'] = 'overview';
}
return $this->_response( 1, '' );
}
}
/**
* Create a session
*
* @access public
* @param array Array of member Data
* @param string Auth Key
* @return nufink
*/
public function createSession( $member, $authKey )
{
$_bash = time() - $this->_time_out_secs;
$_s = md5( uniqid( microtime(), true ) . self::instance()->ip_address );
if ( $member['member_id'] AND $authKey )
{
$this->DB->delete( 'upgrade_sessions', 'session_current_time < ' . $_bash . ' AND session_section=\'done\'' );
$this->DB->insert( 'upgrade_sessions', array( 'session_id' => $_s,
'session_member_id' => $member['member_id'],
'session_member_key' => $authKey,
'session_start_time' => time(),
'session_current_time' => time(),
'session_ip_address' => self::instance()->ip_address,
'session_section' => 'index',
'session_post' => serialize( array() ),
'session_get' => serialize( array() ),
'session_data' => serialize( array() ),
'session_extra' => '' ) );
return $_s;
}
else
{
return FALSE;
}
}
/**
* Get the validation code
*
* @access public
* @return mixed
*/
public function getStatus()
{
return $this->_validated;
}
/**
* Get the validation message
*
* @access public
* @return string
*/
public function getMessage()
{
return $this->_message;
}
/**
* Set the response
*
* @access protected
* @param bool Validated
* @param string Message
* @return mixed
*/
protected function _response( $validated, $message )
{
$this->_validated = $validated;
$this->_message = $message;
return;
}
}
+1 -1
View File
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
IP.Board
</body>
</html>
+221 -221
View File
@@ -1,222 +1,222 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.4.5
* Version Specific Upgrade Functions
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author Matt Mecham
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @link http://www.invisionpower.com
* @since 1st December 2008
* @version $Revision: 10721 $
*
*/
class upgradeLegacy
{
/**
* Member data
*
* @access private
* @var array
*/
private $_member;
/**
* Constructor
*
* @access public
* @return @e void
*/
public function __construct( ipsRegistry $registry )
{
/* Make object */
$this->registry = $registry;
$this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
//* Make sure tables exist that won't in pre 3.0 versions */
if ( is_file( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' ) )
{
/* Init vars */
$UPGRADE_HISTORY_TABLE = '';
$UPGRADE_TABLE_FIELD = '';
$UPGRADE_SESSION_TABLE = '';
$UPGRADE_CSS_PREVIOUS = '';
$UPGRADE_TEMPLATE_PREVIOUS = '';
require( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' );/*noLibHook*/
$prefix = $this->registry->dbFunctions()->getPrefix();
if ( ! $this->DB->checkForTable( 'upgrade_history' ) )
{
if ( $UPGRADE_HISTORY_TABLE )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_HISTORY_TABLE, $prefix ) );
}
}
if ( ! $this->DB->checkForField( 'upgrade_app', 'upgrade_history' ) )
{
if ( $UPGRADE_TABLE_FIELD )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TABLE_FIELD, $prefix ) );
}
}
if ( ! $this->DB->checkForTable( 'upgrade_sessions' ) )
{
if ( $UPGRADE_SESSION_TABLE )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_SESSION_TABLE, $prefix ) );
}
}
if ( ! $this->DB->checkForTable( 'skin_css_previous' ) )
{
if ( $UPGRADE_CSS_PREVIOUS )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_CSS_PREVIOUS, $prefix ) );
}
}
if ( ! $this->DB->checkForTable( 'skin_templates_previous' ) )
{
if ( $UPGRADE_TEMPLATE_PREVIOUS )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TEMPLATE_PREVIOUS, $prefix ) );
}
}
}
}
/**
* Fetch auth key
*
* @access public
* @return string
*/
public function fetchAuthKey()
{
if ( ! $this->_member['id'] AND ! $this->_member['member_id'] )
{
throw new Exception( "MEMBER NOT SET" );
}
else
{
return ( $this->_member['password'] ) ? md5( $this->_member['password'] ) : md5( $this->_member['legacy_password'] );
}
}
/**
* Fetch member data
*
* @access public
* @return array
*/
public function fetchMemberData()
{
return ( is_array( $this->_member ) ) ? $this->_member : array();
}
/**
* Load and return member data
*
* @access public
* @param int Member ID to load
* @return array
*/
public function loadMemberData( $memberId )
{
/* Attempt to load member */
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'members' => 'm' ),
'where' => 'm.id=' . intval( $memberId ),
'add_join' => array( array( 'select' => 'g.*',
'from' => array( 'groups' => 'g' ),
'where' => 'g.g_id=m.mgroup' ) ) ) );
$this->DB->execute();
$this->_member = $this->DB->fetch();
/* Fix up pre-3 stuffs */
$this->_member['member_id'] = $this->_member['id'];
$this->_member['member_group_id'] = $this->_member['mgroup'];
/* Occasionally 1.x installs do not have an email address. Most likey an InvisionFree issue */
if ( ! $this->_member['email'] )
{
$this->DB->update( 'members', array( 'email' => 'email_' . $this->_member['id'] . '_@changeMe.com' ), 'id=' . $memberId );
}
return $this->fetchMemberData();
}
/**
* Authenticate log in
*
* @access public
* @param string Username (from $this->request)
* @param string Password (from $this->request)
* @return mixed TRUE if successful, string (message) if not
*/
public function authenticateLogIn( $username, $password )
{
/* Attempt to load member */
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'members' => 'm' ),
'where' => $this->DB->buildLower('m.name') . "='" . mb_strtolower( $username ) . "'",
'add_join' => array( array( 'select' => 'g.*',
'from' => array( 'groups' => 'g' ),
'where' => 'g.g_id=m.mgroup' ) ) ) );
$this->DB->execute();
$mem = $this->DB->fetch();
$pass = md5( $password );
/* Check it out */
if ( ! $mem['id'] )
{
return 'Пользователь с таким именем не найден';
}
if ( $pass != $mem['password'] AND $pass != $mem['legacy_password'] )
{
return 'Неверный пароль';
}
if ( $mem['g_access_cp'] != 1 )
{
return 'У вас нет доступа к системе обновления';
}
/* Set up _member */
$this->loadMemberData( $mem['id'] );
/* Still here? */
return TRUE;
}
/**
* Return log in form HTML
*
* @access public
* @return string HTML
*/
public function fetchLogInForm()
{
return $this->registry->output->template()->upgrade_login_200plus( 'username' );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.4.6
* Version Specific Upgrade Functions
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author Matt Mecham
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @link http://www.invisionpower.com
* @since 1st December 2008
* @version $Revision: 10721 $
*
*/
class upgradeLegacy
{
/**
* Member data
*
* @access private
* @var array
*/
private $_member;
/**
* Constructor
*
* @access public
* @return @e void
*/
public function __construct( ipsRegistry $registry )
{
/* Make object */
$this->registry = $registry;
$this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
//* Make sure tables exist that won't in pre 3.0 versions */
if ( is_file( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' ) )
{
/* Init vars */
$UPGRADE_HISTORY_TABLE = '';
$UPGRADE_TABLE_FIELD = '';
$UPGRADE_SESSION_TABLE = '';
$UPGRADE_CSS_PREVIOUS = '';
$UPGRADE_TEMPLATE_PREVIOUS = '';
require( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' );/*noLibHook*/
$prefix = $this->registry->dbFunctions()->getPrefix();
if ( ! $this->DB->checkForTable( 'upgrade_history' ) )
{
if ( $UPGRADE_HISTORY_TABLE )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_HISTORY_TABLE, $prefix ) );
}
}
if ( ! $this->DB->checkForField( 'upgrade_app', 'upgrade_history' ) )
{
if ( $UPGRADE_TABLE_FIELD )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TABLE_FIELD, $prefix ) );
}
}
if ( ! $this->DB->checkForTable( 'upgrade_sessions' ) )
{
if ( $UPGRADE_SESSION_TABLE )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_SESSION_TABLE, $prefix ) );
}
}
if ( ! $this->DB->checkForTable( 'skin_css_previous' ) )
{
if ( $UPGRADE_CSS_PREVIOUS )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_CSS_PREVIOUS, $prefix ) );
}
}
if ( ! $this->DB->checkForTable( 'skin_templates_previous' ) )
{
if ( $UPGRADE_TEMPLATE_PREVIOUS )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TEMPLATE_PREVIOUS, $prefix ) );
}
}
}
}
/**
* Fetch auth key
*
* @access public
* @return string
*/
public function fetchAuthKey()
{
if ( ! $this->_member['id'] AND ! $this->_member['member_id'] )
{
throw new Exception( "MEMBER NOT SET" );
}
else
{
return ( $this->_member['password'] ) ? md5( $this->_member['password'] ) : md5( $this->_member['legacy_password'] );
}
}
/**
* Fetch member data
*
* @access public
* @return array
*/
public function fetchMemberData()
{
return ( is_array( $this->_member ) ) ? $this->_member : array();
}
/**
* Load and return member data
*
* @access public
* @param int Member ID to load
* @return array
*/
public function loadMemberData( $memberId )
{
/* Attempt to load member */
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'members' => 'm' ),
'where' => 'm.id=' . intval( $memberId ),
'add_join' => array( array( 'select' => 'g.*',
'from' => array( 'groups' => 'g' ),
'where' => 'g.g_id=m.mgroup' ) ) ) );
$this->DB->execute();
$this->_member = $this->DB->fetch();
/* Fix up pre-3 stuffs */
$this->_member['member_id'] = $this->_member['id'];
$this->_member['member_group_id'] = $this->_member['mgroup'];
/* Occasionally 1.x installs do not have an email address. Most likey an InvisionFree issue */
if ( ! $this->_member['email'] )
{
$this->DB->update( 'members', array( 'email' => 'email_' . $this->_member['id'] . '_@changeMe.com' ), 'id=' . $memberId );
}
return $this->fetchMemberData();
}
/**
* Authenticate log in
*
* @access public
* @param string Username (from $this->request)
* @param string Password (from $this->request)
* @return mixed TRUE if successful, string (message) if not
*/
public function authenticateLogIn( $username, $password )
{
/* Attempt to load member */
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'members' => 'm' ),
'where' => $this->DB->buildLower('m.name') . "='" . strtolower( $username ) . "'",
'add_join' => array( array( 'select' => 'g.*',
'from' => array( 'groups' => 'g' ),
'where' => 'g.g_id=m.mgroup' ) ) ) );
$this->DB->execute();
$mem = $this->DB->fetch();
$pass = md5( $password );
/* Check it out */
if ( ! $mem['id'] )
{
return 'No user found by that username';
}
if ( $pass != $mem['password'] AND $pass != $mem['legacy_password'] )
{
return 'Password incorrect';
}
if ( $mem['g_access_cp'] != 1 )
{
return 'You do not have access to the upgrade system';
}
/* Set up _member */
$this->loadMemberData( $mem['id'] );
/* Still here? */
return TRUE;
}
/**
* Return log in form HTML
*
* @access public
* @return string HTML
*/
public function fetchLogInForm()
{
return $this->registry->output->template()->upgrade_login_200plus( 'username' );
}
}
+264 -264
View File
@@ -1,265 +1,265 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.4.5
* Version Specific Upgrade Functions
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author Matt Mecham
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @link http://www.invisionpower.com
* @since 1st December 2008
* @version $Revision: 10721 $
*
*/
class upgradeLegacy
{
/**
* Member data
*
* @access private
* @var array
*/
private $_member;
/**
* Constructor
*
* @access public
* @return @e void
*/
public function __construct( ipsRegistry $registry )
{
/* Make object */
$this->registry = $registry;
$this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
/* Make sure tables exist that won't in pre 3.0 versions */
if ( is_file( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' ) )
{
/* Init vars */
$UPGRADE_TABLE_FIELD = '';
$UPGRADE_SESSION_TABLE = '';
$UPGRADE_CSS_PREVIOUS = '';
$UPGRADE_TEMPLATE_PREVIOUS = '';
require( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' );/*noLibHook*/
$prefix = $this->registry->dbFunctions()->getPrefix();
if ( ! $this->DB->checkForField( 'upgrade_app', 'upgrade_history' ) )
{
if ( $UPGRADE_TABLE_FIELD )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TABLE_FIELD, $prefix ) );
}
}
if ( ! $this->DB->checkForTable( 'upgrade_sessions' ) )
{
if ( $UPGRADE_SESSION_TABLE )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_SESSION_TABLE, $prefix ) );
}
}
if ( ! $this->DB->checkForTable( 'skin_css_previous' ) )
{
if ( $UPGRADE_CSS_PREVIOUS )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_CSS_PREVIOUS, $prefix ) );
}
}
if ( ! $this->DB->checkForTable( 'skin_templates_previous' ) )
{
if ( $UPGRADE_TEMPLATE_PREVIOUS )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TEMPLATE_PREVIOUS, $prefix ) );
}
}
}
}
/**
* Fetch auth key
*
* @access public
* @return string
*/
public function fetchAuthKey()
{
if ( ! $this->_member['id'] AND ! $this->_member['member_id'] )
{
throw new Exception( "MEMBER NOT SET" );
}
else
{
return $this->_member['member_login_key'];
}
}
/**
* Fetch member data
*
* @access public
* @return array
*/
public function fetchMemberData()
{
return ( is_array( $this->_member ) ) ? $this->_member : array();
}
/**
* Load and return member data
*
* @access public
* @param int Member ID to load
* @return array
*/
public function loadMemberData( $memberId )
{
/* At this point, we could be either using 2.3 or 3.0 */
if ( $this->DB->checkForField( 'member_id', 'members' ) )
{
/* Attempt to load member */
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=' . intval( $memberId ),
'add_join' => array( array( 'select' => 'g.*',
'from' => array( 'groups' => 'g' ),
'where' => 'g.g_id=m.member_group_id' ) ) ) );
$this->DB->execute();
$this->_member = $this->DB->fetch();
}
else
{
/* Attempt to load member */
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'members' => 'm' ),
'where' => 'm.id=' . intval( $memberId ),
'add_join' => array( array( 'select' => 'g.*',
'from' => array( 'groups' => 'g' ),
'where' => 'g.g_id=m.mgroup' ) ) ) );
$this->DB->execute();
$this->_member = $this->DB->fetch();
/* Fix up pre-3 stuffs */
$this->_member['member_id'] = $this->_member['id'];
$this->_member['member_group_id'] = $this->_member['mgroup'];
}
/* Set up seconday groups */
$this->_member = ips_MemberRegistry::setUpSecondaryGroups( $this->_member );
return $this->fetchMemberData();
}
/**
* Authenticate log in
*
* @access public
* @param string Username (from $this->request)
* @param string Password (from $this->request)
* @return mixed TRUE if successful, string (message) if not
*/
public function authenticateLogIn( $username, $password )
{
/* Log in type */
$loginType = $this->_fetchLogInType();
$where = ( $loginType == 'username' ) ? $this->DB->buildLower('m.name'). "='" . mb_strtolower( $username ) . "'" : "m.email='" . mb_strtolower( $username ) . "'";
/* Attempt to load member */
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'members' => 'm' ),
'where' => $where,
'add_join' => array( array( 'select' => 'g.*',
'from' => array( 'groups' => 'g' ),
'where' => 'g.g_id=m.mgroup' ),
array( 'select' => 'c.*',
'from' => array( 'members_converge' => 'c' ),
'where' => 'c.converge_email=m.email' ) ) ) );
$this->DB->execute();
$mem = $this->DB->fetch();
/* Check it out */
if ( ! $mem['id'] OR ! $mem['converge_pass_hash'] )
{
return 'Пользователь не найден';
}
if ( $mem['converge_pass_hash'] != md5( md5( $mem['converge_pass_salt'] ) . md5( $password ) ) )
{
return 'Неверный пароль';
}
/* Test seconday groups */
$mem = ipsRegistry::member()->setUpSecondaryGroups( $mem );
if ( $mem['g_access_cp'] != 1 )
{
return 'У вас нет доступа к системе обновления';
}
/* Set up _member */
$this->loadMemberData( $mem['id'] );
/* Still here? */
return TRUE;
}
/**
* Return log in form HTML
*
* @access public
* @return string HTML
*/
public function fetchLogInForm()
{
$loginType = $this->_fetchLogInType();
return $this->registry->output->template()->upgrade_login_200plus( $loginType );
}
/**
* Fetch the log in type
*
* @access private
* @return string
*/
public function _fetchLoginType()
{
$loginType = 'username';
$this->DB->build( array( 'select' => '*', 'from' => 'conf_settings', 'where' => "conf_key IN('ipbli_usertype','converge_login_method')", 'order' => 'conf_key ASC' ) );
$this->DB->execute();
while( $r = $this->DB->fetch() )
{
$r['conf_value'] = $r['conf_value'] ? $r['conf_value'] : $r['conf_default'];
if ( $r['conf_value'] )
{
$loginType = $r['conf_value'];
}
}
return $loginType;
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.4.6
* Version Specific Upgrade Functions
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author Matt Mecham
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @link http://www.invisionpower.com
* @since 1st December 2008
* @version $Revision: 10721 $
*
*/
class upgradeLegacy
{
/**
* Member data
*
* @access private
* @var array
*/
private $_member;
/**
* Constructor
*
* @access public
* @return @e void
*/
public function __construct( ipsRegistry $registry )
{
/* Make object */
$this->registry = $registry;
$this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
/* Make sure tables exist that won't in pre 3.0 versions */
if ( is_file( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' ) )
{
/* Init vars */
$UPGRADE_TABLE_FIELD = '';
$UPGRADE_SESSION_TABLE = '';
$UPGRADE_CSS_PREVIOUS = '';
$UPGRADE_TEMPLATE_PREVIOUS = '';
require( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' );/*noLibHook*/
$prefix = $this->registry->dbFunctions()->getPrefix();
if ( ! $this->DB->checkForField( 'upgrade_app', 'upgrade_history' ) )
{
if ( $UPGRADE_TABLE_FIELD )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TABLE_FIELD, $prefix ) );
}
}
if ( ! $this->DB->checkForTable( 'upgrade_sessions' ) )
{
if ( $UPGRADE_SESSION_TABLE )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_SESSION_TABLE, $prefix ) );
}
}
if ( ! $this->DB->checkForTable( 'skin_css_previous' ) )
{
if ( $UPGRADE_CSS_PREVIOUS )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_CSS_PREVIOUS, $prefix ) );
}
}
if ( ! $this->DB->checkForTable( 'skin_templates_previous' ) )
{
if ( $UPGRADE_TEMPLATE_PREVIOUS )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TEMPLATE_PREVIOUS, $prefix ) );
}
}
}
}
/**
* Fetch auth key
*
* @access public
* @return string
*/
public function fetchAuthKey()
{
if ( ! $this->_member['id'] AND ! $this->_member['member_id'] )
{
throw new Exception( "MEMBER NOT SET" );
}
else
{
return $this->_member['member_login_key'];
}
}
/**
* Fetch member data
*
* @access public
* @return array
*/
public function fetchMemberData()
{
return ( is_array( $this->_member ) ) ? $this->_member : array();
}
/**
* Load and return member data
*
* @access public
* @param int Member ID to load
* @return array
*/
public function loadMemberData( $memberId )
{
/* At this point, we could be either using 2.3 or 3.0 */
if ( $this->DB->checkForField( 'member_id', 'members' ) )
{
/* Attempt to load member */
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=' . intval( $memberId ),
'add_join' => array( array( 'select' => 'g.*',
'from' => array( 'groups' => 'g' ),
'where' => 'g.g_id=m.member_group_id' ) ) ) );
$this->DB->execute();
$this->_member = $this->DB->fetch();
}
else
{
/* Attempt to load member */
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'members' => 'm' ),
'where' => 'm.id=' . intval( $memberId ),
'add_join' => array( array( 'select' => 'g.*',
'from' => array( 'groups' => 'g' ),
'where' => 'g.g_id=m.mgroup' ) ) ) );
$this->DB->execute();
$this->_member = $this->DB->fetch();
/* Fix up pre-3 stuffs */
$this->_member['member_id'] = $this->_member['id'];
$this->_member['member_group_id'] = $this->_member['mgroup'];
}
/* Set up seconday groups */
$this->_member = ips_MemberRegistry::setUpSecondaryGroups( $this->_member );
return $this->fetchMemberData();
}
/**
* Authenticate log in
*
* @access public
* @param string Username (from $this->request)
* @param string Password (from $this->request)
* @return mixed TRUE if successful, string (message) if not
*/
public function authenticateLogIn( $username, $password )
{
/* Log in type */
$loginType = $this->_fetchLogInType();
$where = ( $loginType == 'username' ) ? $this->DB->buildLower('m.name') . "='" . strtolower( $username ) . "'" : "m.email='" . strtolower( $username ) . "'";
/* Attempt to load member */
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'members' => 'm' ),
'where' => $where,
'add_join' => array( array( 'select' => 'g.*',
'from' => array( 'groups' => 'g' ),
'where' => 'g.g_id=m.mgroup' ),
array( 'select' => 'c.*',
'from' => array( 'members_converge' => 'c' ),
'where' => 'c.converge_email=m.email' ) ) ) );
$this->DB->execute();
$mem = $this->DB->fetch();
/* Check it out */
if ( ! $mem['id'] OR ! $mem['converge_pass_hash'] )
{
return 'No user found by that username';
}
if ( $mem['converge_pass_hash'] != md5( md5( $mem['converge_pass_salt'] ) . md5( $password ) ) )
{
return 'Password incorrect';
}
/* Test seconday groups */
$mem = ipsRegistry::member()->setUpSecondaryGroups( $mem );
if ( $mem['g_access_cp'] != 1 )
{
return 'You do not have access to the upgrade system';
}
/* Set up _member */
$this->loadMemberData( $mem['id'] );
/* Still here? */
return TRUE;
}
/**
* Return log in form HTML
*
* @access public
* @return string HTML
*/
public function fetchLogInForm()
{
$loginType = $this->_fetchLogInType();
return $this->registry->output->template()->upgrade_login_200plus( $loginType );
}
/**
* Fetch the log in type
*
* @access private
* @return string
*/
public function _fetchLoginType()
{
$loginType = 'username';
$this->DB->build( array( 'select' => '*', 'from' => 'conf_settings', 'where' => "conf_key IN('ipbli_usertype','converge_login_method')", 'order' => 'conf_key ASC' ) );
$this->DB->execute();
while( $r = $this->DB->fetch() )
{
$r['conf_value'] = $r['conf_value'] ? $r['conf_value'] : $r['conf_default'];
if ( $r['conf_value'] )
{
$loginType = $r['conf_value'];
}
}
return $loginType;
}
}
+255 -255
View File
@@ -1,256 +1,256 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.4.5
* Version Specific Upgrade Functions
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author Matt Mecham
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @link http://www.invisionpower.com
* @since 1st December 2008
* @version $Revision: 10721 $
*
*/
class upgradeLegacy
{
/**
* Member data
*
* @access private
* @var array
*/
private $_member;
/**
* Constructor
*
* @access public
* @return @e void
*/
public function __construct( ipsRegistry $registry )
{
/* Make object */
$this->registry = $registry;
$this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
/* Make sure tables exist that won't in pre 3.0 versions */
if ( is_file( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' ) )
{
/* Init vars */
$UPGRADE_TABLE_FIELD = '';
$UPGRADE_SESSION_TABLE = '';
$UPGRADE_CSS_PREVIOUS = '';
$UPGRADE_TEMPLATE_PREVIOUS = '';
require( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' );/*noLibHook*/
$prefix = $this->registry->dbFunctions()->getPrefix();
if ( ! $this->DB->checkForField( 'upgrade_app', 'upgrade_history' ) )
{
if ( $UPGRADE_TABLE_FIELD )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TABLE_FIELD, $prefix ) );
}
}
if ( ! $this->DB->checkForTable( 'upgrade_sessions' ) )
{
if ( $UPGRADE_SESSION_TABLE )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_SESSION_TABLE, $prefix ) );
}
}
if ( ! $this->DB->checkForTable( 'skin_css_previous' ) )
{
if ( $UPGRADE_CSS_PREVIOUS )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_CSS_PREVIOUS, $prefix ) );
}
}
if ( ! $this->DB->checkForTable( 'skin_templates_previous' ) )
{
if ( $UPGRADE_TEMPLATE_PREVIOUS )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TEMPLATE_PREVIOUS, $prefix ) );
}
}
}
}
/**
* Fetch auth key
*
* @access public
* @return string
*/
public function fetchAuthKey()
{
if ( ! $this->_member['member_id'] )
{
throw new Exception( "MEMBER NOT SET" );
}
else
{
return $this->_member['member_login_key'];
}
}
/**
* Fetch member data
*
* @access public
* @return array
*/
public function fetchMemberData()
{
return ( is_array( $this->_member ) ) ? $this->_member : array();
}
/**
* Load and return member data
*
* @access public
* @param int Member ID to load
* @return array
*/
public function loadMemberData( $memberId )
{
/* Attempt to load member */
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=' . intval( $memberId ),
'add_join' => array( array( 'select' => 'g.*',
'from' => array( 'groups' => 'g' ),
'where' => 'g.g_id=m.member_group_id' ) ) ) );
$this->DB->execute();
/* Set up seconday groups */
$this->_member = ips_MemberRegistry::setUpSecondaryGroups( $this->DB->fetch() );
return $this->fetchMemberData();
}
/**
* Authenticate log in
*
* @access public
* @param string Username (from $this->request)
* @param string Password (from $this->request)
* @return mixed TRUE if successful, string (message) if not
*/
public function authenticateLogIn( $username, $password )
{
require_once( IPS_ROOT_PATH . 'sources/handlers/han_login.php' );/*noLibHook*/
$han_login = new han_login( $this->registry );
$han_login->is_admin_auth = 1;
$han_login->init();
$email = '';
/* Is this a username or email address? */
if ( IPSText::checkEmailAddress( $username ) )
{
$email = $username;
$username = '';
}
$han_login->loginAuthenticate( $username, $email, $password );
$mem = $han_login->member_data;
if ( ( ! $mem['member_id'] ) or ( $han_login->return_code == 'NO_USER' ) )
{
return 'Пользователь не найден';
}
if ( $han_login->return_code == 'NO_ACCESS' )
{
return 'У вас нет доступа к системе обновления';
}
else if ( $han_login->return_code != 'SUCCESS' )
{
return 'Имя пользователя или пароль неверны';
}
/* Test seconday groups */
$mem = ipsRegistry::member()->setUpSecondaryGroups( $mem );
if ( $mem['g_access_cp'] != 1 )
{
return 'У вас нет доступа к системе обновления';
}
/* Set up _member */
$this->loadMemberData( $mem['member_id'] );
/* Still here? */
return TRUE;
}
/**
* Return log in form HTML
*
* @access public
* @return string HTML
*/
public function fetchLogInForm()
{
require_once( IPS_ROOT_PATH . 'sources/handlers/han_login.php' );/*noLibHook*/
$han_login = new han_login( $this->registry );
$han_login->is_admin_auth = 1;
$han_login->init();
$additional_data = ''; //$han_login->additionalFormHTML();
$replace = false;
$data = array();
if( !is_null($additional_data) AND is_array($additional_data) AND count($additional_data) )
{
$replace = $additional_data[0];
$data = $additional_data[1];
}
/* Check login type */
$uses_name = false;
$uses_email = false;
$loginType = 'username';
foreach( $this->cache->getCache('login_methods') as $method )
{
if ( $method['login_user_id'] == 'username' or $method['login_user_id'] == 'either' )
{
$uses_name = true;
}
if ( $method['login_user_id'] == 'email' or $method['login_user_id'] == 'either' )
{
$uses_email = true;
}
}
if ( $uses_name AND $uses_email )
{
$loginType = 'either';
}
elseif ( $uses_email )
{
$loginType = 'email';
}
return $this->registry->output->template()->upgrade_login_300plus( $data, ( $replace == 'replace' ? true : false ), $loginType );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.4.6
* Version Specific Upgrade Functions
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author Matt Mecham
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @link http://www.invisionpower.com
* @since 1st December 2008
* @version $Revision: 10721 $
*
*/
class upgradeLegacy
{
/**
* Member data
*
* @access private
* @var array
*/
private $_member;
/**
* Constructor
*
* @access public
* @return @e void
*/
public function __construct( ipsRegistry $registry )
{
/* Make object */
$this->registry = $registry;
$this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
/* Make sure tables exist that won't in pre 3.0 versions */
if ( is_file( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' ) )
{
/* Init vars */
$UPGRADE_TABLE_FIELD = '';
$UPGRADE_SESSION_TABLE = '';
$UPGRADE_CSS_PREVIOUS = '';
$UPGRADE_TEMPLATE_PREVIOUS = '';
require( IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '.php' );/*noLibHook*/
$prefix = $this->registry->dbFunctions()->getPrefix();
if ( ! $this->DB->checkForField( 'upgrade_app', 'upgrade_history' ) )
{
if ( $UPGRADE_TABLE_FIELD )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TABLE_FIELD, $prefix ) );
}
}
if ( ! $this->DB->checkForTable( 'upgrade_sessions' ) )
{
if ( $UPGRADE_SESSION_TABLE )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_SESSION_TABLE, $prefix ) );
}
}
if ( ! $this->DB->checkForTable( 'skin_css_previous' ) )
{
if ( $UPGRADE_CSS_PREVIOUS )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_CSS_PREVIOUS, $prefix ) );
}
}
if ( ! $this->DB->checkForTable( 'skin_templates_previous' ) )
{
if ( $UPGRADE_TEMPLATE_PREVIOUS )
{
$this->DB->query( IPSSetUp::addPrefixToQuery( $UPGRADE_TEMPLATE_PREVIOUS, $prefix ) );
}
}
}
}
/**
* Fetch auth key
*
* @access public
* @return string
*/
public function fetchAuthKey()
{
if ( ! $this->_member['member_id'] )
{
throw new Exception( "MEMBER NOT SET" );
}
else
{
return $this->_member['member_login_key'];
}
}
/**
* Fetch member data
*
* @access public
* @return array
*/
public function fetchMemberData()
{
return ( is_array( $this->_member ) ) ? $this->_member : array();
}
/**
* Load and return member data
*
* @access public
* @param int Member ID to load
* @return array
*/
public function loadMemberData( $memberId )
{
/* Attempt to load member */
$this->DB->build( array( 'select' => 'm.*',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=' . intval( $memberId ),
'add_join' => array( array( 'select' => 'g.*',
'from' => array( 'groups' => 'g' ),
'where' => 'g.g_id=m.member_group_id' ) ) ) );
$this->DB->execute();
/* Set up seconday groups */
$this->_member = ips_MemberRegistry::setUpSecondaryGroups( $this->DB->fetch() );
return $this->fetchMemberData();
}
/**
* Authenticate log in
*
* @access public
* @param string Username (from $this->request)
* @param string Password (from $this->request)
* @return mixed TRUE if successful, string (message) if not
*/
public function authenticateLogIn( $username, $password )
{
require_once( IPS_ROOT_PATH . 'sources/handlers/han_login.php' );/*noLibHook*/
$han_login = new han_login( $this->registry );
$han_login->is_admin_auth = 1;
$han_login->init();
$email = '';
/* Is this a username or email address? */
if ( IPSText::checkEmailAddress( $username ) )
{
$email = $username;
$username = '';
}
$han_login->loginAuthenticate( $username, $email, $password );
$mem = $han_login->member_data;
if ( ( ! $mem['member_id'] ) or ( $han_login->return_code == 'NO_USER' ) )
{
return 'No user found by that username';
}
if ( $han_login->return_code == 'NO_ACCESS' )
{
return 'You do not have access to the upgrade system';
}
else if ( $han_login->return_code != 'SUCCESS' )
{
return 'Password or username incorrect';
}
/* Test seconday groups */
$mem = ipsRegistry::member()->setUpSecondaryGroups( $mem );
if ( $mem['g_access_cp'] != 1 )
{
return 'You do not have access to the upgrade system';
}
/* Set up _member */
$this->loadMemberData( $mem['member_id'] );
/* Still here? */
return TRUE;
}
/**
* Return log in form HTML
*
* @access public
* @return string HTML
*/
public function fetchLogInForm()
{
require_once( IPS_ROOT_PATH . 'sources/handlers/han_login.php' );/*noLibHook*/
$han_login = new han_login( $this->registry );
$han_login->is_admin_auth = 1;
$han_login->init();
$additional_data = ''; //$han_login->additionalFormHTML();
$replace = false;
$data = array();
if( !is_null($additional_data) AND is_array($additional_data) AND count($additional_data) )
{
$replace = $additional_data[0];
$data = $additional_data[1];
}
/* Check login type */
$uses_name = false;
$uses_email = false;
$loginType = 'username';
foreach( $this->cache->getCache('login_methods') as $method )
{
if ( $method['login_user_id'] == 'username' or $method['login_user_id'] == 'either' )
{
$uses_name = true;
}
if ( $method['login_user_id'] == 'email' or $method['login_user_id'] == 'either' )
{
$uses_email = true;
}
}
if ( $uses_name AND $uses_email )
{
$loginType = 'either';
}
elseif ( $uses_email )
{
$loginType = 'email';
}
return $this->registry->output->template()->upgrade_login_300plus( $data, ( $replace == 'replace' ? true : false ), $loginType );
}
}
+1 -1
View File
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
IP.Board
</body>
</html>