Exemplo n.º 1
0
 public function addValidationError(\Nethgui\Module\ModuleInterface $module, $parameterName, \Nethgui\System\ValidatorInterface $validator)
 {
     $failureInfoList = $validator->getFailureInfo();
     if (empty($failureInfoList)) {
         throw new \LogicException(sprintf('%s: the validator does not have any failure information', __CLASS__), 1403709455);
     }
     foreach ($failureInfoList as $failureInfo) {
         if (!isset($failureInfo[1])) {
             throw new \LogicException(sprintf('%s: invalid failure info struct', __CLASS__), 1403709456);
         }
         $this->addValidationErrorMessage($module, $parameterName, $failureInfo[0], $failureInfo[1]);
     }
     return $this;
 }
Exemplo n.º 2
0
 public function authenticate()
 {
     $args = func_get_args();
     $args[] =& $this->state['credentials'];
     $this->state['authenticated'] = $this->authenticationValidator->evaluate($args);
     $this->modified = TRUE;
     if ($this->state['authenticated'] === TRUE) {
         $this->log->notice(sprintf("%s: user `%s` authenticated", __CLASS__, $args[0]));
     }
     return $this->state['authenticated'];
 }
Exemplo n.º 3
0
 public function isMandatory()
 {
     $m1 = $this->v1 instanceof MandatoryValidatorInterface ? $this->v1->isMandatory() : TRUE;
     $m2 = $this->v2 instanceof MandatoryValidatorInterface ? $this->v2->isMandatory() : TRUE;
     return $m1 && $m2;
 }