Zeile 57 | Zeile 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 66 | Zeile 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($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 83 | Zeile 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 123 | Zeile 126 |
---|
/** * Load a user via the user credentials.
|
/** * Load a user via the user credentials.
|
*
| *
|
* @param int $uid The user id. * @param string $loginkey The user's loginkey. * @return bool
| * @param int $uid The user id. * @param string $loginkey The user's loginkey. * @return bool
|
Zeile 143 | Zeile 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 165 | Zeile 168 |
---|
if($mybb->user['unreadpms'] == -1) { $update += 2;
|
if($mybb->user['unreadpms'] == -1) { $update += 2;
|
}
| }
|
require_once MYBB_ROOT."inc/functions_user.php"; $pmcount = update_pm_count('', $update);
| require_once MYBB_ROOT."inc/functions_user.php"; $pmcount = update_pm_count('', $update);
|
Zeile 173 | Zeile 176 |
---|
{ $mybb->user = array_merge($mybb->user, $pmcount); }
|
{ $mybb->user = array_merge($mybb->user, $pmcount); }
|
}
| }
|
$mybb->user['pms_total'] = $mybb->user['totalpms']; $mybb->user['pms_unread'] = $mybb->user['unreadpms'];
| $mybb->user['pms_total'] = $mybb->user['totalpms']; $mybb->user['pms_unread'] = $mybb->user['unreadpms'];
|
Zeile 189 | Zeile 192 |
---|
// If the last visit was over 900 seconds (session time out) ago then update lastvisit. $time = TIME_NOW; if($time - $mybb->user['lastactive'] > 900)
|
// If the last visit was over 900 seconds (session time out) ago then update lastvisit. $time = TIME_NOW; if($time - $mybb->user['lastactive'] > 900)
|
{
| {
|
$db->shutdown_query("UPDATE ".TABLE_PREFIX."users SET lastvisit='{$mybb->user['lastactive']}', lastactive='$time'{$lastip_add} WHERE uid='{$mybb->user['uid']}'"); $mybb->user['lastvisit'] = $mybb->user['lastactive']; require_once MYBB_ROOT."inc/functions_user.php";
| $db->shutdown_query("UPDATE ".TABLE_PREFIX."users SET lastvisit='{$mybb->user['lastactive']}', lastactive='$time'{$lastip_add} WHERE uid='{$mybb->user['uid']}'"); $mybb->user['lastvisit'] = $mybb->user['lastactive']; require_once MYBB_ROOT."inc/functions_user.php";
|
Zeile 209 | Zeile 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 219 | Zeile 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']]; }
|
}
| }
|
// Find out the threads per page preference. if($mybb->user['tpp']) {
| // Find out the threads per page preference. if($mybb->user['tpp']) {
|
Zeile 248 | Zeile 251 |
---|
}
$usergroups = $cache->read('usergroups');
|
}
$usergroups = $cache->read('usergroups');
|
|
|
if(!empty($usergroups[$mybb->user['usergroup']]) && $usergroups[$mybb->user['usergroup']]['isbannedgroup'] == 1) { $ban = $db->fetch_array(
| if(!empty($usergroups[$mybb->user['usergroup']]) && $usergroups[$mybb->user['usergroup']]['isbannedgroup'] == 1) { $ban = $db->fetch_array(
|
Zeile 256 | Zeile 259 |
---|
);
if($ban)
|
);
if($ban)
|
{
| {
|
$mybb->user['banned'] = 1; $mybb->user['bandate'] = $ban['dateline']; $mybb->user['banlifted'] = $ban['lifted'];
| $mybb->user['banned'] = 1; $mybb->user['bandate'] = $ban['dateline']; $mybb->user['banlifted'] = $ban['lifted'];
|
Zeile 264 | Zeile 267 |
---|
$mybb->user['banolddisplaygroup'] = $ban['olddisplaygroup']; $mybb->user['banoldadditionalgroups'] = $ban['oldadditionalgroups']; $mybb->user['banreason'] = $ban['reason'];
|
$mybb->user['banolddisplaygroup'] = $ban['olddisplaygroup']; $mybb->user['banoldadditionalgroups'] = $ban['oldadditionalgroups']; $mybb->user['banreason'] = $ban['reason'];
|
}
| }
|
else { $mybb->user['banned'] = 0;
| else { $mybb->user['banned'] = 0;
|
Zeile 304 | Zeile 307 |
---|
$mybb->usergroup = usergroup_permissions($mybbgroups); if(!$mybb->user['displaygroup'])
|
$mybb->usergroup = usergroup_permissions($mybbgroups); if(!$mybb->user['displaygroup'])
|
{
| {
|
$mybb->user['displaygroup'] = $mybb->user['usergroup']; }
| $mybb->user['displaygroup'] = $mybb->user['usergroup']; }
|
Zeile 312 | Zeile 315 |
---|
if(is_array($mydisplaygroup)) { $mybb->usergroup = array_merge($mybb->usergroup, $mydisplaygroup);
|
if(is_array($mydisplaygroup)) { $mybb->usergroup = array_merge($mybb->usergroup, $mydisplaygroup);
|
}
| }
|
if(!$mybb->user['usertitle']) { $mybb->user['usertitle'] = $mybb->usergroup['usertitle']; }
// Update or create the session.
|
if(!$mybb->user['usertitle']) { $mybb->user['usertitle'] = $mybb->usergroup['usertitle']; }
// Update or create the session.
|
if(!defined("NO_ONLINE") && !defined('IN_UPGRADE'))
| if(!defined("NO_ONLINE") && !defined('IN_UPGRADE'))
|
{ if(!empty($this->sid)) {
| { if(!empty($this->sid)) {
|
Zeile 350 | Zeile 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 433 | Zeile 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'])) { $mybb->settings['bblanguage'] = $spider['language'];
|
// Set spider language if($spider['language'] && $lang->language_exists($spider['language'])) { $mybb->settings['bblanguage'] = $spider['language'];
|
}
| }
|
// Set spider theme if($spider['theme']) {
| // Set spider theme if($spider['theme']) {
|
Zeile 450 | Zeile 460 |
---|
$mybb->usergroup = usergroup_permissions($mybb->user['usergroup']); $mydisplaygroup = usergroup_displaygroup($mybb->user['displaygroup']); if(is_array($mydisplaygroup))
|
$mybb->usergroup = usergroup_permissions($mybb->user['usergroup']); $mydisplaygroup = usergroup_displaygroup($mybb->user['displaygroup']); if(is_array($mydisplaygroup))
|
{
| {
|
$mybb->usergroup = array_merge($mybb->usergroup, $mydisplaygroup); }
// Update spider last minute (only do so on two minute intervals - decrease load for quick spiders) if($spider['lastvisit'] < TIME_NOW-120)
|
$mybb->usergroup = array_merge($mybb->usergroup, $mydisplaygroup); }
// Update spider last minute (only do so on two minute intervals - decrease load for quick spiders) if($spider['lastvisit'] < TIME_NOW-120)
|
{
| {
|
$updated_spider = array( "lastvisit" => TIME_NOW ); $db->update_query("spiders", $updated_spider, "sid='{$spider_id}'");
|
$updated_spider = array( "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 496 | Zeile 506 |
---|
$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;
|
Zeile 520 | Zeile 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; }
|
Zeile 545 | Zeile 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;
|
Zeile 561 | Zeile 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 585 | Zeile 593 |
---|
); $query = $db->simple_select("posts", "tid", "pid=".$mybb->get_input('pid', MyBB::INPUT_INT), $options); $post = $db->fetch_array($query);
|
); $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; }
|