Vergleich inc/class_session.php - 1.8.26 - 1.8.36

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 57Zeile 57
		$this->packedip = my_inet_pton($this->ipaddress);

// Find out the user agent.

		$this->packedip = my_inet_pton($this->ipaddress);

// Find out the user agent.

		$this->useragent = $_SERVER['HTTP_USER_AGENT'];




		if(isset($_SERVER['HTTP_USER_AGENT']))
{
$this->useragent = $_SERVER['HTTP_USER_AGENT'];
}


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


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

Zeile 69Zeile 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($session['sid'])

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

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

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

				}
}

				}
}

		}

if(isset($plugins))

		}

if(isset($plugins))

Zeile 118Zeile 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);

		}

		}

	}

/**

	}

/**

Zeile 141Zeile 144
			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
if(empty($loginkey) || $loginkey !== $mybb->user['loginkey'] || !$mybb->user['uid'])
{
unset($mybb->user);
$this->uid = 0;
return false;

		// Check the password if we're not using a session
if(empty($loginkey) || $loginkey !== $mybb->user['loginkey'] || !$mybb->user['uid'])
{
unset($mybb->user);
$this->uid = 0;
return false;

		}

		}

		$this->uid = $mybb->user['uid'];

// Set the logout key for this user

		$this->uid = $mybb->user['uid'];

// Set the logout key for this user

Zeile 163Zeile 166
				$update += 1;
}
if($mybb->user['unreadpms'] == -1)

				$update += 1;
}
if($mybb->user['unreadpms'] == -1)

			{

			{

				$update += 2;
}


				$update += 2;
}


Zeile 178Zeile 181
		$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);
}
else

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

Zeile 209Zeile 212
		if($mybb->user['dateformat'] != 0 && $mybb->user['dateformat'] != '')
{
global $date_formats;

		if($mybb->user['dateformat'] != 0 && $mybb->user['dateformat'] != '')
{
global $date_formats;

			if($date_formats[$mybb->user['dateformat']])

			if(!empty($date_formats[$mybb->user['dateformat']]))

			{
$mybb->settings['dateformat'] = $date_formats[$mybb->user['dateformat']];
}

			{
$mybb->settings['dateformat'] = $date_formats[$mybb->user['dateformat']];
}

Zeile 219Zeile 222
		if($mybb->user['timeformat'] != 0 && $mybb->user['timeformat'] != '')
{
global $time_formats;

		if($mybb->user['timeformat'] != 0 && $mybb->user['timeformat'] != '')
{
global $time_formats;

			if($time_formats[$mybb->user['timeformat']])

			if(!empty($time_formats[$mybb->user['timeformat']]))

			{
$mybb->settings['timeformat'] = $time_formats[$mybb->user['timeformat']];
}

			{
$mybb->settings['timeformat'] = $time_formats[$mybb->user['timeformat']];
}

Zeile 350Zeile 353
		$mybb->user['uid'] = 0;
$mybbgroups = 1;
$mybb->user['displaygroup'] = 1;

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

 
		$mybb->user['invisible'] = 0;
$mybb->user['moderateposts'] = 0;
$mybb->user['showquickreply'] = 1;
$mybb->user['signature'] = '';
$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 358Zeile 366
			{
$mybb->user['lastactive'] = $time;
$mybb->cookies['mybb']['lastactive'] = $mybb->user['lastactive'];

			{
$mybb->user['lastactive'] = $time;
$mybb->cookies['mybb']['lastactive'] = $mybb->user['lastactive'];

			}
else
{

			}
else
{

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

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

Zeile 433Zeile 441
		$mybb->user['username'] = '';
$mybb->user['uid'] = 0;
$mybb->user['displaygroup'] = $mybb->user['usergroup'];

		$mybb->user['username'] = '';
$mybb->user['uid'] = 0;
$mybb->user['displaygroup'] = $mybb->user['usergroup'];

 
		$mybb->user['additionalgroups'] = '';
$mybb->user['invisible'] = 0;


// Set spider language
if($spider['language'] && $lang->language_exists($spider['language']))


// Set spider language
if($spider['language'] && $lang->language_exists($spider['language']))

Zeile 461Zeile 471
				"lastvisit" => TIME_NOW
);
$db->update_query("spiders", $updated_spider, "sid='{$spider_id}'");

				"lastvisit" => TIME_NOW
);
$db->update_query("spiders", $updated_spider, "sid='{$spider_id}'");

		}

		}


// Update the online data.
if(!defined("NO_ONLINE") && !defined('IN_UPGRADE'))


// Update the online data.
if(!defined("NO_ONLINE") && !defined('IN_UPGRADE'))

Zeile 479Zeile 489
	 * @param int $uid The user id.
*/
function update_session($sid, $uid=0)

	 * @param int $uid The user id.
*/
function update_session($sid, $uid=0)

	{
global $db;

	{
global $db;


// Find out what the special locations are.
$speciallocs = $this->get_special_locations();
if($uid)


// Find out what the special locations are.
$speciallocs = $this->get_special_locations();
if($uid)

		{
$onlinedata['uid'] = $uid;
}
else
{
$onlinedata['uid'] = 0;
}
$onlinedata['time'] = TIME_NOW;

$onlinedata['location'] = $db->escape_string(substr(get_current_location(false, $this->ignore_parameters), 0, 150));
$onlinedata['useragent'] = $db->escape_string(my_substr($this->useragent, 0, 200));


		{
$onlinedata['uid'] = $uid;
}
else
{
$onlinedata['uid'] = 0;
}
$onlinedata['time'] = TIME_NOW;

$onlinedata['location'] = $db->escape_string(substr(get_current_location(false, $this->ignore_parameters), 0, 150));
$onlinedata['useragent'] = $db->escape_string(my_substr($this->useragent, 0, 200));


		$onlinedata['location1'] = (int)$speciallocs['1'];
$onlinedata['location2'] = (int)$speciallocs['2'];
$onlinedata['nopermission'] = 0;
$sid = $db->escape_string($sid);

$db->update_query("sessions", $onlinedata, "sid='{$sid}'");

		$onlinedata['location1'] = (int)$speciallocs['1'];
$onlinedata['location2'] = (int)$speciallocs['2'];
$onlinedata['nopermission'] = 0;
$sid = $db->escape_string($sid);

$db->update_query("sessions", $onlinedata, "sid='{$sid}'");

	}


	}


	/**
* Create a new session.
*

	/**
* Create a new session.
*

Zeile 520Zeile 530
		{
$db->delete_query("sessions", "uid='{$uid}'");
$onlinedata['uid'] = $uid;

		{
$db->delete_query("sessions", "uid='{$uid}'");
$onlinedata['uid'] = $uid;

		}
// Is a spider - delete all other spider references
else if($this->is_spider == true)
{
$db->delete_query("sessions", "sid='{$this->sid}'");

 
		}
else
{

		}
else
{

 
			// Is a spider - delete all other spider references
if($this->is_spider == true)
{
$db->delete_query("sessions", "sid='{$this->sid}'");
}


			$onlinedata['uid'] = 0;

			$onlinedata['uid'] = 0;

		}

		}


// If the user is a search enginge spider, ...
if($this->is_spider == true)


// If the user is a search enginge spider, ...
if($this->is_spider == true)

Zeile 545Zeile 556

$onlinedata['location'] = $db->escape_string(substr(get_current_location(false, $this->ignore_parameters), 0, 150));
$onlinedata['useragent'] = $db->escape_string(my_substr($this->useragent, 0, 200));


$onlinedata['location'] = $db->escape_string(substr(get_current_location(false, $this->ignore_parameters), 0, 150));
$onlinedata['useragent'] = $db->escape_string(my_substr($this->useragent, 0, 200));

		



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

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