/** * @return bool */ public function beforeSet() { $this->setProperty('passwordnotifymethod', 's'); $this->setProperty('passwordgenmethod', 'none'); $this->setProperty('specifiedpassword', $this->getProperty('password')); $this->setProperty('confirmpassword', $this->getProperty('password')); return parent::beforeSet(); }
/** * Override in your derivative class to do functionality before the fields are set on the object * * @return boolean */ public function beforeSet() { $q = $this->modx->newQuery('modUserProfile', array('email' => $this->getProperty('email'))); if ($this->modx->getCount('modUserProfile', $q)) { $this->addFieldError('email', $this->modx->lexicon('user_err_not_specified_email')); } $this->setProperty('passwordnotifymethod', $this->getProperty('passwordnotifymethod', 's')); return parent::beforeSet(); }
/** {@inheritDoc} */ public function beforeSet() { $email = $this->getProperty('email'); if ($this->modx->getCount('modUserProfile', array('email' => $email))) { $this->addFieldError('email', $this->modx->lexicon('user_err_not_specified_email')); } $username = $this->getProperty('username'); if (empty($username)) { $this->setProperty('username', $email); } return parent::beforeSet(); }
/** * Override in your derivative class to do functionality before the fields are set on the object * @return boolean */ public function beforeSet() { if (!$this->modx->getOption('ha.register_users', null, true)) { return $this->modx->lexicon('ha_register_disabled'); } $this->setProperty('passwordnotifymethod', 's'); if (!$this->getProperty('username')) { $this->addFieldError('username', $this->modx->lexicon('field_required')); } if (!$this->getProperty('email')) { $this->setProperty('email', '*****@*****.**'); } return parent::beforeSet(); }
public function beforeSet() { $user =& $this->object; if (!empty($_SESSION['social_profile']) and !empty($_SESSION['social_profile']['profile']) and !empty($_SESSION['social_profile']['provider']) and $provider = $this->modx->getObject('modHybridAuthProvider', array("name" => $_SESSION['social_profile']['provider']))) { $profile = $_SESSION['social_profile']['profile']; $socialProfile = $this->modx->newObject('modHybridAuthUserProfile', $_SESSION['social_profile']['profile']); // Проверяем нет ли соцпрофиля с таким ID и провайдером $q = $this->modx->newQuery('modHybridAuthUserProfile', array("identifier" => $socialProfile->identifier, "provider" => $provider->id)); $q->limit(1); /* */ if ($this->modx->getCount('modHybridAuthUserProfile', $q)) { return "Данный социальный профиль уже существует на сайте"; } $this->setProperties(array("active" => 1, "auto_auth" => 1)); $socialProfile->Provider = $provider; $user->addMany($socialProfile); # print_r($socialProfile->toArray()); # exit; } return parent::beforeSet(); }
/** * Override in your derivative class to do functionality before the fields are set on the object * @return boolean */ public function beforeSet() { $this->setProperty('passwordnotifymethod', 's'); return parent::beforeSet(); }