Version 2.3.6

This commit is contained in:
Neo committed 2025-12-19 00:26:08 -08:00
1 parent a3bb603c96
commit 19b38c7c74
764 files changed
+143731 -118164

No files matched your search

+72 -62
View File
@@ -1,27 +1,17 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.2.2
| Invision Power Board
| =============================================
| by Matthew Mecham
| (c) 2001 - 2006 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Monday 05th of March 2007 10:10:54 PM
| Release: e3790216629e5a2aaf37070b32237f06
| 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-11-13 17:05:48 -0600 (Mon, 13 Nov 2006) $
| > $Revision: 728 $
| > $Date: 2008-04-21 17:32:17 -0400 (Mon, 21 Apr 2008) $
| > $Revision: 1249 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
@@ -36,7 +26,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();
}
@@ -131,7 +121,7 @@ class session
{
$ip = str_replace( '\*', '.*', preg_quote( trim($ip), "/") );
if ( preg_match( "/^$ip$/", $this->ipsclass->input['IP_ADDRESS'] ) )
if ( preg_match( "/^$ip$/", $this->ipsclass->ip_address ) )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'you_are_banned', 'INIT' => 1 ) );
}
@@ -209,16 +199,19 @@ class session
$this->member[ $k ] = $v;
}
$this->member['restrict_post'] = 1;
$this->member['g_use_search'] = 0;
$this->member['g_email_friend'] = 0;
$this->member['g_edit_profile'] = 0;
$this->member['g_use_pm'] = 0;
$this->member['g_is_supmod'] = 0;
$this->member['g_access_cp'] = 0;
$this->member['g_access_offline'] = 0;
$this->member['g_avoid_flood'] = 0;
$this->member['id'] = 0;
$this->member['mgroup'] = $this->member['g_id'];
$this->member['restrict_post'] = 1;
$this->member['g_use_search'] = 0;
$this->member['g_email_friend'] = 0;
$this->member['g_edit_profile'] = 0;
$this->member['g_use_pm'] = 0;
$this->member['g_is_supmod'] = 0;
$this->member['g_access_cp'] = 0;
$this->member['g_access_offline'] = 0;
$this->member['g_avoid_flood'] = 0;
$this->member['id'] = 0;
$this->ipsclass->member['_cache'] = array();
$this->ipsclass->member['_cache']['friends'] = array();
$this->ipsclass->perm_id = $this->member['g_perm_id'];
$this->ipsclass->perm_id_array = explode( ",", $this->ipsclass->perm_id );
@@ -256,11 +249,6 @@ class session
if ( $this->ipsclass->vars['spider_active'] )
{
$this->ipsclass->DB->simple_construct( array( 'delete' => 'sessions',
'where' => "id='".$agent.'='.str_replace('.','',$this->ipsclass->ip_address )."_session'"
) );
$this->ipsclass->DB->simple_exec();
$this->create_bot_session($agent, $this->bot_map[ strtolower($agent) ]);
}
@@ -313,7 +301,7 @@ class session
//-----------------------------------------
// Did we get a member?
//-----------------------------------------
if ( (! $this->member['id']) or ($this->member['id'] == 0) )
{
$this->unload_member();
@@ -532,14 +520,33 @@ class session
foreach( $this->ipsclass->cache['moderators'] as $r )
{
if ( $r['member_id'] == $this->member['id'] or $r['group_id'] == $this->member['mgroup'] )
if ( $r['member_id'] == $this->member['id'] )
{
$this->member['_moderator'][ $r['forum_id'] ] = $r;
$this->member['is_mod'] = 1;
}
else if( $r['group_id'] == $this->member['mgroup'] )
{
// Individual mods override group mod settings
// If array is set, don't override it
if( !is_array($this->member['_moderator'][ $r['forum_id'] ]) OR !count($this->member['_moderator'][ $r['forum_id'] ]) )
{
$this->member['_moderator'][ $r['forum_id'] ] = $r;
}
$this->member['is_mod'] = 1;
}
else if( count($other_mgroups) AND in_array( $r['group_id'], $other_mgroups ) )
{
$this->member['_moderator'][ $r['forum_id'] ] = $r;
// Individual mods override group mod settings
// If array is set, don't override it
if( !is_array($this->member['_moderator'][ $r['forum_id'] ]) OR !count($this->member['_moderator'][ $r['forum_id'] ]) )
{
$this->member['_moderator'][ $r['forum_id'] ] = $r;
}
$this->member['is_mod'] = 1;
}
}
@@ -564,7 +571,6 @@ class session
if ( !isset($this->ipsclass->input['last_activity']) OR !$this->ipsclass->input['last_activity'] )
{
$this->ipsclass->input['last_activity'] = $this->member['last_activity'] ? $this->member['last_activity'] : $this->time_now;
}
if ( !isset($this->ipsclass->input['last_visit']) OR !$this->ipsclass->input['last_visit'] )
@@ -576,7 +582,7 @@ class session
// If there hasn't been a cookie update in 2 hours,
// we assume that they've gone and come back
//-----------------------------------------
if ( ! $this->member['last_visit'] )
{
//-----------------------------------------
@@ -600,12 +606,7 @@ class session
list( $be_anon, $loggedin ) = explode( '&', $this->member['login_anonymous'] );
$this->ipsclass->DB->simple_construct( array( 'update' => 'members',
'set' => "login_anonymous='$be_anon&1', last_activity=".$this->time_now,
'where' => "id=".$this->member['id']
) );
$this->ipsclass->DB->simple_shutdown_exec();
$this->ipsclass->DB->do_shutdown_update( 'members', array( 'login_anonymous' => "{$be_anon}&1", 'last_activity' => $this->time_now ), 'id=' . $this->member['id'] );
}
//-----------------------------------------
@@ -640,7 +641,7 @@ class session
//-----------------------------------------
// Set a session ID cookie
//-----------------------------------------
$this->ipsclass->my_setcookie("session_id", $this->session_id, -1);
return $this->member;
@@ -659,6 +660,12 @@ class session
$less_is_more = array( 'g_search_flood' );
$zero_is_best = array( 'g_attach_max', 'g_attach_per_post', 'g_edit_cutoff', 'g_max_messages' );
# Blog
$zero_is_best = array_merge( $zero_is_best, array( 'g_blog_attach_max', 'g_blog_attach_per_entry', 'g_blog_preventpublish' ) );
# Gallery
$zero_is_best = array_merge( $zero_is_best, array( 'g_max_diskspace', 'g_max_upload', 'g_max_transfer', 'g_max_views', 'g_album_limit', 'g_img_album_limit', 'g_movie_size' ) );
if ( count( $groups_id ) )
{
foreach( $groups_id as $pid )
@@ -860,7 +867,7 @@ class session
return;
}
$this->ipsclass->my_setcookie( "pass_hash", $this->member['member_login_key'], 0, $this->ipsclass->vars['login_key_expire'] );
$this->ipsclass->my_setcookie( "pass_hash", $this->member['member_login_key'], ( $this->ipsclass->vars['login_key_expire'] ? 0 : 1 ), $this->ipsclass->vars['login_key_expire'] );
$this->ipsclass->DB->force_data_type = array( 'member_name' => 'string' );
@@ -958,7 +965,7 @@ class session
{
if ( $this->ipsclass->vars['match_browser'] == 1 )
{
$query = " AND browser='".$this->ipsclass->user_agent."'";
$query = " AND browser='". substr( $this->ipsclass->user_agent, 0, 200 ) ."'";
}
if ( $this->ipsclass->vars['match_ipaddress'] == 1 )
@@ -1023,7 +1030,7 @@ class session
// Remove the defunct sessions
//-----------------------------------------
$this->ipsclass->vars['session_expiration'] = $this->ipsclass->vars['session_expiration'] ? (time() - $this->ipsclass->vars['session_expiration']) : (time() - 3600);
//$this->ipsclass->vars['session_expiration'] = $this->ipsclass->vars['session_expiration'] ? (time() - $this->ipsclass->vars['session_expiration']) : (time() - 3600);
$this->ipsclass->DB->do_delete( 'sessions', "member_id=".$this->member['id'] );
@@ -1059,7 +1066,7 @@ class session
'login_type' => intval(substr($this->member['login_anonymous'],0, 1)),
'running_time' => $this->time_now,
'ip_address' => $this->ipsclass->ip_address,
'browser' => $this->ipsclass->user_agent,
'browser' => substr( $this->ipsclass->user_agent, 0, 200 ),
'location' => $vars['location'],
'in_error' => 0,
'location_1_type' => isset($vars['1_type']) ? $vars['1_type'] : '',
@@ -1074,8 +1081,8 @@ class session
//-----------------------------------------
// If this is a member, update their last visit times, etc.
//-----------------------------------------
if ( time() - $this->member['last_activity'] > 3600 )
if ( time() - $this->member['last_activity'] > $this->ipsclass->vars['session_expiration'] )
{
//-----------------------------------------
// Reset the topics read cookie..
@@ -1100,7 +1107,7 @@ class session
$this->ipsclass->input['last_activity'] = $this->time_now;
}
$this->ipsclass->my_setcookie( "pass_hash", $this->member['member_login_key'], 0, $this->ipsclass->vars['login_key_expire'] );
$this->ipsclass->my_setcookie( "pass_hash", $this->member['member_login_key'], ( $this->ipsclass->vars['login_key_expire'] ? 0 : 1 ), $this->ipsclass->vars['login_key_expire'] );
$this->ipsclass->DB->do_shutdown_update( 'members', array( 'member_login_key_expire' => time() + ( $this->ipsclass->vars['login_key_expire'] * 86400 ) ), "id={$this->member['id']}" );
}
@@ -1124,7 +1131,7 @@ class session
$query = array();
$this->ipsclass->vars['session_expiration'] = $this->ipsclass->vars['session_expiration'] ? (time() - $this->ipsclass->vars['session_expiration']) : (time() - 3600);
//$this->ipsclass->vars['session_expiration'] = $this->ipsclass->vars['session_expiration'] ? (time() - $this->ipsclass->vars['session_expiration']) : (time() - 3600);
//-----------------------------------------
// Remove the defunct sessions
@@ -1178,7 +1185,7 @@ class session
'login_type' => 0,
'running_time' => $this->time_now,
'ip_address' => $this->ipsclass->ip_address,
'browser' => $this->ipsclass->user_agent,
'browser' => substr( $this->ipsclass->user_agent, 0, 200 ),
'location' => $vars['location'],
'in_error' => 0,
'location_1_type' => isset($vars['1_type']) ? $vars['1_type'] : '',
@@ -1201,20 +1208,21 @@ class session
// Get module settings
//-----------------------------------------
$vars = $this->_get_location_settings();
$vars = $this->_get_location_settings();
$sid = $bot . '=' . str_replace( '.', '', $this->ipsclass->ip_address ) . '_session';
$this->ipsclass->DB->force_data_type = array( 'member_name' => 'string' );
$this->ipsclass->DB->do_insert( 'sessions',
$this->ipsclass->DB->do_replace_into( 'sessions',
array(
'id' => $bot.'='.str_replace('.','',$this->ipsclass->ip_address ).'_session',
'id' => $sid,
'member_name' => $name ? $name : $bot,
'member_id' => 0,
'member_group' => $this->ipsclass->vars['spider_group'],
'login_type' => intval($this->ipsclass->vars['spider_anon']),
'running_time' => $this->time_now,
'ip_address' => $this->ipsclass->ip_address,
'browser' => $this->ipsclass->user_agent,
'browser' => substr( $this->ipsclass->user_agent, 0, 200 ),
'location' => $vars['location'],
'in_error' => 0,
'location_1_type' => isset($vars['1_type']) ? $vars['1_type'] : '',
@@ -1223,7 +1231,7 @@ class session
'location_2_id' => isset($vars['2_id']) ? intval($vars['2_id']) : 0,
'location_3_type' => isset($vars['3_type']) ? $vars['3_type'] : '',
'location_3_id' => isset($vars['3_id']) ? intval($vars['3_id']) : 0,
)
), array( 'id' )
);
}
@@ -1280,17 +1288,19 @@ class session
if ( $module )
{
$filename = ROOT_PATH.'sources/components_location/'.$this->ipsclass->txt_alphanumerical_clean( $module ).'.php';
$module = $this->ipsclass->txt_alphanumerical_clean( $module );
$filename = ROOT_PATH.'sources/components_location/' . $module .'.php';
if ( file_exists( $filename ) )
{
require_once( $filename );
$toload = 'components_location_'.$module;
$toload = 'components_location_' . $module;
$loader = new $toload;
$loader->ipsclass =& $this->ipsclass;
$return = $loader->get_session_variables();
$return['location'] = 'mod:'.$module;
$return['location'] = 'mod:' . $module;
}
}
@@ -1298,7 +1308,7 @@ class session
// FORUM
//-----------------------------------------
else if ( $this->ipsclass->input['act'] == 'sf' AND $this->ipsclass->input['f'] )
else if ( $this->ipsclass->input['_low_act'] == 'sf' AND ( isset($this->ipsclass->input['f']) AND $this->ipsclass->input['f'] ) )
{
$return = array( 'location' => 'sf',
'2_type' => 'forum',
@@ -1309,7 +1319,7 @@ class session
// TOPIC
//-----------------------------------------
else if ( $this->ipsclass->input['act'] == 'st' AND $this->ipsclass->input['t'] )
else if ( $this->ipsclass->input['act'] == 'st' AND ( isset($this->ipsclass->input['t']) AND $this->ipsclass->input['t'] ) )
{
$return = array( 'location' => 'st',
'1_type' => 'topic',
@@ -1322,7 +1332,7 @@ class session
// POST
//-----------------------------------------
else if ( $this->ipsclass->input['act'] == 'post' AND $this->ipsclass->input['f'] )
else if ( $this->ipsclass->input['act'] == 'post' AND ( isset($this->ipsclass->input['f']) AND $this->ipsclass->input['f'] ) )
{
$return = array( 'location' => 'post',
'1_type' => 'topic',