Vergleich inc/class_session.php - 1.8.32 - 1.8.39

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 72Zeile 72
			{
$query = $db->simple_select("sessions", "*", "sid='{$sid}'");
$session = $db->fetch_array($query);

			{
$query = $db->simple_select("sessions", "*", "sid='{$sid}'");
$session = $db->fetch_array($query);

				if(!empty($session) && $session['sid'])

				if($session)

				{
$this->sid = $session['sid'];
}

				{
$this->sid = $session['sid'];
}

Zeile 121Zeile 121
		if($this->sid && (!isset($mybb->cookies['sid']) || $mybb->cookies['sid'] != $this->sid) && $this->is_spider != true)
{
my_setcookie("sid", $this->sid, -1, true);

		if($this->sid && (!isset($mybb->cookies['sid']) || $mybb->cookies['sid'] != $this->sid) && $this->is_spider != true)
{
my_setcookie("sid", $this->sid, -1, true);

 
		}

if(isset($plugins))
{
$plugins->run_hooks('post_session_load', $this);

		}
}


		}
}


Zeile 144Zeile 149
			LIMIT 1
");
$mybb->user = $db->fetch_array($query);

			LIMIT 1
");
$mybb->user = $db->fetch_array($query);





		// Check the password if we're not using a session

		// Check the password if we're not using a session

		if(empty($loginkey) || $loginkey !== $mybb->user['loginkey'] || !$mybb->user['uid'])

		if(!$mybb->user || empty($loginkey) || $loginkey !== $mybb->user['loginkey'])

		{
unset($mybb->user);
$this->uid = 0;

		{
unset($mybb->user);
$this->uid = 0;

Zeile 181Zeile 186
		$mybb->user['pms_unread'] = $mybb->user['unreadpms'];

if($mybb->user['lastip'] != $this->packedip && array_key_exists('lastip', $mybb->user) && !defined('IN_UPGRADE'))

		$mybb->user['pms_unread'] = $mybb->user['unreadpms'];

if($mybb->user['lastip'] != $this->packedip && array_key_exists('lastip', $mybb->user) && !defined('IN_UPGRADE'))

		{

		{

			$lastip_add = ", lastip=".$db->escape_binary($this->packedip);

			$lastip_add = ", lastip=".$db->escape_binary($this->packedip);

		}

		}

		else
{
$lastip_add = '';

		else
{
$lastip_add = '';

		}


		}


		// If the last visit was over 900 seconds (session time out) ago then update lastvisit.
$time = TIME_NOW;
if($time - $mybb->user['lastactive'] > 900)

		// If the last visit was over 900 seconds (session time out) ago then update lastvisit.
$time = TIME_NOW;
if($time - $mybb->user['lastactive'] > 900)

Zeile 202Zeile 207
		{
$timespent = TIME_NOW - $mybb->user['lastactive'];
$db->shutdown_query("UPDATE ".TABLE_PREFIX."users SET lastactive='$time', timeonline=timeonline+$timespent{$lastip_add} WHERE uid='{$mybb->user['uid']}'");

		{
$timespent = TIME_NOW - $mybb->user['lastactive'];
$db->shutdown_query("UPDATE ".TABLE_PREFIX."users SET lastactive='$time', timeonline=timeonline+$timespent{$lastip_add} WHERE uid='{$mybb->user['uid']}'");

		}

		}


// Sort out the language and forum preferences.
if($mybb->user['language'] && $lang->language_exists($mybb->user['language']))


// Sort out the language and forum preferences.
if($mybb->user['language'] && $lang->language_exists($mybb->user['language']))

Zeile 215Zeile 220
			if(!empty($date_formats[$mybb->user['dateformat']]))
{
$mybb->settings['dateformat'] = $date_formats[$mybb->user['dateformat']];

			if(!empty($date_formats[$mybb->user['dateformat']]))
{
$mybb->settings['dateformat'] = $date_formats[$mybb->user['dateformat']];

			}
}

			}
}


// Choose time format.
if($mybb->user['timeformat'] != 0 && $mybb->user['timeformat'] != '')


// Choose time format.
if($mybb->user['timeformat'] != 0 && $mybb->user['timeformat'] != '')

Zeile 230Zeile 235

// Find out the threads per page preference.
if($mybb->user['tpp'])


// Find out the threads per page preference.
if($mybb->user['tpp'])

		{

		{

			$mybb->settings['threadsperpage'] = $mybb->user['tpp'];

			$mybb->settings['threadsperpage'] = $mybb->user['tpp'];

		}


		}


		// Find out the posts per page preference.
if($mybb->user['ppp'])
{
$mybb->settings['postsperpage'] = $mybb->user['ppp'];

		// Find out the posts per page preference.
if($mybb->user['ppp'])
{
$mybb->settings['postsperpage'] = $mybb->user['ppp'];

		}


		}


		// Does this user prefer posts in classic mode?
if($mybb->user['classicpostbit'])
{

		// Does this user prefer posts in classic mode?
if($mybb->user['classicpostbit'])
{

Zeile 354Zeile 359
		$mybbgroups = 1;
$mybb->user['displaygroup'] = 1;
$mybb->user['invisible'] = 0;

		$mybbgroups = 1;
$mybb->user['displaygroup'] = 1;
$mybb->user['invisible'] = 0;

 
		$mybb->user['moderateposts'] = 0;
$mybb->user['showquickreply'] = 1;
$mybb->user['signature'] = '';
$mybb->user['sourceeditor'] = 0;
$mybb->user['subscriptionmethod'] = 0;
$mybb->user['suspendposting'] = 0;


// Has this user visited before? Lastvisit need updating?
if(isset($mybb->cookies['mybb']['lastvisit']))


// Has this user visited before? Lastvisit need updating?
if(isset($mybb->cookies['mybb']['lastvisit']))

Zeile 367Zeile 378
			{
$mybb->user['lastactive'] = (int)$mybb->cookies['mybb']['lastactive'];
}

			{
$mybb->user['lastactive'] = (int)$mybb->cookies['mybb']['lastactive'];
}

			if($time - $mybb->cookies['mybb']['lastactive'] > 900)

			if($time - (int)$mybb->cookies['mybb']['lastactive'] > 900)

			{
my_setcookie("mybb[lastvisit]", $mybb->user['lastactive']);
$mybb->user['lastvisit'] = $mybb->user['lastactive'];

			{
my_setcookie("mybb[lastvisit]", $mybb->user['lastactive']);
$mybb->user['lastvisit'] = $mybb->user['lastactive'];

Zeile 416Zeile 427
	 * @param int $spider_id The ID of the search engine spider
*/
function load_spider($spider_id)

	 * @param int $spider_id The ID of the search engine spider
*/
function load_spider($spider_id)

	{

	{

		global $mybb, $time, $db, $lang;

// Fetch the spider preferences from the database

		global $mybb, $time, $db, $lang;

// Fetch the spider preferences from the database

Zeile 431Zeile 442
			$mybb->user['usergroup'] = $spider['usergroup'];
}
else

			$mybb->user['usergroup'] = $spider['usergroup'];
}
else

		{

		{

			$mybb->user['usergroup'] = 1;
}
$mybb->user['username'] = '';

			$mybb->user['usergroup'] = 1;
}
$mybb->user['username'] = '';

Zeile 444Zeile 455
		if($spider['language'] && $lang->language_exists($spider['language']))
{
$mybb->settings['bblanguage'] = $spider['language'];

		if($spider['language'] && $lang->language_exists($spider['language']))
{
$mybb->settings['bblanguage'] = $spider['language'];

		}


		}


		// Set spider theme
if($spider['theme'])
{

		// Set spider theme
if($spider['theme'])
{

Zeile 474Zeile 485
		{
$this->sid = "bot=".$spider_id;
$this->create_session();

		{
$this->sid = "bot=".$spider_id;
$this->create_session();

		}

		}


}



}


Zeile 489Zeile 500
		global $db;

// Find out what the special locations are.

		global $db;

// Find out what the special locations are.

		$speciallocs = $this->get_special_locations();

		$speciallocs = $this->get_special_locations();

		if($uid)
{
$onlinedata['uid'] = $uid;

		if($uid)
{
$onlinedata['uid'] = $uid;

Zeile 533Zeile 544
			if($this->is_spider == true)
{
$db->delete_query("sessions", "sid='{$this->sid}'");

			if($this->is_spider == true)
{
$db->delete_query("sessions", "sid='{$this->sid}'");

			}

			}


$onlinedata['uid'] = 0;
}


$onlinedata['uid'] = 0;
}

Zeile 568Zeile 579
	 */
function get_special_locations()
{

	 */
function get_special_locations()
{

		global $mybb;

		global $mybb, $db;

		$array = array('1' => '', '2' => '');
if(preg_match("#forumdisplay.php#", $_SERVER['PHP_SELF']) && $mybb->get_input('fid', MyBB::INPUT_INT) > 0 && $mybb->get_input('fid', MyBB::INPUT_INT) < 4294967296)

		$array = array('1' => '', '2' => '');
if(preg_match("#forumdisplay.php#", $_SERVER['PHP_SELF']) && $mybb->get_input('fid', MyBB::INPUT_INT) > 0 && $mybb->get_input('fid', MyBB::INPUT_INT) < 4294967296)

		{

		{

			$array[1] = $mybb->get_input('fid', MyBB::INPUT_INT);

			$array[1] = $mybb->get_input('fid', MyBB::INPUT_INT);

			$array[2] = '';

 
		}
elseif(preg_match("#showthread.php#", $_SERVER['PHP_SELF']))
{

		}
elseif(preg_match("#showthread.php#", $_SERVER['PHP_SELF']))
{

			global $db;


 
			if($mybb->get_input('tid', MyBB::INPUT_INT) > 0 && $mybb->get_input('tid', MyBB::INPUT_INT) < 4294967296)

			if($mybb->get_input('tid', MyBB::INPUT_INT) > 0 && $mybb->get_input('tid', MyBB::INPUT_INT) < 4294967296)

			{

			{

				$array[2] = $mybb->get_input('tid', MyBB::INPUT_INT);
}


				$array[2] = $mybb->get_input('tid', MyBB::INPUT_INT);
}


Zeile 592Zeile 600
				);
$query = $db->simple_select("posts", "tid", "pid=".$mybb->get_input('pid', MyBB::INPUT_INT), $options);
$post = $db->fetch_array($query);

				);
$query = $db->simple_select("posts", "tid", "pid=".$mybb->get_input('pid', MyBB::INPUT_INT), $options);
$post = $db->fetch_array($query);

				$array[2] = $post['tid'];
}




				if($post)
{
$array[2] = $post['tid'];
}
}


$thread = get_thread($array[2]);


$thread = get_thread($array[2]);

			$array[1] = $thread['fid'];




			if($thread)
{
$array[1] = $thread['fid'];
}

		}
return $array;
}

		}
return $array;
}