/** * Reads the detectors to start from the database */ protected function getDetectors() { $sql = "SELECT *\n\t\t\t\tFROM ugml_bot_detector\n\t\t\t\tWHERE executionProbability > " . rand(0, 99) . "\n\t\t\t\t\tAND '" . $_SERVER['PHP_SELF'] . LWUtil::getArgsStr() . "' REGEXP locationPattern\n\t\t\t\tORDER BY executionPriority DESC"; $result = WCF::getDB()->sendQuery($sql); while ($row = WCF::getDB()->fetchArray($result)) { $this->detectors[$row['detectorID']] = $row; } }
/** * Checks if the user requests a planet change. */ protected function checkPlanetChange() { if (!(isset($_GET['cp']) || isset($_POST['cp'])) || !(isset($_REQUEST['page']) || isset($_REQUEST['form']) || isset($_REQUEST['action']))) { return; } $planetID = isset($_GET['cp']) ? intval(@$_GET['cp']) : intval(@$_POST['cp']); $planets = Planet::getByUserID($this->userID); if (isset($planets[$planetID])) { $this->changePlanet($planetID, $planets[$planetID]->className); // now create new request without planet change (forwarding) unset($_REQUEST['cp']); if (isset($_REQUEST['re'])) { unset($_REQUEST['re']); } $location = LWUtil::getFileName() . '.php' . LWUtil::getArgsStr(); WCF::getDB()->deleteShutdownUpdates(); header('Location: ' . $location); exit; } }
/** * @see WCF::assignDefaultTemplateVariables() */ protected function assignDefaultTemplateVariables() { parent::assignDefaultTemplateVariables(); $dpath = !self::getUser()->dpath ? DEFAULT_SKINPATH : self::getUser()->dpath; if (!defined('DPATH')) { define('DPATH', $dpath); } self::getTPL()->assign(array('dpath' => $dpath, 'planets' => Planet::getByUserID(WCF::getUser()->userID, null, true), 'site' => LWUtil::getFileName(), 'args' => LWUtil::getArgsStr())); }