Exemplo n.º 1
0
Arquivo: user.php Projeto: bermi/admin
 public function sendSignupMessage($options = array())
 {
     $default_options = array('signup_message' => 'registration_details');
     $options = array_merge($default_options, $options);
     if (!empty($options['signup_message'])) {
         Ak::import_mailer('account_mailer');
         $Mailer = new AccountMailer();
         $Mailer->_login = $options['login'];
         $Mailer->_password = $options['password'];
         $Mailer->deliver($options['signup_message'], $this->get('email'));
     }
 }
Exemplo n.º 2
0
 /**
  * Activate
  *
  * @AclMap(	name="auth_activate_page",
  *			config={"only":"guest"},
  *			insufficient_message="acl.login",
  *			redirect={"type":"to","path":"/"})
  */
 public function actionActivate()
 {
     if (Input::has('email') && Input::has('code')) {
         try {
             $user = Sentry::findUserByLogin(Input::get('email'));
             // Let's get the activation code
             $activationCode = Input::get('code');
             // Attempt to activate and log the user in
             $user->attemptActivation($activationCode);
             Sentry::login($user, $remember);
             return Redirect::intended('/')->with('message', 'Your account now active');
         } catch (Cartalyst\Sentry\Users\UserAlreadyActivatedException $e) {
             return Redirect::intended('/');
         } catch (Exception $e) {
             throw $e;
         }
     }
     if (Session::has('process_activation') && Session::has('activation')) {
         try {
             $user = Sentry::findUserByLogin(Session::get('activation'));
             AccountMailer::factory($user)->sendActivation();
         } catch (Exception $e) {
             throw $e;
         }
     }
     $this->viewData = array('title' => 'Activate your account', 'auth_type' => 'forgot-password');
     $this->setupLayout();
 }
Exemplo n.º 3
0
 public function sendPasswordReminder($User)
 {
     if ($password_reset_url = $this->getCredentialsRenewalUrl($User)) {
         Ak::import_mailer('account_mailer');
         $Mailer = new AccountMailer();
         $Mailer->setPasswordResetUrl($password_reset_url);
         $Mailer->deliver('password_reminder', $User->get('email'));
         return true;
     }
     return false;
 }