Version 2.2.2
This commit is contained in:
1 parent
22f1b963ee
commit
a3bb603c96
858 files changed
+479463
-188140
No files matched your search
@@ -1,18 +1,28 @@
|
||||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board
|
||||
| Invision Power Board 2.2.2
|
||||
| =============================================
|
||||
| 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
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2006-10-11 13:55:47 +0100 (Wed, 11 Oct 2006) $
|
||||
| > $Revision: 624 $
|
||||
| > $Author: matt $
|
||||
| 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 $
|
||||
| > $Author: bfarber $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > SESSION CLASS
|
||||
@@ -26,7 +36,7 @@
|
||||
|
||||
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.";
|
||||
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -119,7 +129,7 @@ class session
|
||||
{
|
||||
foreach ($this->ipsclass->cache['banfilters'] as $ip)
|
||||
{
|
||||
$ip = str_replace( '\*', '.*', preg_quote($ip, "/") );
|
||||
$ip = str_replace( '\*', '.*', preg_quote( trim($ip), "/") );
|
||||
|
||||
if ( preg_match( "/^$ip$/", $this->ipsclass->input['IP_ADDRESS'] ) )
|
||||
{
|
||||
@@ -157,7 +167,8 @@ class session
|
||||
|
||||
if ( ($this->ipsclass->input['act'] == 'chat' and $this->ipsclass->input['CODE'] == 'update')
|
||||
OR $this->ipsclass->input['act'] == 'xmlout'
|
||||
OR $this->ipsclass->input['act'] == 'rssout' )
|
||||
OR $this->ipsclass->input['act'] == 'rssout'
|
||||
OR $this->ipsclass->input['act'] == 'attach' )
|
||||
{
|
||||
$this->ipsclass->no_print_header = 1;
|
||||
$this->do_update = 0;
|
||||
@@ -216,7 +227,7 @@ class session
|
||||
$this->session_id = "";
|
||||
|
||||
$agent = trim($match[0]);
|
||||
$agent = str_replace( '\r', '', $agent );
|
||||
$agent = substr( str_replace( '\r', '', $agent ), 0, 40 );
|
||||
|
||||
//-----------------------------------------
|
||||
// Using lofi?
|
||||
@@ -248,7 +259,7 @@ class session
|
||||
$this->ipsclass->DB->simple_construct( array( 'delete' => 'sessions',
|
||||
'where' => "id='".$agent.'='.str_replace('.','',$this->ipsclass->ip_address )."_session'"
|
||||
) );
|
||||
$this->ipsclass->DB->simple_shutdown_exec();
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
$this->create_bot_session($agent, $this->bot_map[ strtolower($agent) ]);
|
||||
}
|
||||
@@ -327,8 +338,21 @@ class session
|
||||
|
||||
if ( $cookie['member_id'] != "" and $cookie['pass_hash'] != "" )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load member
|
||||
//-----------------------------------------
|
||||
|
||||
$this->load_member( $cookie['member_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// INIT log in key stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$_ok = 1;
|
||||
$_days = 0;
|
||||
$_sticky = 1;
|
||||
$_time = ( $this->ipsclass->vars['login_key_expire'] ) ? ( time() + ( intval($this->ipsclass->vars['login_key_expire']) * 86400 ) ) : 0;
|
||||
|
||||
if ( (! $this->member['id']) or ($this->member['id'] == 0) )
|
||||
{
|
||||
$this->unload_member();
|
||||
@@ -343,17 +367,22 @@ class session
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->ipsclass->stronghold_check_cookie( $this->member['id'], $this->member['member_login_key'] ) !== TRUE )
|
||||
{
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Create new log in key as stronghold
|
||||
// failed
|
||||
//-----------------------------------------
|
||||
|
||||
$this->member['member_login_key'] = $this->ipsclass->converge->generate_auto_log_in_key();
|
||||
|
||||
$this->ipsclass->DB->do_update( 'members', array( 'member_login_key' => $this->member['member_login_key'],
|
||||
'member_login_key_expire' => $_time ), 'id='.$this->member['id'] );
|
||||
|
||||
$this->unload_member();
|
||||
$this->create_guest_session();
|
||||
}
|
||||
else
|
||||
{
|
||||
$_ok = 1;
|
||||
$_days = 0;
|
||||
$_sticky = 1;
|
||||
$_time = ( $this->ipsclass->vars['login_key_expire'] ) ? ( time() + ( intval($this->ipsclass->vars['login_key_expire']) * 86400 ) ) : 0;
|
||||
|
||||
//-----------------------------------------
|
||||
// Key expired?
|
||||
//-----------------------------------------
|
||||
@@ -492,11 +521,11 @@ class session
|
||||
{
|
||||
$this->member['is_mod'] = 1;
|
||||
}
|
||||
else if ( count($this->ipsclass->cache['moderators']) )
|
||||
else if ( is_array($this->ipsclass->cache['moderators']) AND count($this->ipsclass->cache['moderators']) )
|
||||
{
|
||||
$other_mgroups = array();
|
||||
|
||||
if( $this->member['mgroup_others'] )
|
||||
if ( $this->member['mgroup_others'] )
|
||||
{
|
||||
$other_mgroups = explode( ",", $this->ipsclass->clean_perm_string( $this->member['mgroup_others'] ) );
|
||||
}
|
||||
@@ -628,7 +657,7 @@ class session
|
||||
$groups_id = explode( ',', $this->member['mgroup_others'] );
|
||||
$exclude = array( 'g_title', 'g_icon', 'prefix', 'suffix', 'g_promotion', 'g_photo_max_vars' );
|
||||
$less_is_more = array( 'g_search_flood' );
|
||||
$zero_is_best = array( 'g_attach_max', 'g_edit_cutoff' );
|
||||
$zero_is_best = array( 'g_attach_max', 'g_attach_per_post', 'g_edit_cutoff', 'g_max_messages' );
|
||||
|
||||
if ( count( $groups_id ) )
|
||||
{
|
||||
@@ -661,6 +690,10 @@ class session
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if( $v == 0 )
|
||||
{
|
||||
$this->member[ $k ] = 0;
|
||||
}
|
||||
else if ( $v > $this->member[ $k ] )
|
||||
{
|
||||
$this->member[ $k ] = $v;
|
||||
@@ -827,6 +860,8 @@ class session
|
||||
return;
|
||||
}
|
||||
|
||||
$this->ipsclass->my_setcookie( "pass_hash", $this->member['member_login_key'], 0, $this->ipsclass->vars['login_key_expire'] );
|
||||
|
||||
$this->ipsclass->DB->force_data_type = array( 'member_name' => 'string' );
|
||||
|
||||
$this->ipsclass->DB->do_shutdown_update( 'sessions',
|
||||
@@ -834,7 +869,7 @@ class session
|
||||
'member_name' => $this->member['members_display_name'],
|
||||
'member_id' => intval($this->member['id']),
|
||||
'member_group' => $this->member['mgroup'],
|
||||
'login_type' => substr($this->member['login_anonymous'],0, 1),
|
||||
'login_type' => intval(substr($this->member['login_anonymous'],0, 1)),
|
||||
'running_time' => $this->time_now,
|
||||
'location' => $vars['location'],
|
||||
'in_error' => 0,
|
||||
@@ -847,6 +882,8 @@ class session
|
||||
),
|
||||
"id='{$this->session_id}'"
|
||||
);
|
||||
|
||||
$this->ipsclass->DB->do_shutdown_update( 'members', array( 'member_login_key_expire' => time() + ( $this->ipsclass->vars['login_key_expire'] * 86400 ) ), "id={$this->member['id']}" );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -887,7 +924,7 @@ class session
|
||||
'member_name' => '',
|
||||
'member_id' => 0,
|
||||
'member_group' => $this->ipsclass->vars['guest_group'],
|
||||
'login_type' => '',
|
||||
'login_type' => 0,
|
||||
'running_time' => $this->time_now,
|
||||
'location' => $vars['location'],
|
||||
'in_error' => 0,
|
||||
@@ -1019,7 +1056,7 @@ class session
|
||||
'member_name' => $this->member['members_display_name'],
|
||||
'member_id' => intval($this->member['id']),
|
||||
'member_group' => $this->member['mgroup'],
|
||||
'login_type' => substr($this->member['login_anonymous'],0, 1),
|
||||
'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,
|
||||
@@ -1062,6 +1099,10 @@ class session
|
||||
$this->ipsclass->input['last_visit'] = $this->member['last_activity'];
|
||||
$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->DB->do_shutdown_update( 'members', array( 'member_login_key_expire' => time() + ( $this->ipsclass->vars['login_key_expire'] * 86400 ) ), "id={$this->member['id']}" );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1164,13 +1205,13 @@ class session
|
||||
|
||||
$this->ipsclass->DB->force_data_type = array( 'member_name' => 'string' );
|
||||
|
||||
$this->ipsclass->DB->do_shutdown_insert( 'sessions',
|
||||
$this->ipsclass->DB->do_insert( 'sessions',
|
||||
array(
|
||||
'id' => $bot.'='.str_replace('.','',$this->ipsclass->ip_address ).'_session',
|
||||
'member_name' => $name ? $name : $bot,
|
||||
'member_id' => 0,
|
||||
'member_group' => $this->ipsclass->vars['spider_group'],
|
||||
'login_type' => $this->ipsclass->vars['spider_anon'],
|
||||
'login_type' => intval($this->ipsclass->vars['spider_anon']),
|
||||
'running_time' => $this->time_now,
|
||||
'ip_address' => $this->ipsclass->ip_address,
|
||||
'browser' => $this->ipsclass->user_agent,
|
||||
@@ -1205,7 +1246,7 @@ class session
|
||||
'member_name' => $name ? $name : $bot,
|
||||
'member_id' => 0,
|
||||
'member_group' => $this->ipsclass->vars['spider_group'],
|
||||
'login_type' => $this->ipsclass->vars['spider_anon'],
|
||||
'login_type' => intval($this->ipsclass->vars['spider_anon']),
|
||||
'running_time' => $this->time_now,
|
||||
'location' => $vars['location'],
|
||||
'in_error' => 0,
|
||||
|
||||
Reference in new issue
Block a user