Example #1
0
 public function execute()
 {
     $this->module->includeClass('WC_Warbox');
     $this->module->includeClass('WC_Warflag');
     $this->module->includeClass('WC_Warflags');
     $this->module->includeClass('sites/warbox/WCSite_WARBOX');
     if (false === ($this->box = WC_Warbox::getByID(Common::getGetString('boxid')))) {
         return $this->module->error('err_warbox');
     }
     if (false === ($this->site = $this->box->getSite())) {
         return $this->module->error('err_site');
     }
     if (false === ($this->user = GWF_Session::getUser())) {
         return GWF_HTML::err('ERR_LOGIN_REQUIRED');
     }
     if (false === ($this->flags = WC_Warflag::getForBoxAndUser($this->box, $this->user, 'wf_order ASC'))) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     if (count($this->flags) === 0) {
         return GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__));
     }
     if (isset($_POST['password'])) {
         return $this->onSolve();
     }
     return $this->templateOverview();
 }
Example #2
0
 public function execute()
 {
     $this->module->includeClass('WC_Warbox');
     $this->module->includeClass('WC_Warflag');
     $this->module->includeClass('WC_Warflags');
     $this->module->includeClass('sites/warbox/WCSite_WARBOX');
     if (isset($_POST['wc_boxes_quickjump'])) {
         $_GET['boxid'] = Common::getPostString('wc_boxes_quickjump');
     }
     if (false === ($this->box = WC_Warbox::getByID(Common::getGetString('boxid')))) {
         return $this->module->error('err_warbox');
     }
     return $this->templatePlayers();
 }
Example #3
0
 public function execute()
 {
     if (false === ($this->user = GWF_Session::getUser())) {
         return GWF_HTML::err('ERR_LOGIN_REQUIRED');
     }
     $this->module->includeClass('WC_Warbox');
     $this->module->includeClass('WC_Warflag');
     $this->module->includeClass('WC_SiteAdmin');
     $this->module->includeClass('WC_SiteCats');
     $this->module->includeClass('sites/warbox/WCSite_WARBOX');
     if (false === ($this->warbox = WC_Warbox::getByID(Common::getGetString('wbid')))) {
         return WC_HTML::error('err_warbox');
     }
     if (!$this->warbox->hasEditPermission($this->user)) {
         return GWF_HTML::err('ERR_NO_PERMISSION');
     }
     if (isset($_GET['edit'])) {
         if (false === ($this->flag = WC_Warflag::getByID(Common::getGetString('edit')))) {
             return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
         }
         if (isset($_POST['edit'])) {
             return $this->onEdit();
         } else {
             return $this->templateEdit();
         }
     }
     if (isset($_POST['add'])) {
         return $this->onAdd();
     }
     if (isset($_GET['add'])) {
         return $this->templateAdd();
     }
     if (isset($_POST['import'])) {
         return $this->onCSVImport();
     }
     if (isset($_GET['export'])) {
         return $this->onCSVExport();
     }
     if (isset($_GET['up'])) {
         return $this->onUp() . $this->templateOverview();
     } elseif (isset($_GET['down'])) {
         return $this->onDown() . $this->templateOverview();
     }
     return $this->templateOverview();
 }
Example #4
0
 public function execute()
 {
     if (isset($_POST['wc_boxes_quickjump'])) {
         $_GET['boxid'] = Common::getPostString('wc_boxes_quickjump');
     }
     $this->module->includeClass('WC_Warbox');
     $this->module->includeClass('WC_Warflag');
     $this->module->includeClass('WC_Warflags');
     $this->module->includeClass('WC_SiteDescr');
     $this->module->includeClass('sites/warbox/WCSite_WARBOX');
     if (false === ($this->box = WC_Warbox::getByID(Common::getGetString('boxid')))) {
         return $this->module->error('err_warboxa', array($_GET['boxid']));
     }
     if ('' !== ($answer = Common::getPostString('password_solution', ''))) {
         return $this->onSolve($answer) . $this->templateLevels();
     }
     return $this->templateLevels();
 }