예제 #1
0
 /**
  * actionPostprocessModify
  *
  * @return void
  */
 protected function actionPostprocessModify()
 {
     $params = array();
     if ($this->getModelForm()->isRegisterMode()) {
         // New profile is registered
         if ($this->isActionError()) {
             // Return back to register page
             $params = array('mode' => self::getRegisterMode());
         } else {
             // Send notification
             \XLite\Core\Mailer::sendProfileCreated($this->getProfile(), \XLite\Core\Request::getInstance()->password);
             // Return to the created profile page
             $params = array('profile_id' => $this->getProfile()->getProfileId());
         }
     } else {
         // Existing profile is updated
         $password = null;
         // Check if user's password was changed
         if (!empty(\XLite\Core\Request::getInstance()->password)) {
             $password = \XLite\Core\Request::getInstance()->password;
         }
         \XLite\Core\Mailer::sendProfileUpdated($this->getProfile(), $password);
         // Get profile ID from modified profile model
         $profileId = $this->getProfile()->getProfileId();
         // Return to the profile page
         $params = array('profile_id' => $profileId);
         if (\XLite\Model\Profile::STATUS_DISABLED == $this->getProfile()->getStatus()) {
             // Clear user session if user profile has been disabled
             \XLite\Core\Session::getInstance()->clearUserSession($profileId);
         }
     }
     if (!empty($params)) {
         $this->setReturnURL($this->buildURL('profile', '', $params));
     }
 }
예제 #2
0
 /**
  * doActionUpdate
  *
  * @return void
  */
 protected function doActionUpdate()
 {
     $result = $this->getModelForm()->performAction('update');
     if ($result) {
         \XLite\Core\Mailer::sendProfileUpdated($this->getModelForm()->getModelObject());
     }
 }