Exemple #1
0
 /**
  * @return RequestValidator
  */
 public static function createUserFormValidator(StoreManagementController $controller, $user = false)
 {
     $inst = new UserController(ActiveRecordModel::getApplication());
     $validator = $inst->getValidator("UserForm", $controller->getRequest());
     $validator->addCheck('email', new IsNotEmptyCheck($controller->translate('_err_email_empty')));
     $validator->addCheck('email', new IsValidEmailCheck($controller->translate('_err_invalid_email')));
     $validator->addCheck('firstName', new IsNotEmptyCheck($controller->translate('_err_first_name_empty')));
     $validator->addCheck('lastName', new IsNotEmptyCheck($controller->translate('_err_last_name_empty')));
     $passwordLengthStart = 6;
     $passwordLengthEnd = 30;
     $allowEmpty = $user;
     $validator->addCheck('password', new IsLengthBetweenCheck(sprintf($controller->translate('_err_password_lenght_should_be_in_interval'), $passwordLengthStart, $passwordLengthEnd), $passwordLengthStart, $passwordLengthEnd, $allowEmpty));
     $validator->addCheck('userGroupID', new IsNumericCheck($controller->translate('_err_invalid_group')));
     if (!$user) {
         $user = ActiveRecordModel::getNewInstance('User');
     }
     return $validator;
 }
Exemple #2
0
 public function init()
 {
     parent::init();
     CustomerOrder::allowEmpty();
 }
Exemple #3
0
 public function init()
 {
     $this->loadLanguageFile('backend/Category');
     $this->loadLanguageFile('backend/CustomField');
     return parent::init();
 }
Exemple #4
0
 public function init()
 {
     parent::init();
     $this->application->setTheme('');
 }
 public function init()
 {
     $this->initRepos();
     parent::init();
 }