/**
  * Initialize this validator.
  *
  * @param sfContext The current application context.
  * @param array   An associative array of initialization parameters.
  *
  * @return bool true, if initialization completes successfully, otherwise false.
  */
 public function initialize($context, $parameters = null)
 {
     // initialize parent
     parent::initialize($context);
     $this->getParameterHolder()->add($parameters);
     return true;
 }
 public function initialize($context, $parameters = null)
 {
     parent::initialize($context);
     $this->setParameter('msg', 'You\'ve already registered your blog.');
     $this->getParameterHolder()->add($parameters);
     return true;
 }
示例#3
0
 public function initialize($context, $parameters = null)
 {
     parent::initialize($context);
     $this->setParameter('slug_error', 'Slug already exists');
     $this->getParameterHolder()->add($parameters);
     return true;
 }
 public function initialize($context, $parameters = null)
 {
     parent::initialize($context);
     $this->setParameter('login_error', 'Invalid input');
     $this->getParameterHolder()->add($parameters);
     return true;
 }
 public function initialize($context, $parameters = null)
 {
     parent::initialize($context);
     $this->setParameter('password_error', 'Incorrect password');
     $this->getParameterHolder()->add($parameters);
     return true;
 }
示例#6
0
 public function initialize($context, $parameters = null)
 {
     parent::initialize($context);
     $this->setParameter('date_error', 'Error comparing start and end dates');
     $this->getParameterHolder()->add($parameters);
     return true;
 }
 public function initialize($context, $parameters = null)
 {
     // initialize parent
     parent::initialize($context);
     $this->getParameterHolder()->set('code_error', 'wrong code');
     $this->getParameterHolder()->add($parameters);
     return true;
 }
 public function initialize($context, $parameters = null)
 {
     // initialize parent
     parent::initialize($context);
     // set defaults
     $this->setParameter('no_organizations_error', 'You must have at least 2 organizations.');
     $this->getParameterHolder()->add($parameters);
     return true;
 }
 function initialize($context, $parameters = null)
 {
     // initialize parent
     parent::initialize($context);
     // set defaults
     $this->getParameterHolder()->set('cuit_error', 'CUIT Invalido');
     $this->getParameterHolder()->add($parameters);
     return true;
 }
示例#10
0
 public function initialize($context, $parameters = null)
 {
     parent::initialize($context);
     $this->setParameter('password', 'password');
     $this->setParameter('login_error', 'Login error');
     $this->setParameter('unknown_error', 'Unknown error');
     $this->getParameterHolder()->add($parameters);
     return true;
 }
 public function initialize($context, $parameters = null)
 {
     // initialize parent
     parent::initialize($context);
     // set defaults
     $this->getParameterHolder()->set('compare_error', 'Invalid input');
     $this->getParameterHolder()->add($parameters);
     return true;
 }
 public function initialize($context, $parameters = null)
 {
     // Initialize parent
     parent::initialize($context);
     $this->setParameter('nickname_unique_error', 'This nickname already exists. Please choose another one.');
     // Set parameters
     $this->getParameterHolder()->add($parameters);
     return true;
 }
 /**
  * Initialize this validator.
  *
  * @param sfContext The current application context.
  * @param array   An associative array of initialization parameters.
  *
  * @return bool true, if initialization completes successfully, otherwise false.
  */
 public function initialize($context, $parameters = null)
 {
     // initialize parent
     parent::initialize($context);
     // set defaults
     $this->setParameter('unique_error', 'Uniqueness error');
     $this->getParameterHolder()->add($parameters);
     return true;
 }
 public function initialize($context, $parameters = null)
 {
     // initialize parent
     parent::initialize($context);
     // set defaults
     $this->getParameterHolder()->set('expect', self::VALID);
     $this->getParameterHolder()->set('error_msg', "address seems to have an error");
     $this->getParameterHolder()->add($parameters);
     return true;
 }
 public function initialize($context, $parameters = null)
 {
     parent::initialize($context);
     // Set defaults
     $this->getParameterHolder()->set('username_error', 'Username or password is not valid.');
     $this->getParameterHolder()->set('password_field', 'password');
     $this->getParameterHolder()->set('remember_field', 'remember');
     $this->getParameterHolder()->set('activation', 'You cannot log in until you have activated your user, you should have received an email with a activation link.');
     $this->getParameterHolder()->add($parameters);
     return true;
 }
 public function initialize($context, $parameters = null)
 {
     // initialize parent
     parent::initialize($context);
     // set defaults
     $this->getParameterHolder()->set('twitter_error', 'Twitter username or password is not valid.');
     $this->getParameterHolder()->set('password_field', 'twitter_password');
     $this->getParameterHolder()->set('update_field', 'twitter_update');
     $this->getParameterHolder()->add($parameters);
     return true;
 }
示例#17
0
 public function initialize($context, $parameters = null)
 {
     parent::initialize($context);
     $this->setParameter('password', 'password');
     $this->setParameter('login_error', 'Invalid input');
     $this->setParameter('password_error', 'Invalid input');
     $this->setParameter('inactive_error', 'Your forum account is inactive.');
     $this->setParameter('unknown_error', 'Unknown  error');
     $this->getParameterHolder()->add($parameters);
     return true;
 }
示例#18
0
 /**
  * Initializes this validator.
  *
  * @param sfContext The current application context
  * @param array   An associative array of initialization parameters
  *
  * @return bool true, if initialization completes successfully, otherwise false
  */
 public function initialize($context, $parameters = null)
 {
     // initialize parent
     parent::initialize($context);
     // set defaults
     $this->getParameterHolder()->set('strict', true);
     $this->getParameterHolder()->set('check_domain', false);
     $this->getParameterHolder()->set('email_error', 'Invalid input');
     $this->getParameterHolder()->add($parameters);
     return true;
 }
 public function initialize($context, $parameters = null)
 {
     // initialize parent
     parent::initialize($context);
     // set defaults
     $this->getParameterHolder()->set('username_error', null);
     $this->getParameterHolder()->set('password_field', 'password');
     $this->getParameterHolder()->set('remember_field', 'remember');
     $this->getParameterHolder()->add($parameters);
     return true;
 }
 function initialize($context, $parameters = null)
 {
     // initialize parent
     parent::initialize($context);
     // set defaults
     $this->getParameterHolder()->set('documento_error', 'Documento Invalido');
     $this->getParameterHolder()->set('nombre_campo1', null);
     $this->getParameterHolder()->set('nombre_campo2', null);
     $this->getParameterHolder()->add($parameters);
     return true;
 }
 public function initialize($context, $parameters = null)
 {
     parent::initialize($context);
     $user = $context->getUser();
     $id = $context->getRequest()->getParameter('id');
     $lang = $context->getRequest()->getParameter('lang');
     $document = Document::find('Image', $id);
     $type = $document->get('image_type');
     $this->setParameter('is_moderator', $user->hasCredential('moderator'));
     $this->setParameter('was', $type);
     $this->getParameterHolder()->add($parameters);
 }
 public function initialize($context, $parameters = null)
 {
     parent::initialize($context);
     // Initialize parent
     parent::initialize($context);
     // set defaults
     $this->getParameterHolder()->set('required', true);
     $this->getParameterHolder()->set('error', 'You must select at least one activity');
     // Set parameters
     $this->getParameterHolder()->add($parameters);
     return true;
 }
示例#23
0
 public function initialize($context, $parameters = null)
 {
     parent::initialize($context);
     $this->setParameter('password', 'password');
     $this->setParameter('login_error', 'Invalid input');
     $this->setParameter('password_error', 'Invalid input');
     $this->setParameter('no_blog_error', 'Your blog was not added.');
     $this->setParameter('not_verified_error', 'Your ownership of the blog was not vertified');
     $this->setParameter('inactive_error', 'Your forum account is inactive.');
     $this->setParameter('unknown_error', 'Unknown  error');
     $this->getParameterHolder()->add($parameters);
     return true;
 }
 public function initialize($context, $parameters = null)
 {
     // initialize parent
     parent::initialize($context);
     // set defaults
     $this->setParameter('login_error', 'Invalid input');
     $var = var_export($parameters, true);
     sfContext::getInstance()->getLogger()->info("{myLoginValidator} parameters " . $var);
     foreach ($parameters as $key => $val) {
         sfContext::getInstance()->getLogger()->info("{myLoginValidator} {$key} => {$val} ");
     }
     $this->getParameterHolder()->add($parameters);
     return true;
 }
 public function initialize($context, $parameters = null)
 {
     parent::initialize($context);
     $user = $context->getUser();
     $id = $context->getRequest()->getParameter('id');
     if (!empty($id)) {
         $lang = $context->getRequest()->getParameter('lang');
         $document = Document::find('Article', $id);
         $collaborative_article = $document->get('article_type') == 1;
         $this->setParameter('is_moderator', $user->hasCredential('moderator'));
         $this->setParameter('was_collaborative', $collaborative_article);
     }
     $this->getParameterHolder()->add($parameters);
 }
 /**
  * Initializes this validator.
  *
  * @param sfContext The current application context
  * @param array   An associative array of initialization parameters
  *
  * @return boolean true, if initialization completes successfully, otherwise false
  */
 public function initialize($context, $parameters = null)
 {
     // initialize parent
     parent::initialize($context);
     // set defaults
     $this->getParameterHolder()->set('callback', null);
     $this->getParameterHolder()->set('invalid_error', 'Invalid input');
     $this->getParameterHolder()->add($parameters);
     // check parameters
     if (!is_callable($this->getParameterHolder()->get('callback'))) {
         // no pattern specified
         throw new sfValidatorException('Callback function must be a valid callback using is_callable().');
     }
     return true;
 }
 /**
  * Initializes this validator.
  *
  * @param sfContext The current application context
  * @param array   An associative array of initialization parameters
  *
  * @return bool true, if initialization completes successfully, otherwise false
  */
 public function initialize($context, $parameters = null)
 {
     // initialize parent
     parent::initialize($context);
     // set defaults
     $this->getParameterHolder()->set('match', true);
     $this->getParameterHolder()->set('match_error', 'Invalid input');
     $this->getParameterHolder()->set('pattern', null);
     $this->getParameterHolder()->add($parameters);
     // check parameters
     if ($this->getParameterHolder()->get('pattern') == null) {
         // no pattern specified
         throw new sfValidatorException('Please specify a PCRE regular expression pattern for your registered RegexValidator.');
     }
     return true;
 }
 /**
  * Initialize this validator.
  *
  * @param sfContext The current application context.
  * @param array   An associative array of initialization parameters.
  *
  * @return bool true, if initialization completes successfully, otherwise false.
  */
 public function initialize($context, $parameters = null)
 {
     // initialize parent
     parent::initialize($context);
     // set defaults
     $this->setParameter('unique_error', 'Uniqueness error');
     $this->getParameterHolder()->add($parameters);
     // check parameters
     if (!$this->getParameter('class')) {
         throw new sfValidatorException('The "class" parameter is mandatory for the sfDoctrineUniqueValidator validator.');
     }
     if (!$this->getParameter('column')) {
         throw new sfValidatorException('The "column" parameter is mandatory for the sfDoctrineUniqueValidator validator.');
     }
     return true;
 }
示例#29
0
 public function initialize($context, $parameters = null)
 {
     // initialize parent
     parent::initialize($context);
     //Set default parameters value
     $this->setParameter('custom_unique_error', 'The value is not unique');
     $this->getParameterHolder()->add($parameters);
     // check parameters
     if (!$this->getParameter('class')) {
         throw new sfValidatorException('The "class" parameter is mandatory for the sfCustomUniqueValidator validator.');
     }
     if (!$this->getParameter('nb_fields')) {
         throw new sfValidatorException('The "nb_fields" parameter is mandatory for the sfCustomUniqueValidator validator.');
     }
     return true;
 }
 /**
  * Initializes this validator.
  *
  * @param sfContext The current application context
  * @param array   An associative array of initialization parameters
  *
  * @return bool true, if initialization completes successfully, otherwise false
  */
 public function initialize($context, $parameters = null)
 {
     // initialize parent
     parent::initialize($context);
     // set defaults
     $this->getParameterHolder()->set('max_size', null);
     $this->getParameterHolder()->set('max_size_error', 'File is too large');
     $this->getParameterHolder()->set('mime_types', null);
     $this->getParameterHolder()->set('mime_types_error', 'Invalid mime type');
     $this->getParameterHolder()->add($parameters);
     // pre-defined categories
     $categories = array('@web_images' => array('image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png', 'image/gif'));
     if (!is_array($this->getParameter('mime_types'))) {
         if (isset($categories[$this->getParameter('mime_types')])) {
             $this->setParameter('mime_types', $categories[$this->getParameter('mime_types')]);
         }
     } elseif ($this->getParameter('mime_types', null)) {
         $this->setParameter('mime_types', $this->getParameter('mime_types'));
     }
     return true;
 }