Пример #1
0
 public function get_activate($hash, $key)
 {
     $activate_user = Sentry::activate_user($hash, $key);
     if ($activate_user) {
         try {
             // Force login
             Sentry::force_login($activate_user->email);
             return View::make('user.activation-complete')->with('error', false);
         } catch (Sentry\SentryException $e) {
             return View::make('user.activation-complete')->with('error', true);
         }
     } else {
         return View::make('user.activation-complete')->with('error', true);
     }
 }
Пример #2
0
  */
 if (Config::get('xysti.routes.auth.register')) {
     Route::post(Config::get('xysti.routes.auth.register', 'register'), array('before' => 'check|validate', 'as' => 'register', function () {
         Xysti::helper('dbug');
         $auth_driver = Config::get('xysti.auth', 'default');
         // Default auth
         if ($auth_driver == 'default') {
             Xysti::error(500, 'Default auth currently not configured for registration.');
             // Sentry auth
         } elseif ($auth_driver == 'sentry') {
             try {
                 $user = Sentry::user()->create(array('email' => Input::get('email'), 'password' => Input::get('password'), 'metadata' => array('first_name' => Input::get('first_name'), 'last_name' => Input::get('last_name'))));
                 if ($user) {
                     $registration = TRUE;
                     try {
                         Sentry::force_login($user);
                     } catch (Sentry\SentryException $e) {
                         Session::flash('error', $e->getMessage());
                     }
                 } else {
                     $registration = FALSE;
                 }
             } catch (Sentry\SentryException $e) {
                 $errors = $e->getMessage();
                 Session::flash('error', $e->getMessage());
                 $registration = FALSE;
             }
         } else {
             return Xysti::error(500, 'Unknown authentication driver.');
         }
         // Registration was a success