public function prepare() { $this->template = "usercp"; $this->title = "User control panel"; $admin = IsUserAdmin(); if ($admin) { global $db; if ($this->request[0] == 'update_schema') { require_once 'classes/backpack.php'; backpack::update_schema(); $this->params['success'] = 'Schema updated! Have a nice day <3'; } else { if ($this->request[0] == 'purge_cache') { require_once 'classes/cache.php'; cache::clean(); $this->params['success'] = 'Memcached cache purged! Have a nice day <3'; } } /*else if($this->request[0] == 'valve_maps') { global $list; $maps = explode("\n",$list); foreach($maps as $map) { list($m, $ext) = explode(".",trim($map)); //echo $m; $db->query("UPDATE tf2_maps SET official=1 where name=%s",array($m)); } $this->params['success'] = 'Maps valveified!'; }*/ } $this->params['admin'] = $admin; }