Esempio n. 1
0
 public function execute()
 {
     if (false === ($this->user = GWF_Session::getUser())) {
         return GWF_HTML::err('ERR_LOGIN_REQUIRED');
     }
     if (false === ($this->site = WC_Site::getByID_Class(Common::getGetString('siteid')))) {
         return $this->module->error('err_site');
     }
     if (!GWF_User::isInGroupS(GWF_Group::STAFF)) {
         $this->module->includeClass('WC_SiteAdmin');
         if (!$this->site->isSiteAdmin($this->user)) {
             return GWF_HTML::err('ERR_NO_PERMISSION');
         }
     }
     $this->module->includeClass('WC_Warbox');
     # ADD
     if (isset($_POST['add'])) {
         return $this->onAdd();
         #.$this->templateOverview();
     }
     if (isset($_GET['add'])) {
         return $this->templateAdd();
     }
     # EDIT
     if (false !== ($boxid = Common::getGetString('edit', false))) {
         if (false === ($box = WC_Warbox::getByIDs($boxid, $this->site->getID()))) {
             return $this->module->error('err_site');
         }
     }
     if (isset($_POST['flags'])) {
         GWF_Website::redirect($this->module->getMethodURL('Warflags', '&wbid=' . $boxid));
     }
     if (isset($_POST['edit'])) {
         return $this->onEdit($box);
     }
     if (isset($_GET['edit'])) {
         return $this->templateEdit($box);
     }
     # OVERVIEW
     return $this->templateOverview();
 }