Vergleich inc/class_session.php - 1.8.28 - 1.8.37

  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 66Zeile 69

// Load the session if not using a bot sid
if(substr($sid, 3, 1) !== '=')


// Load the session if not using a bot sid
if(substr($sid, 3, 1) !== '=')

			{

			{

				$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'];

				}
}
}


				}
}
}


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

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

Zeile 83Zeile 86

// If we have a valid session id and user id, load that users session.
if(!empty($mybb->cookies['mybbuser']))


// If we have a valid session id and user id, load that users session.
if(!empty($mybb->cookies['mybbuser']))

		{

		{

			$logon = explode("_", $mybb->cookies['mybbuser'], 2);
$this->load_user($logon[0], $logon[1]);
}

			$logon = explode("_", $mybb->cookies['mybbuser'], 2);
$this->load_user($logon[0], $logon[1]);
}

Zeile 123Zeile 126

/**
* Load a user via the user credentials.


/**
* Load a user via the user credentials.

	 *
* @param int $uid The user id.

	 *
* @param int $uid The user id.

	 * @param string $loginkey The user's loginkey.
* @return bool
*/

	 * @param string $loginkey The user's loginkey.
* @return bool
*/

Zeile 143Zeile 146
		$mybb->user = $db->fetch_array($query);

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

		$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'])

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

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

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

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 325Zeile 328
			if(!empty($this->sid))
{
$this->update_session($this->sid, $mybb->user['uid']);

			if(!empty($this->sid))
{
$this->update_session($this->sid, $mybb->user['uid']);

			}

			}

			else
{
$this->create_session($mybb->user['uid']);

			else
{
$this->create_session($mybb->user['uid']);

Zeile 351Zeile 354
		$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['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 363Zeile 370
			else
{
$mybb->user['lastactive'] = (int)$mybb->cookies['mybb']['lastactive'];

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

			}

			}

			if($time - $mybb->cookies['mybb']['lastactive'] > 900)
{
my_setcookie("mybb[lastvisit]", $mybb->user['lastactive']);

			if($time - $mybb->cookies['mybb']['lastactive'] > 900)
{
my_setcookie("mybb[lastvisit]", $mybb->user['lastactive']);

Zeile 387Zeile 394

// Gather a full permission set for this guest
$mybb->usergroup = usergroup_permissions($mybbgroups);


// Gather a full permission set for this guest
$mybb->usergroup = usergroup_permissions($mybbgroups);

		$mydisplaygroup = usergroup_displaygroup($mybb->user['displaygroup']);
if(is_array($mydisplaygroup))
{
$mybb->usergroup = array_merge($mybb->usergroup, $mydisplaygroup);
}

		$mydisplaygroup = usergroup_displaygroup($mybb->user['displaygroup']);
if(is_array($mydisplaygroup))
{
$mybb->usergroup = array_merge($mybb->usergroup, $mydisplaygroup);
}


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


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

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

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

		}

		}

		else
{
// Is a spider - delete all other spider references

		else
{
// Is a spider - delete all other spider references

Zeile 565Zeile 572
	 */
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[1] = $mybb->get_input('fid', MyBB::INPUT_INT);

		$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[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)
{
$array[2] = $mybb->get_input('tid', MyBB::INPUT_INT);

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

Zeile 583Zeile 587

// If there is no tid but a pid, trick the system into thinking there was a tid anyway.
elseif(isset($mybb->input['pid']) && !empty($mybb->input['pid']))


// If there is no tid but a pid, trick the system into thinking there was a tid anyway.
elseif(isset($mybb->input['pid']) && !empty($mybb->input['pid']))

			{

			{

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

				$options = array(
"limit" => 1
);
$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;
}