Version 2.2.0 RC-1

This commit is contained in:
Neo committed 2025-12-19 00:22:37 -08:00
1 parent f73f8bff6d
commit 22f1b963ee
1034 files changed
+178610 -70897

No files matched your search

+178 -82
View File
@@ -2,27 +2,17 @@
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| Invision Power Board
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| (c) 2001 - 2006 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Tuesday 18th of July 2006 05:56:00 PM
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2006-01-31 22:47:20 +0000 (Tue, 31 Jan 2006) $
| > $Revision: 131 $
| > $Date: 2006-10-12 17:58:40 +0100 (Thu, 12 Oct 2006) $
| > $Revision: 633 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
@@ -38,7 +28,7 @@
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
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();
}
@@ -123,7 +113,7 @@ class login
//-----------------------------------------
$this->ipsclass->print->add_output("$this->output");
$this->ipsclass->print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) );
$this->ipsclass->print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, 'NAV' => $this->nav ) );
}
/*-------------------------------------------------------------------------*/
@@ -206,11 +196,11 @@ class login
{
if ($method == 'show')
{
$this->ipsclass->print->redirect_screen( $false_words, 'act=Login&CODE=00' );
$this->ipsclass->print->redirect_screen( $false_words, 'act=login&amp;CODE=00' );
}
else
{
$this->ipsclass->boink_it($this->ipsclass->base_url.'&act=Login&CODE=00');
$this->ipsclass->boink_it($this->ipsclass->base_url.'&act=login&CODE=00');
}
}
}
@@ -225,7 +215,7 @@ class login
{
foreach( $_COOKIE as $cookie => $value)
{
if (preg_match( "/^(".$this->ipsclass->vars['cookie_id']."ibforum.*$)/i", $cookie, $match))
if (preg_match( "/^(".$this->ipsclass->vars['cookie_id']."ipbforum.*$)/i", $cookie, $match))
{
$this->ipsclass->my_setcookie( str_replace( $this->ipsclass->vars['cookie_id'], "", $match[0] ) , '-', -1 );
}
@@ -351,7 +341,7 @@ class login
$this->ipsclass->DB->build_and_exec_query( array( 'delete' => 'topic_markers',
'where' => 'marker_member_id='.$this->ipsclass->member['id'].' AND marker_forum_id IN ('.implode(',',$delete ).')' ) );
foreach( $save as $id => $data )
foreach( $save as $data )
{
$this->ipsclass->DB->do_insert( 'topic_markers', $data );
}
@@ -424,11 +414,25 @@ class login
if ( $message != "" )
{
$message = $this->ipsclass->lang[ $message ];
$message = preg_replace( "/<#NAME#>/", "<b>{$this->ipsclass->input[UserName]}</b>", $message );
$message = str_replace( "<#NAME#>", "<b>{$this->ipsclass->input['UserName']}</b>", $message );
$this->output .= $this->ipsclass->compiled_templates['skin_login']->errors($message);
}
//-----------------------------------------
// Using an alternate log in form?
//-----------------------------------------
if ( $this->han_login->login_method['login_login_url'] )
{
//-----------------------------------------
// Simply redirect to the form now
//-----------------------------------------
$this->ipsclass->boink_it( $this->han_login->login_method['login_login_url'] );
exit();
}
//-----------------------------------------
// Extra HTML?
//-----------------------------------------
@@ -453,24 +457,30 @@ class login
if ( $show_form )
{
if( !isset($_SERVER['HTTP_REFERER']) )
if ( $this->ipsclass->my_getenv('HTTP_REFERER') )
{
// HTTP_REFERER isn't set when force_login is enabled
// This method will piece together the base url, and the querystring arguments
// This is not anymore secure/insecure than IPB, as IPB will have to process
// those arguments whether force_login is enabled or not.
$_SERVER['HTTP_REFERER'] = $this->ipsclass->base_url.implode( "&amp;", $_SERVER['argv'] );
$argv = (is_array($this->ipsclass->my_getenv('argv')) && count($this->ipsclass->my_getenv('argv')) > 0) ? $this->ipsclass->my_getenv('argv') : array();
$http_referrer = $this->ipsclass->base_url.@implode( "&amp;", $argv );
}
else
{
$http_referrer = $this->ipsclass->my_getenv('HTTP_REFERER');
}
$this->output .= $this->ipsclass->compiled_templates['skin_login']->ShowForm( $this->ipsclass->lang['please_log_in'], htmlentities(urldecode($_SERVER['HTTP_REFERER'])), $extra_form );
$this->output .= $this->ipsclass->compiled_templates['skin_login']->ShowForm( $this->ipsclass->lang['please_log_in'], htmlentities(urldecode($http_referrer)), $extra_form );
}
$this->nav = array( $this->ipsclass->lang['log_in'] );
$this->page_title = $this->ipsclass->lang['log_in'];
$this->ipsclass->print->add_output("$this->output");
$this->ipsclass->print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) );
$this->ipsclass->print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, 'NAV' => $this->nav, 'OVERRIDE' => $this->ipsclass->vars['board_offline'] ) );
exit();
}
@@ -503,7 +513,14 @@ class login
if ( $_POST['UserName'] == "" )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_username' ) );
if( $this->ipsclass->vars['ipbli_usertype'] == 'username' )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_username' ) );
}
else
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_email_login' ) );
}
}
if ( $_POST['PassWord'] == "" )
@@ -515,7 +532,7 @@ class login
// Check for input length
//-----------------------------------------
if ( $this->ipsclass->vars['converge_login_method'] == 'username' )
if ( $this->ipsclass->vars['ipbli_usertype'] == 'username' )
{
if ( $this->ipsclass->txt_mb_strlen( $_POST['UserName'] ) > 32 )
{
@@ -555,7 +572,28 @@ class login
if ( $this->han_login->return_code != 'SUCCESS' )
{
$this->log_in_form( 'wrong_auth' );
if ( $this->han_login->return_code == 'ACCOUNT_LOCKED' )
{
$extra = "<!-- -->";
if( $this->ipsclass->vars['ipb_bruteforce_unlock'] )
{
if( $this->han_login->account_unlock )
{
$time = time() - $this->han_login->account_unlock;
$time = $this->ipsclass->vars['ipb_bruteforce_period'] - ceil( $time / 60 );
$extra = sprintf( $this->ipsclass->lang['bruteforce_account_unlock'], $time );
}
}
$this->ipsclass->Error( array( 'LEVEL' => 5, 'MSG' => 'bruteforce_account_lock', 'EXTRA' => $extra ) );
}
else
{
$this->log_in_form( 'wrong_auth' );
}
}
//-----------------------------------------
@@ -569,7 +607,7 @@ class login
if ( $pmember['partial_member_id'] )
{
$this->ipsclass->print->redirect_screen( $this->ipsclass->lang['partial_login'], 'act=reg&CODE=complete_login&mid='.$member['id'].'&key='.$pmember['partial_date'] );
$this->ipsclass->print->redirect_screen( $this->ipsclass->lang['partial_login'], 'act=reg&amp;CODE=complete_login&amp;mid='.$member['id'].'&amp;key='.$pmember['partial_date'] );
exit();
}
}
@@ -579,7 +617,7 @@ class login
// still need this?
//-----------------------------------------
if ($member['mgroup'] == $this->ipsclass->vars['auth_group'])
if ( $member['mgroup'] == $this->ipsclass->vars['auth_group'] )
{
//$this->log_in_form( 'need_validation' );
}
@@ -588,21 +626,33 @@ class login
// Generate a new log in key
//-----------------------------------------
if ( $this->ipsclass->vars['login_change_key'] OR ! $member['member_login_key'] )
$_ok = 1;
$_time = ( $this->ipsclass->vars['login_key_expire'] ) ? ( time() + ( intval($this->ipsclass->vars['login_key_expire']) * 86400 ) ) : 0;
$_sticky = $_time ? 0 : 1;
$_days = $_time ? $this->ipsclass->vars['login_key_expire'] : 365;
if ( $this->ipsclass->vars['login_change_key'] OR ! $member['member_login_key'] OR ( $this->ipsclass->vars['login_key_expire'] AND ( time() > $member['member_login_key_expire'] ) ) )
{
$member['member_login_key'] = $this->ipsclass->converge->generate_auto_log_in_key();
$this->ipsclass->DB->do_update( 'members', array( 'member_login_key' => $member['member_login_key'] ), 'id='.$member['id'] );
$this->ipsclass->DB->do_update( 'members', array( 'member_login_key' => $member['member_login_key'],
'member_login_key_expire' => $_time ), 'id='.$member['id'] );
}
//-----------------------------------------
// Strong hold cookie?
//-----------------------------------------
$this->ipsclass->stronghold_set_cookie( $member['id'], $member['member_login_key'], 1 );
//-----------------------------------------
// Cookie me softly?
//-----------------------------------------
if ($this->ipsclass->input['CookieDate'])
if ( $this->ipsclass->input['CookieDate'] )
{
$this->ipsclass->my_setcookie("member_id" , $member['id'] , 1);
$this->ipsclass->my_setcookie("pass_hash" , $member['member_login_key'], 1);
$this->ipsclass->my_setcookie("pass_hash" , $member['member_login_key'], $_sticky, $_days );
}
//-----------------------------------------
@@ -646,21 +696,32 @@ class login
$poss_session_id = preg_replace("/([^a-zA-Z0-9])/", "", $poss_session_id);
if ($poss_session_id)
if ( $poss_session_id )
{
$session_id = $poss_session_id;
//-----------------------------------------
// Delete any old sessions with this users IP
// addy that doesn't match our session ID.
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'delete' => 'sessions',
'where' => "ip_address='".$this->ipsclass->ip_address."' AND id <> '$session_id'"
) );
$this->ipsclass->DB->simple_shutdown_exec();
if( $this->ipsclass->vars['match_ipaddress'] )
{
//-----------------------------------------
// Delete any old sessions with this users IP
// addy that doesn't match our session ID.
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'delete' => 'sessions',
'where' => "ip_address='".$this->ipsclass->ip_address."' AND id <> '$session_id'"
) );
$this->ipsclass->DB->simple_shutdown_exec();
}
if( $this->ipsclass->vars['disable_anonymous'] )
{
$privacy = 0;
}
else
{
$privacy = ( isset($this->ipsclass->input['Privacy']) AND $this->ipsclass->input['Privacy']) ? 1 : 0;
}
$this->ipsclass->DB->do_shutdown_update( 'sessions',
array (
@@ -668,7 +729,7 @@ class login
'member_id' => $member['id'],
'running_time' => time(),
'member_group' => $member['mgroup'],
'login_type' => $this->ipsclass->input['Privacy'] ? 1 : 0
'login_type' => $privacy
),
"id='".$session_id."'"
);
@@ -677,15 +738,27 @@ class login
{
$session_id = md5( uniqid(microtime()) );
//-----------------------------------------
// Delete any old sessions with this users IP addy.
//-----------------------------------------
if( $this->ipsclass->vars['disable_anonymous'] )
{
$privacy = 0;
}
else
{
$privacy = $this->ipsclass->input['Privacy'] ? 1 : 0;
}
$this->ipsclass->DB->simple_construct( array( 'delete' => 'sessions',
'where' => "ip_address='".$this->ipsclass->ip_address."'"
) );
$this->ipsclass->DB->simple_shutdown_exec();
if( $this->ipsclass->vars['match_ipaddress'] )
{
//-----------------------------------------
// Delete any old sessions with this users IP addy.
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'delete' => 'sessions',
'where' => "ip_address='".$this->ipsclass->ip_address."'"
) );
$this->ipsclass->DB->simple_shutdown_exec();
}
$this->ipsclass->DB->do_shutdown_insert( 'sessions',
array (
@@ -695,15 +768,15 @@ class login
'running_time' => time(),
'member_group' => $member['mgroup'],
'ip_address' => $this->ipsclass->ip_address,
'browser' => substr($this->ipsclass->clean_value($_SERVER['HTTP_USER_AGENT']), 0, 50),
'login_type' => $this->ipsclass->input['Privacy'] ? 1 : 0
'browser' => substr($this->ipsclass->clean_value($this->ipsclass->my_getenv('HTTP_USER_AGENT')), 0, 50),
'login_type' => $privacy
) );
}
$this->ipsclass->member = $member;
$this->ipsclass->session_id = $session_id;
if ($this->ipsclass->input['referer'] && ($this->ipsclass->input['act'] != 'Reg'))
if (isset($this->ipsclass->input['referer']) AND $this->ipsclass->input['referer'] && ($this->ipsclass->input['act'] != 'Reg'))
{
$url = str_replace( '&amp;', '&', $this->ipsclass->input['referer'] );
$url = str_replace( "{$this->ipsclass->vars['board_url']}/index.{$this->ipsclass->vars['php_ext']}", "", $url );
@@ -717,7 +790,7 @@ class login
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'update' => 'members',
'set' => "login_anonymous='".intval($this->ipsclass->input['Privacy'])."&1'",
'set' => "login_anonymous='".intval($privacy)."&1', failed_logins='', failed_login_count=0",
'where' => "id={$member['id']}"
) );
@@ -748,7 +821,7 @@ class login
$this->modules->on_login($member);
}
if ( $this->ipsclass->input['return'] != "" )
if ( isset($this->ipsclass->input['return']) AND $this->ipsclass->input['return'] != "" )
{
$return = urldecode($this->ipsclass->input['return']);
@@ -766,11 +839,11 @@ class login
if ( $member_extra['bio'] == 'dupemail' )
{
$this->ipsclass->print->redirect_screen( "{$this->ipsclass->lang[thanks_for_login]} {$this->ipsclass->member['members_display_name']}", 'act=usercp' );
$this->ipsclass->print->redirect_screen( "{$this->ipsclass->lang['thanks_for_login']} {$this->ipsclass->member['members_display_name']}", 'act=usercp' );
}
else
{
$this->ipsclass->print->redirect_screen( "{$this->ipsclass->lang[thanks_for_login]} {$this->ipsclass->member['members_display_name']}", $url );
$this->ipsclass->print->redirect_screen( "{$this->ipsclass->lang['thanks_for_login']} {$this->ipsclass->member['members_display_name']}", $url );
}
}
@@ -795,6 +868,48 @@ class login
}
}
//-----------------------------------------
// Set some cookies
//-----------------------------------------
$this->ipsclass->my_setcookie( "member_id" , "0" );
$this->ipsclass->my_setcookie( "pass_hash" , "0" );
$this->ipsclass->my_setcookie( "anonlogin" , "-1" );
if ( is_array($_COOKIE) )
{
foreach( $_COOKIE as $cookie => $value )
{
if ( preg_match( "/^(".$this->ipsclass->vars['cookie_id']."ipbforumpass_.*$)/i", $cookie, $match) )
{
$this->ipsclass->my_setcookie( str_replace( $this->ipsclass->vars['cookie_id'], "", $match[0] ) , '-', -1 );
}
}
}
//-----------------------------------------
// Remote log out?
//-----------------------------------------
require_once( ROOT_PATH.'sources/handlers/han_login.php' );
$this->han_login = new han_login();
$this->han_login->ipsclass =& $this->ipsclass;
$this->han_login->init();
//-----------------------------------------
// Using an alternate log in form?
//-----------------------------------------
if ( $this->han_login->login_method['login_logout_url'] )
{
//-----------------------------------------
// Simply redirect to the form now
//-----------------------------------------
$this->ipsclass->boink_it( $this->han_login->login_method['login_logout_url'] );
exit();
}
//-----------------------------------------
// Do it..
//-----------------------------------------
@@ -816,25 +931,6 @@ class login
$this->ipsclass->DB->simple_shutdown_exec();
//-----------------------------------------
// Set some cookies
//-----------------------------------------
$this->ipsclass->my_setcookie( "member_id" , "0" );
$this->ipsclass->my_setcookie( "pass_hash" , "0" );
$this->ipsclass->my_setcookie( "anonlogin" , "-1" );
if ( is_array($_COOKIE) )
{
foreach( $_COOKIE as $cookie => $value )
{
if ( preg_match( "/^(".$this->ipsclass->vars['cookie_id']."ipbforumpass_.*$)/i", $cookie, $match) )
{
$this->ipsclass->my_setcookie( str_replace( $this->ipsclass->vars['cookie_id'], "", $match[0] ) , '-', -1 );
}
}
}
# Horrid hack: IPB 3.0: Separate out log out functions into class / function
if ( $return )
{
@@ -844,7 +940,7 @@ class login
$url = "";
if ( $this->ipsclass->input['return'] != "" )
if ( isset($this->ipsclass->input['return']) AND $this->ipsclass->input['return'] != "" )
{
$return = urldecode($this->ipsclass->input['return']);