/** * @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(); }
/** * {@inheritDoc} * @return boolean */ public function beforeSave() { $beforeSave = parent::beforeSave(); if ($this->profile->get('email') == '*****@*****.**') { $this->profile->set('email', ''); } return $beforeSave; }
/** * 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(); }
public function afterSave() { if ($client = $this->modx->getObject('PaymentSystemClient', $this->object->get('id'))) { /* смена стутуса */ $status = $this->getProperty('status'); $this->modx->log(1, print_r($this->getProperties(), 1)); } return parent::afterSave(); }
public function afterSave() { if ($client = $this->modx->getObject('MlmSystemClient', array('id' => $this->object->get('id')))) { $clientStatus = $this->getProperty('status', $client->getStatusCreate()); $this->MlmSystem->Tools->changeClientStatus($client, $clientStatus); $parent = $this->getProperty('parent', $this->MlmSystem->getOption('referrer_default_client', null, 0)); if (!empty($parent)) { $this->MlmSystem->Tools->changeClientParent($client, $parent); } } return parent::afterSave(); }
public function checkBlocked() { /* blocked until */ $blockedUntil = $this->processor->getProperty('blockeduntil'); if (!empty($blockedUntil)) { $blockedUntil = str_replace('-', '/', $blockedUntil); if (!($blockedUntil = strtotime($blockedUntil))) { $this->processor->addFieldError('blockeduntil', $this->modx->lexicon('user_err_not_specified_blockeduntil')); } $this->processor->setProperty('blockeduntil', $blockedUntil); $this->profile->set('blockeduntil', $blockedUntil); } /* blocked after */ $blockedAfter = $this->processor->getProperty('blockedafter'); if (!empty($blockedAfter)) { $blockedAfter = str_replace('-', '/', $blockedAfter); if (!($blockedAfter = strtotime($blockedAfter))) { $this->processor->addFieldError('blockedafter', $this->modx->lexicon('user_err_not_specified_blockedafter')); } $this->processor->setProperty('blockedafter', $blockedAfter); $this->profile->set('blockedafter', $blockedAfter); } }
public function failure($msg = '', $object = null) { if (!$msg) { $msg = "Проверьте правильность заполнения данных"; } return parent::failure($msg, $object); }
/** * 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(); }