/** * Is the user on a shared page? * @return boolean */ public static function isOnSharedPage() { return SharedLinker::isOnSharedPage(); }
/** * Get the HFrest from user-table * @return int HFrest */ private static function calculateHFrest() { // TODO: Move to class::UserData - possible problem in loading order? if (SharedLinker::isOnSharedPage()) { $userdata = DB::getInstance()->query('SELECT `pulse_rest` FROM `' . PREFIX . 'user` WHERE `accountid`="' . SharedLinker::getUserId() . '" AND `pulse_rest` > 0 AND accountid = ' . SessionAccountHandler::getId() . ' ORDER BY `time` DESC LIMIT 1')->fetch(); } else { $userdata = DB::getInstance()->query('SELECT `pulse_rest` FROM `' . PREFIX . 'user` WHERE `pulse_rest` > 0 AND accountid = ' . SessionAccountHandler::getId() . ' ORDER BY `time` DESC LIMIT 1')->fetch(); } if ($userdata === false) { return 60; } return $userdata['pulse_rest']; }
/** * Get ID of current user * @return int */ public static function getId() { // Dirty hack for 'global.cleanup.php' if (defined('GLOBAL_CLEANUP') && class_exists('GlobalCleanupAccount')) { return GlobalCleanupAccount::$ID; } if (SharedLinker::isOnSharedPage()) { return SharedLinker::getUserId(); } if (!isset(self::$Account['id'])) { if (isset($_SESSION['accountid'])) { return $_SESSION['accountid']; } return null; } return self::$Account['id']; }