protected function handleRequest()
 {
     $this->errorMessageContainer = $this->form->getValidationResults();
     if (!$this->errorMessageContainer->isAnyErrorMessage()) {
         if ($this->record['id']) {
             $this->record['userPasswordChangeCode'] = null;
             $this->record['userPassword'] = $this->form->getField('userPassword')->getValue();
             $this->dao->save($this->record);
             CoreServices2::getAccess()->login($this->record['userEmail'], $this->record['userPassword']);
             $this->redirectAddress = CoreServices2::getUrl()->getCurrentPageUrl('_sm', 'Save', 'id', $this->record['id']);
         }
     }
 }
コード例 #2
0
 protected function checkBasicValidation()
 {
     $fileCategory = $this->form->getField('fileCategory')->getValue();
     $this->form->addValidator(new CoreFormValidatorFileBasicCheck('_fileUpload', null, $fileCategory));
     $this->form->addValidator(new CoreFormValidatorNotEmptyFieldset(array('id', '_tmpId')));
     $this->form->addValidator(new CoreFormValidatorFieldsetXOr(array('id', '_tmpId')));
     $this->messageManager = $this->form->getValidationResults();
 }
 protected function handleLoginForm()
 {
     if (!empty($this->currentUser['id'])) {
         if (CoreServices2::getRequest()->getFromGet('logout') == 1) {
             CoreServices2::getAccess()->logout();
             $this->redirectToHomePage();
         }
     } else {
         $currentPage = CoreServices2::getUrl()->getCurrentExactAddress();
         $this->loginForm = new CoreForm('post', CoreServices2::getUrl()->getCurrentExactAddress(), 'loginForm');
         $this->createLoginFormFields();
         if ($this->loginForm->isSubmitted()) {
             //$this->addLoginFormValidators();
             CoreServices2::getAccess()->logout();
             $this->loginForm->setFieldValuesFromRequest();
             $this->loginErrorMessageContainer = $this->loginForm->getValidationResults();
             if (!$this->loginErrorMessageContainer->isAnyErrorMessage()) {
                 $this->loginAndReload();
             }
         }
     }
 }
コード例 #4
0
 public function getValidationResults()
 {
     $messageManager = parent::getValidationResults();
     foreach ($this->vlfs as $vlfName => $vlf) {
         $rowCount = $vlf->getRowCount();
         $validatorTemplates = $this->vlfValidators[$vlfName];
         if ($rowCount && !empty($validatorTemplates)) {
             for ($i = 0; $i < $rowCount; $i++) {
                 if (!$vlf->getActualField($i, '_inactive')->getValue()) {
                     foreach ($validatorTemplates as $validatorTemplate) {
                         $actualValidator = clone $validatorTemplate;
                         $actualValidator->modifyFieldNamesForVLF($vlfName, $i);
                         $actualValidator->validate($messageManager);
                     }
                 }
             }
         }
     }
     return $messageManager;
 }
コード例 #5
0
 protected function getValidationResults()
 {
     $this->errorMessageContainer = $this->form->getValidationResults();
 }