/** * 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)); } }
/** * Send create profile notifications * * @param string $password Password OPTIONAL * * @return void */ protected function sendCreateProfileNotifications($password = null) { $profile = $this->getCart()->getOrigProfile(); // Send notification \XLite\Core\Mailer::sendProfileCreated($profile, $password, true); }
/** * Postprocess register action (success) * * @return array */ protected function postprocessActionRegisterSuccess() { // Send notification \XLite\Core\Mailer::sendProfileCreated($this->getModelForm()->getModelObject()); $this->getCart()->login($this->getModelForm()->getModelObject()); // Log in user with created profile \XLite\Core\Auth::getInstance()->loginProfile($this->getModelForm()->getModelObject()); }