Beispiel #1
0
 public function onAnswer(WC_Warflag $flag, $password)
 {
     if (false === ($this->user = GWF_Session::getUser())) {
         return GWF_HTML::err('ERR_LOGIN_REQUIRED');
     }
     if (false === ($this->box = $flag->getWarbox())) {
         return $this->module->error('err_warbox');
     }
     if (false === ($this->site = $this->box->getSite())) {
         return $this->module->error('err_site');
     }
     if (!$flag->isWarflag()) {
         return GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__));
     }
     if (false !== ($error = $this->checkBrute($flag))) {
         return $error;
     }
     $password = WC_Warflag::hashPassword($password);
     if ($password !== $flag->getVar('wf_flag_enc')) {
         return $this->onFailed($flag);
     } else {
         return $this->onSolved($flag);
     }
 }