Vergleich inc/class_session.php - 1.6.10 - 1.6.11

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 29Zeile 29

// Find out the user agent.
$this->useragent = $_SERVER['HTTP_USER_AGENT'];


// Find out the user agent.
$this->useragent = $_SERVER['HTTP_USER_AGENT'];

		if(my_strlen($this->useragent) > 100)
{
$this->useragent = my_substr($this->useragent, 0, 100);
}








		// Attempt to find a session id in the cookies.
if(isset($mybb->cookies['sid']))
{

		// Attempt to find a session id in the cookies.
if(isset($mybb->cookies['sid']))
{

Zeile 82Zeile 78


// As a token of our appreciation for getting this far (and they aren't a spider), give the user a cookie



// As a token of our appreciation for getting this far (and they aren't a spider), give the user a cookie

		if($this->sid && (isset($mybb->cookies['sid'] ) && $mybb->cookies['sid'] != $this->sid) && $this->is_spider != true)

		if($this->sid && (!isset($mybb->cookies['sid']) || $mybb->cookies['sid'] != $this->sid) && $this->is_spider != true)

		{
my_setcookie("sid", $this->sid, -1, true);
}

		{
my_setcookie("sid", $this->sid, -1, true);
}

Zeile 92Zeile 88
	 * Load a user via the user credentials.
*
* @param int The user id.

	 * Load a user via the user credentials.
*
* @param int The user id.

	 * @param string The user's password.

	 * @param string The user's loginkey.

	 */

	 */

	function load_user($uid, $password='')

	function load_user($uid, $loginkey='')

	{
global $mybb, $db, $time, $lang, $mybbgroups, $session, $cache;

	{
global $mybb, $db, $time, $lang, $mybbgroups, $session, $cache;

		



		// Read the banned cache

		// Read the banned cache

		$bannedcache = $cache->read("banned");	


		$bannedcache = $cache->read("banned");


		// If the banned cache doesn't exist, update it and re-read it
if(!is_array($bannedcache))
{
$cache->update_banned();
$bannedcache = $cache->read("banned");
}

		// If the banned cache doesn't exist, update it and re-read it
if(!is_array($bannedcache))
{
$cache->update_banned();
$bannedcache = $cache->read("banned");
}

		



		$uid = intval($uid);
$query = $db->query("
SELECT u.*, f.*

		$uid = intval($uid);
$query = $db->query("
SELECT u.*, f.*

			FROM ".TABLE_PREFIX."users u 
LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)

			FROM ".TABLE_PREFIX."users u
LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)

			WHERE u.uid='$uid'
LIMIT 1
");
$mybb->user = $db->fetch_array($query);

			WHERE u.uid='$uid'
LIMIT 1
");
$mybb->user = $db->fetch_array($query);

		



		if(!empty($bannedcache[$uid]))
{
$banned_user = $bannedcache[$uid];

		if(!empty($bannedcache[$uid]))
{
$banned_user = $bannedcache[$uid];

Zeile 129Zeile 125
		}

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

		}

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

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

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

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

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

Zeile 222Zeile 218
		{
$mybb->settings['postsperpage'] = $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 276Zeile 272
		{
$mybb->usergroup = array_merge($mybb->usergroup, $mydisplaygroup);
}

		{
$mybb->usergroup = array_merge($mybb->usergroup, $mydisplaygroup);
}

		



		if(!$mybb->user['usertitle'])
{
$mybb->user['usertitle'] = $mybb->usergroup['usertitle'];

		if(!$mybb->user['usertitle'])
{
$mybb->user['usertitle'] = $mybb->usergroup['usertitle'];

Zeile 349Zeile 345
		// Gather a full permission set for this guest
$mybb->usergroup = usergroup_permissions($mybbgroups);
$mydisplaygroup = usergroup_displaygroup($mybb->user['displaygroup']);

		// Gather a full permission set for this guest
$mybb->usergroup = usergroup_permissions($mybbgroups);
$mydisplaygroup = usergroup_displaygroup($mybb->user['displaygroup']);

		



		$mybb->usergroup = array_merge($mybb->usergroup, $mydisplaygroup);

// Update the online data.

		$mybb->usergroup = array_merge($mybb->usergroup, $mydisplaygroup);

// Update the online data.

Zeile 451Zeile 447
		}
$onlinedata['time'] = TIME_NOW;
$onlinedata['location'] = $db->escape_string(get_current_location());

		}
$onlinedata['time'] = TIME_NOW;
$onlinedata['location'] = $db->escape_string(get_current_location());

		$onlinedata['useragent'] = $db->escape_string($this->useragent);






		$useragent = $this->useragent;
if(my_strlen($useragent) > 100)
{
$useragent = my_substr($useragent, 0, 100);
}
$onlinedata['useragent'] = $db->escape_string($useragent);

		$onlinedata['location1'] = intval($speciallocs['1']);
$onlinedata['location2'] = intval($speciallocs['2']);
$onlinedata['nopermission'] = 0;

		$onlinedata['location1'] = intval($speciallocs['1']);
$onlinedata['location2'] = intval($speciallocs['2']);
$onlinedata['nopermission'] = 0;

Zeile 500Zeile 501
		$onlinedata['time'] = TIME_NOW;
$onlinedata['ip'] = $db->escape_string($this->ipaddress);
$onlinedata['location'] = $db->escape_string(get_current_location());

		$onlinedata['time'] = TIME_NOW;
$onlinedata['ip'] = $db->escape_string($this->ipaddress);
$onlinedata['location'] = $db->escape_string(get_current_location());

		$onlinedata['useragent'] = $db->escape_string($this->useragent);






		$useragent = $this->useragent;
if(my_strlen($useragent) > 100)
{
$useragent = my_substr($useragent, 0, 100);
}
$onlinedata['useragent'] = $db->escape_string($useragent);

		$onlinedata['location1'] = intval($speciallocs['1']);
$onlinedata['location2'] = intval($speciallocs['2']);
$onlinedata['nopermission'] = 0;

		$onlinedata['location1'] = intval($speciallocs['1']);
$onlinedata['location2'] = intval($speciallocs['2']);
$onlinedata['nopermission'] = 0;

Zeile 523Zeile 529
			$array[1] = intval($mybb->input['fid']);
$array[2] = '';
}

			$array[1] = intval($mybb->input['fid']);
$array[2] = '';
}

		elseif(preg_match("#showthread.php#", $_SERVER['PHP_SELF']) && intval($mybb->input['tid']) > 0)

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

		{
global $db;

		{
global $db;

			$array[2] = intval($mybb->input['tid']);
$thread = get_thread(intval($array[2]));






















if($mybb->input['tid'] && intval($mybb->input['tid']) > 0)
{
$array[2] = intval($mybb->input['tid']);
}
elseif($mybb->input['pid'] && intval($mybb->input['pid']) > 0)
{
$array[2] = intval($mybb->input['pid']);
}

// If there is no tid but a pid, trick the system into thinking there was a tid anyway.
if(!empty($mybb->input['pid']) && !isset($mybb->input['tid']))
{
$options = array(
"limit" => 1
);
$query = $db->simple_select("posts", "tid", "pid=".$mybb->input['pid'], $options);
$post = $db->fetch_array($query);
$mybb->input['tid'] = $post['tid'];
}

$thread = get_thread(intval($mybb->input['tid']));

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

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