Beispiel #1
0
 /**
  * @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();
 }
Beispiel #2
0
 /**
  * {@inheritDoc}
  * @return boolean
  */
 public function beforeSave()
 {
     $beforeSave = parent::beforeSave();
     if ($this->profile->get('email') == '*****@*****.**') {
         $this->profile->set('email', '');
     }
     return $beforeSave;
 }
Beispiel #3
0
 /**
  * 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();
 }
Beispiel #4
0
 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();
 }
Beispiel #5
0
 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();
 }
Beispiel #6
0
 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);
 }
Beispiel #8
0
 /**
  * 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();
 }