/** * 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())); }