Vergleich inc/class_session.php - 1.8.27 - 1.8.34

  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 72Zeile 75
				if(!empty($session) && $session['sid'])
{
$this->sid = $session['sid'];

				if(!empty($session) && $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);
}


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

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

		}


		}


		// If no user still, then we have a guest.
if(!isset($mybb->user['uid']))
{

		// If no user still, then we have a guest.
if(!isset($mybb->user['uid']))
{

Zeile 116Zeile 119

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


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

		{

		{

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

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

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['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 359Zeile 366
			{
$mybb->user['lastactive'] = $time;
$mybb->cookies['mybb']['lastactive'] = $mybb->user['lastactive'];

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

			}

			}

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

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

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

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

			}
}

			}
}


// No last visit cookie, create one.
else
{
my_setcookie("mybb[lastvisit]", $time);
$mybb->user['lastvisit'] = $time;


// No last visit cookie, create one.
else
{
my_setcookie("mybb[lastvisit]", $time);
$mybb->user['lastvisit'] = $time;

		}

		}


// Update last active cookie.
my_setcookie("mybb[lastactive]", $time);


// Update last active cookie.
my_setcookie("mybb[lastactive]", $time);

Zeile 409Zeile 416

/**
* Load a search engine spider.


/**
* Load a search engine spider.

	 *

	 *

	 * @param int $spider_id The ID of the search engine spider
*/
function load_spider($spider_id)
{
global $mybb, $time, $db, $lang;

	 * @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
$query = $db->simple_select("spiders", "*", "sid='{$spider_id}'");
$spider = $db->fetch_array($query);

		// Fetch the spider preferences from the database
$query = $db->simple_select("spiders", "*", "sid='{$spider_id}'");
$spider = $db->fetch_array($query);

Zeile 424Zeile 431
		$time = TIME_NOW;
$this->is_spider = true;
if($spider['usergroup'])

		$time = TIME_NOW;
$this->is_spider = true;
if($spider['usergroup'])

		{

		{

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

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

Zeile 434Zeile 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 521Zeile 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;
}