Vergleich inc/class_session.php - 1.2.8 - 1.2.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html
*

 * $Id: class_session.php 3124 2007-06-06 04:56:26Z chris $

 * $Id: class_session.php 3574 2007-12-20 03:14:31Z Tikitiki $

 */

class session

 */

class session

Zeile 63Zeile 63
		}

// Attempt to load the session from the database.

		}

// Attempt to load the session from the database.

		$query = $db->simple_select(TABLE_PREFIX."sessions", "*", "sid='".$this->sid."' AND ip='".$db->escape_string($this->ipaddress)."'", 1);

		$query = $db->simple_select(TABLE_PREFIX."sessions", "*", "sid='".$this->sid."' AND ip='".$db->escape_string($this->ipaddress)."'", array('limit' => 1));

		$session = $db->fetch_array($query);
if($session['sid'])
{

		$session = $db->fetch_array($query);
if($session['sid'])
{

Zeile 128Zeile 128
			LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid) 
LEFT JOIN ".TABLE_PREFIX."banned b ON (b.uid=u.uid)
WHERE u.uid='$uid'

			LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid) 
LEFT JOIN ".TABLE_PREFIX."banned b ON (b.uid=u.uid)
WHERE u.uid='$uid'

 
			LIMIT 1

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


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


Zeile 139Zeile 140
			return false;
}
$this->uid = $mybb->user['uid'];

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

 

// Set the logout key for this user
$mybb->user['logoutkey'] = md5($mybb->user['loginkey']);


// Sort out the private message count for this user.
if(($mybb->user['totalpms'] == -1 || $mybb->user['unreadpms'] == -1 || $mybb->user['newpms'] == -1) && $mybb->settings['enablepms'] != "no") // Forced recount


// Sort out the private message count for this user.
if(($mybb->user['totalpms'] == -1 || $mybb->user['unreadpms'] == -1 || $mybb->user['newpms'] == -1) && $mybb->settings['enablepms'] != "no") // Forced recount

Zeile 184Zeile 188
		$time = time();
if($time - $mybb->user['lastactive'] > 900)
{

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

			$db->shutdown_query("UPDATE ".TABLE_PREFIX."users SET lastvisit='".$mybb->user['lastactive']."', lastactive='$time' $popupadd WHERE uid='".$mybb->user['uid']."'");

			$db->shutdown_query("UPDATE ".TABLE_PREFIX."users SET lastvisit='".$mybb->user['lastactive']."', lastactive='$time' $popupadd WHERE uid='".$mybb->user['uid']."' LIMIT 1");

			$mybb->user['lastvisit'] = $mybb->user['lastactive'];
require_once MYBB_ROOT."inc/functions_user.php";
update_pm_count('', 2);

			$mybb->user['lastvisit'] = $mybb->user['lastactive'];
require_once MYBB_ROOT."inc/functions_user.php";
update_pm_count('', 2);

Zeile 192Zeile 196
		else
{
$timespent = time() - $mybb->user['lastactive'];

		else
{
$timespent = time() - $mybb->user['lastactive'];

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

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

		}

// Sort out the language and forum preferences.

		}

// Sort out the language and forum preferences.

Zeile 279Zeile 283
		if(!empty($mybb->user['bandate']) && (isset($mybb->user['banlifted']) && !empty($mybb->user['banlifted'])) && $mybb->user['banlifted'] < $time)  // hmmm...bad user... how did you get banned =/
{
// must have been good.. bans up :D

		if(!empty($mybb->user['bandate']) && (isset($mybb->user['banlifted']) && !empty($mybb->user['banlifted'])) && $mybb->user['banlifted'] < $time)  // hmmm...bad user... how did you get banned =/
{
// must have been good.. bans up :D

			$db->shutdown_query("UPDATE ".TABLE_PREFIX."users SET usergroup='".$mybb->user['banoldgroup']."' WHERE uid='".$mybb->user['uid']."'");

			$db->shutdown_query("UPDATE ".TABLE_PREFIX."users SET usergroup='".$mybb->user['banoldgroup']."' WHERE uid='".$mybb->user['uid']."' LIMIT 1");

			$db->shutdown_query("DELETE FROM ".TABLE_PREFIX."banned WHERE uid='".$mybb->user['uid']."'");
// we better do this..otherwise they have dodgy permissions
$mybb->user['usergroup'] = $mybb->user['banoldgroup'];

			$db->shutdown_query("DELETE FROM ".TABLE_PREFIX."banned WHERE uid='".$mybb->user['uid']."'");
// we better do this..otherwise they have dodgy permissions
$mybb->user['usergroup'] = $mybb->user['banoldgroup'];

Zeile 322Zeile 326
		// Update or create the session.
if(!defined("NO_ONLINE"))
{

		// Update or create the session.
if(!defined("NO_ONLINE"))
{

			if($this->sid > 0)

			if(!empty($this->sid))

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

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

Zeile 391Zeile 395
		// Update the online data.
if(!defined("NO_ONLINE"))
{

		// Update the online data.
if(!defined("NO_ONLINE"))
{

			if($this->sid > 0)

			if(!empty($this->sid))

			{
$this->update_session($this->sid);
}

			{
$this->update_session($this->sid);
}

Zeile 465Zeile 469
		$onlinedata['nopermission'] = 0;
$sid = $db->escape_string($sid);


		$onlinedata['nopermission'] = 0;
$sid = $db->escape_string($sid);


		$db->update_query(TABLE_PREFIX."sessions", $onlinedata, "sid='".$sid."'");

		$db->update_query(TABLE_PREFIX."sessions", $onlinedata, "sid='".$sid."'", 1);

	}

/**

	}

/**

Zeile 481Zeile 485
		// If there is a proper uid, delete by uid.
if($uid > 0)
{

		// If there is a proper uid, delete by uid.
if($uid > 0)
{

			$db->delete_query(TABLE_PREFIX."sessions", "uid=".$uid);

			$db->delete_query(TABLE_PREFIX."sessions", "uid='{$uid}'", 1);

			$onlinedata['uid'] = $uid;
}
// Else delete by ip.
else
{

			$onlinedata['uid'] = $uid;
}
// Else delete by ip.
else
{

			$db->delete_query(TABLE_PREFIX."sessions", "ip='".$db->escape_string($this->ipaddress)."'");

			$db->delete_query(TABLE_PREFIX."sessions", "ip='".$db->escape_string($this->ipaddress)."'", 1);

			$onlinedata['uid'] = 0;
}


			$onlinedata['uid'] = 0;
}