当前位置: 首页>>代码示例>>PHP>>正文


PHP Sentry::authenticate方法代码示例

本文整理汇总了PHP中Sentry::authenticate方法的典型用法代码示例。如果您正苦于以下问题:PHP Sentry::authenticate方法的具体用法?PHP Sentry::authenticate怎么用?PHP Sentry::authenticate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sentry的用法示例。


在下文中一共展示了Sentry::authenticate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: authenticateUser

 /**
  * This function is login the user in by taking the username and password.
  *
  * @param unknown $username            
  * @param unknown $password            
  * @return boolean
  */
 public function authenticateUser($username, $password)
 {
     try {
         // Authenticate the user
         $credentials = array('email' => $username, 'password' => $password);
         $user = Sentry::authenticate($credentials, false);
         // calling the event of setting user session
         $subscriber = new SentryuserEventHandler();
         Event::subscribe($subscriber);
         Event::fire('sentryuser.login', $user);
         return true;
     } catch (Cartalyst\Sentry\Users\LoginRequiredException $e) {
         SentryHelper::setMessage('Login field is required.', 'warning');
     } catch (Cartalyst\Sentry\Users\PasswordRequiredException $e) {
         SentryHelper::setMessage('Password field is required.', 'warning');
     } catch (Cartalyst\Sentry\Users\WrongPasswordException $e) {
         SentryHelper::setMessage('Wrong password, try again.', 'warning');
     } catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
         SentryHelper::setMessage('User was not found.', 'warning');
     } catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
         SentryHelper::setMessage('User is not activated.', 'warning');
     } catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e) {
         SentryHelper::setMessage('User is suspended.', 'warning');
     } catch (Cartalyst\Sentry\Throttling\UserBannedException $e) {
         SentryHelper::setMessage('User is banned.', 'warning');
     }
 }
开发者ID:l4mod,项目名称:sentryuser,代码行数:34,代码来源:SentryUser.php

示例2: login

 public function login()
 {
     $account = Input::get('account');
     $password = Input::get('password');
     if (!isset($account)) {
         return Response::json(array('error_code' => 1, 'message' => '请输入账户'));
     }
     if (!isset($password)) {
         return Response::json(array('error_code' => 2, 'message' => '请输入密码'));
     }
     $user = User::where('account', $account)->first();
     if (!isset($user)) {
         return Response::json(array('error_code' => 3, 'message' => '用户名不存在'));
     }
     if (!($user->role & 0x2)) {
         return Response::json(array('error_code' => 4, 'message' => '无效用户'));
     }
     try {
         Sentry::authenticate(array('phone' => $user->phone, 'password' => $password));
     } catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
         return Response::json(array('error_code' => 5, 'message' => '用户名或密码错误'));
     } catch (Cartalyst\Sentry\Users\PasswordRequiredException $e) {
         return Response::json(array('error_code' => 5, 'message' => '用户名或密码错误'));
     }
     $doctor = Doctor::where('user_id', $user->id)->first();
     Session::put('user.id', $user->id);
     Session::put('doctor.id', $doctor->id);
     Session::put('doctor.name', $doctor->name);
     Session::put('doctor.photo', $doctor->photo);
     return Response::json(array('error_code' => 0, 'message' => '登录成功'));
 }
开发者ID:Jv-Juven,项目名称:hospital-register-system,代码行数:31,代码来源:DoctorController.php

示例3: login_post

 public function login_post()
 {
     if (!Request::ajax()) {
         App::abort('401');
     }
     $data = array('status' => 'success', 'message' => '');
     try {
         // Set login credentials
         $credentials = array('email' => Input::get('email'), 'password' => Input::get('password'));
         $remember = Input::get('remember') ? Input::get('remember') : false;
         // Try to authenticate the user
         $user = Sentry::authenticate($credentials, $remember);
         $data['status'] = 'success';
         $data['message'] = 'Login Success. Redirecting';
     } catch (Cartalyst\Sentry\Users\LoginRequiredException $e) {
         $data['status'] = 'error';
         $data['message'] = 'Login field is required.';
     } catch (Cartalyst\Sentry\Users\PasswordRequiredException $e) {
         $data['status'] = 'error';
         $data['message'] = 'Password field is required.';
     } catch (Cartalyst\Sentry\Users\WrongPasswordException $e) {
         $data['status'] = 'error';
         $data['message'] = 'Wrong password, try again.';
     } catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
         $data['status'] = 'error';
         $data['message'] = 'User was not found.';
     } catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
         $data['status'] = 'error';
         $data['message'] = 'User is not activated.';
     }
     $response = Response::make(json_encode($data), 200);
     $response->header('Content-Type', 'text/json');
     return $response;
 }
开发者ID:jacobDaeHyung,项目名称:PHPLaravelGymManagementSystem,代码行数:34,代码来源:AuthController.php

示例4: postLogin

 public function postLogin()
 {
     $usuario = Input::get('usuario');
     $credentials = array('usuario' => $usuario, 'password' => Input::get('password'));
     try {
         $user = Sentry::authenticate($credentials, false);
         if ($user) {
             return Redirect::route('admin.index');
         }
     } catch (Cartalyst\Sentry\Users\LoginRequiredException $e) {
         return Redirect::route('login')->withErrors('Ingrese su usuario.');
     } catch (Cartalyst\Sentry\Users\PasswordRequiredException $e) {
         return Redirect::route('login')->withErrors('Ingrese su contraseña.');
     } catch (Cartalyst\Sentry\Users\WrongPasswordException $e) {
         return Redirect::route('login')->withErrors('Contraseña incorrecta, vuelva a intentar.');
     } catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
         return Redirect::route('login')->withErrors('No se encontró el usuario [' . $usuario . ']');
     } catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
         return Redirect::route('login')->withErrors('Usuario [' . $usuario . '] inactivo, no puede ingresar.');
     } catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e) {
         return Redirect::route('login')->withErrors('Usuario [' . $usuario . '] está suspendido.');
     } catch (Cartalyst\Sentry\Throttling\UserBannedException $e) {
         return Redirect::route('login')->withErrors('El usuario [' . $usuario . '] ha sido baneado.');
     }
     /*catch(\Exception $e)
     		{
     			return Redirect::route('login')
     					->withErrors(array('login' => $e->getMessage()));
     		}*/
 }
开发者ID:appsmambo,项目名称:base-aerea,代码行数:30,代码来源:AdminController.php

示例5: user_login

 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function user_login()
 {
     if (Session::token() !== Input::get('_token')) {
         $response = array('status' => 'fail', 'msg' => 'unauthorized login');
     }
     try {
         // Set login credentials
         $credentials = array('email' => Input::get('username'), 'password' => Input::get('password'));
         // Try to authenticate the user
         $user = Sentry::authenticate($credentials, false);
         if ($user) {
             $response = array('status' => 'success', 'msg' => 'congratulations!!!!');
         }
     } catch (Cartalyst\Sentry\Users\LoginRequiredException $e) {
         $response = array('status' => 'fail', 'msg' => 'Login field is required.');
     } catch (Cartalyst\Sentry\Users\PasswordRequiredException $e) {
         $response = array('status' => 'fail', 'msg' => 'Password field is required.');
     } catch (Cartalyst\Sentry\Users\WrongPasswordException $e) {
         $response = array('status' => 'fail', 'msg' => 'Wrong password, try again.');
     } catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
         $response = array('status' => 'fail', 'msg' => 'Agent was not found.');
     } catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
         $response = array('status' => 'fail', 'msg' => 'Sorry!! seams you are not activated to use the system.. please visit the system administrator.');
     } catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e) {
         $response = array('status' => 'fail', 'msg' => 'Sorry!! seams you are suspended from using the system.. please visit the system administrator.');
     } catch (Cartalyst\Sentry\Throttling\UserBannedException $e) {
         $response = array('status' => 'fail', 'msg' => 'Sorry!! seams you are baned from using the system.. please visit the system administrator.');
     }
     return Response::json($response);
 }
开发者ID:mwenda-eric,项目名称:LeaveApp,代码行数:35,代码来源:UserController.php

示例6: getIndex

 public function getIndex()
 {
     if (Sentry::check()) {
         return View::make('account', ['title' => 'Settings']);
     } else {
         if (Input::has('username') && Input::has('password')) {
             $username = Input::get('username');
             $password = Input::get('password');
             $input_remember = Input::get('remember');
             $remember = false;
             if (isset($input_remember) && $input_remember == true) {
                 $remember = true;
             }
             try {
                 // Login credentials
                 $credentials = array('username' => $username, 'password' => $password);
                 // Authenticate the user
                 $user = Sentry::authenticate($credentials, $remember);
                 return Redirect::to('account');
             } catch (Cartalyst\Sentry\Users\WrongPasswordException $e) {
                 return View::make('account')->nest('sign_in_form', 'child.signin')->nest('update_msg', 'child.alerts', array('msg_type' => 'warning', 'msg' => 'Wrong password, try again.'));
             } catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
                 return View::make('account')->nest('sign_in_form', 'child.signin')->nest('update_msg', 'child.alerts', array('msg_type' => 'warning', 'msg' => 'User was not found.'));
             } catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
                 return View::make('account')->nest('sign_in_form', 'child.signin')->nest('update_msg', 'child.alerts', array('msg_type' => 'warning', 'msg' => 'User is not activated.'));
             } catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e) {
                 return View::make('account')->nest('sign_in_form', 'child.signin')->nest('update_msg', 'child.alerts', array('msg_type' => 'warning', 'msg' => 'User is suspended.'));
             } catch (Cartalyst\Sentry\Throttling\UserBannedException $e) {
                 return View::make('account')->nest('sign_in_form', 'child.signin')->nest('update_msg', 'child.alerts', array('msg_type' => 'warning', 'msg' => 'User is banned!'));
             }
         } else {
             return View::make('account', ['title' => 'Sign in'])->nest('sign_in_form', 'child.signin');
         }
     }
 }
开发者ID:shaikhatik0786,项目名称:Masteranime,代码行数:35,代码来源:AccountController.php

示例7: loginTry

 public function loginTry()
 {
     try {
         Input::only('email', 'password', 'remember_me');
         // Set login credentials
         $credentials = array('email' => Input::get('email'), 'password' => Input::get('password'));
         // Try to authenticate the user
         if (Input::get('remember_me') == true) {
             $user = Sentry::authenticateAndRemember($credentials);
         } else {
             $user = Sentry::authenticate($credentials);
         }
         return Redirect::intended('/')->with('global_success', 'You are now logged in.');
     } catch (Cartalyst\Sentry\Users\LoginRequiredException $e) {
         return Redirect::to('/login')->with('login_error', 'Login field is required.');
     } catch (Cartalyst\Sentry\Users\PasswordRequiredException $e) {
         return Redirect::to('/login')->with('login_error', 'Password field is required.');
     } catch (Cartalyst\Sentry\Users\WrongPasswordException $e) {
         return Redirect::to('/login')->with('login_error', 'Your username/password combination was incorrect.');
     } catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
         return Redirect::to('/login')->with('login_error', 'Your username/password combination was incorrect.');
     } catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
         return Redirect::to('/login')->with('login_error', 'You need to activate your account before log in.');
     } catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e) {
         return Redirect::to('/')->with('global_error', 'Depends on violation, your account has been suspended or banned.');
     } catch (Cartalyst\Sentry\Throttling\UserBannedException $e) {
         return Redirect::to('/')->with('global_error', 'Depends on violation, your account has been suspended or banned.');
     }
 }
开发者ID:Belar,项目名称:librific,代码行数:29,代码来源:AuthController.php

示例8: postLogin

 public function postLogin()
 {
     try {
         // Login credentials
         $credentials = array('email' => Input::get('username'), 'password' => Input::get('password'));
         // Authenticate the user
         $user = Sentry::authenticate($credentials, false);
         return Redirect::intended('/');
     } catch (Cartalyst\Sentry\Users\LoginRequiredException $e) {
         $msg = 'Login field is required.';
     } catch (Cartalyst\Sentry\Users\PasswordRequiredException $e) {
         $msg = 'Password field is required.';
     } catch (Cartalyst\Sentry\Users\WrongPasswordException $e) {
         $msg = 'Wrong password, try again.';
     } catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
         $msg = 'User was not found.';
     } catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
         $msg = 'User is not activated.';
     } catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e) {
         $msg = 'User is suspended.';
     } catch (Cartalyst\Sentry\Throttling\UserBannedException $e) {
         $msg = 'User is banned.';
     }
     return Redirect::to('auth/login')->withInput()->with('exception', $msg);
 }
开发者ID:gitda,项目名称:inventory2,代码行数:25,代码来源:AuthController.php

示例9: postLogon

 public function postLogon()
 {
     $valid = Validator::make(Input::all(), ['email' => 'required|email', 'password' => 'required'], ['password.required' => trans('larauth::larauth.password_required')]);
     if ($valid->fails()) {
         return Redirect::route('larauth.logon')->with('errors', $valid->errors())->with(Input::all());
     }
     try {
         $user = Sentry::authenticate(['email' => Input::get('email'), 'password' => Input::get('password')], Input::get('remember'));
         // redirect to url before authetificate
         return Redirect::intended();
     } catch (Cartalyst\Sentry\Users\LoginRequiredException $e) {
         echo 'Login field is required.';
     } catch (Cartalyst\Sentry\Users\PasswordRequiredException $e) {
         echo 'Password field is required.';
     } catch (Cartalyst\Sentry\Users\WrongPasswordException $e) {
         //echo 'Wrong password, try again.';
         $valid->errors()->add('password', trans('larauth::larauth.wrong_password'));
     } catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
         echo 'User was not found.';
     } catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
         echo 'User is not activated.';
     } catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e) {
         //echo 'User is suspended.';
         $valid->errors()->add('password', trans('larauth::larauth.user_suspended'));
     } catch (Cartalyst\Sentry\Throttling\UserBannedException $e) {
         echo 'User is banned.';
     }
     return Redirect::route('larauth.logon')->with('errors', $valid->errors())->with(Input::all());
 }
开发者ID:bitw,项目名称:larauth,代码行数:29,代码来源:LarauthController.php

示例10: postLogin

 public function postLogin()
 {
     $credentials = array('email' => Input::get('email'), 'password' => Input::get('password'));
     $rules = array('email' => 'required|min:4|max:254|email', 'password' => 'required|min:6');
     $validator = Validator::make($credentials, $rules);
     if ($validator->passes()) {
     }
     $err_code = "";
     try {
         $user = Sentry::authenticate($credentials, false);
         if ($user) {
             return Redirect::route('/');
         }
     } catch (Cartalyst\Sentry\Users\LoginRequiredException $e) {
         $err_code = "login_field_is_required";
     } catch (Cartalyst\Sentry\Users\PasswordRequiredException $e) {
         $err_code = "password_field_is_required";
     } catch (Cartalyst\Sentry\Users\WrongPasswordException $e) {
         $err_code = "wrong_password_exception";
     } catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
         $err_code = "user_not_found";
     } catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
         $err_code = "user_is_not_activated";
     } catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e) {
         $err_code = "user_is_suspended";
     } catch (Cartalyst\Sentry\Throttling\UserBannedException $e) {
         $err_code = "user_is_banned";
     }
     return Redirect::route('admin.login')->withErrors(array('login' => Lang::get("sentry." . $err_code)));
 }
开发者ID:arikazukitomaharjan,项目名称:OfficeSystem,代码行数:30,代码来源:LoginController.php

示例11: postLogin

 /**
  * Login action
  * @return Redirect
  */
 public function postLogin($target = 'admin')
 {
     $input = Input::all();
     $credentials = array('login' => $input['username'], 'password' => $input['password']);
     $remember = isset($input['remember']) && $input['remember'] == 'checked' ? true : false;
     try {
         $user = Sentry::authenticate($credentials, $remember);
         if ($user) {
             if (isset($input['api'])) {
                 return Response::json(array(), 200);
             } else {
                 return Redirect::intended($target);
             }
         }
     } catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
         if (isset($input['api'])) {
             return Response::json(array('error' => trans('users.check_activation_email')), 200);
         } else {
             return Redirect::back()->withErrors(trans('users.check_activation_email'));
         }
     } catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e) {
         if (isset($input['api'])) {
             return Response::json(array('error' => trans('users.account_suspended', array('minutes' => 10))), 200);
         } else {
             return Redirect::back()->withErrors(trans('users.account_suspended', array('minutes' => 10)));
         }
     } catch (Exception $e) {
         if (isset($input['api'])) {
             return Response::json(array('error' => trans('users.invalid_username_pw')), 200);
         } else {
             return Redirect::back()->withErrors(trans('users.invalid_username_pw'));
         }
     }
 }
开发者ID:doptor,项目名称:doptor,代码行数:38,代码来源:AuthController.php

示例12: postLogin

 public function postLogin()
 {
     /*
      * Validate
      */
     $rules = array('email' => 'required|email', 'password' => 'required');
     $validation = \Validator::make(\Input::all(), $rules);
     if ($validation->passes()) {
         $email = \Input::get('email');
         $password = \Input::get('password');
         try {
             $credentials = array('email' => $email, 'password' => $password);
             // Authenticate the user
             $user = \Sentry::authenticate($credentials, false);
         } catch (\Cartalyst\Sentry\Users\UserNotActivatedException $e) {
             $errors = new \Illuminate\Support\MessageBag();
             $errors->add('invalid', "This user hasn't been activated. Please contact us for support.");
             return \Redirect::to('admin')->withErrors($errors)->withInput();
         } catch (\Exception $e) {
             $errors = new \Illuminate\Support\MessageBag();
             $errors->add('invalid', "Oops, your email or password is incorrect.");
             return \Redirect::to('admin')->withErrors($errors)->withInput();
         }
         return \Redirect::to('admin');
     }
     return \Redirect::to('admin')->withErrors($validation)->withInput();
 }
开发者ID:tusharvikky,项目名称:redminportal,代码行数:27,代码来源:LoginController.php

示例13: login

 public function login()
 {
     try {
         $user = Sentry::getUserProvider()->findByLogin(Input::json('email'));
         $throttle = Sentry::getThrottleProvider()->findByUserId($user->id);
         $throttle->setSuspensionTime(10);
         $throttle->setAttemptLimit(3);
         $throttle->check();
         $credentials = ['email' => Input::json('email'), 'password' => Input::json('password')];
         $user = Sentry::authenticate($credentials, false);
     } catch (Cartalyst\Sentry\Users\WrongPasswordException $e) {
         return Response::json(array('flash' => 'Invalid username or password'), 500);
     } catch (Cartalyst\Sentry\Users\LoginRequiredException $e) {
         return Response::json(array('flash' => 'Login field is required'), 500);
     } catch (Cartalyst\Sentry\Users\PasswordRequiredException $e) {
         return Response::json(array('flash' => 'Password field is required'), 500);
     } catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
         return Response::json(array('flash' => 'Invalid username or password'), 500);
     } catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
         return Response::json(array('flash' => 'This account is inactive'), 500);
     } catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e) {
         $time = $throttle->getSuspensionTime();
         return Response::json(array('flash' => 'This account is suspended for ' . $time . ' minutes'), 500);
     } catch (Cartalyst\Sentry\Throttling\UserBannedException $e) {
         return Response::json(array('flash' => 'This account has been banned'), 500);
     }
     $user_details = User::join('users_groups', 'users.id', '=', 'users_groups.user_id')->join('groups', 'users_groups.group_id', '=', 'groups.id')->where('users.id', '=', $user->id)->select('users.id', 'users.email', 'users.first_name', 'users.last_name', 'groups.name as role', 'users.activated_at', 'users.last_login', 'users.created_at', 'users.updated_at')->get();
     return Response::json($user_details[0], 200);
 }
开发者ID:yevta,项目名称:simple-crm-laravel,代码行数:29,代码来源:AuthController.php

示例14: login

 public function login()
 {
     try {
         $credentials = array('email' => Input::get('email'), 'password' => Input::get('password'));
         if (Input::get('remember') == 1) {
             $user = Sentry::authenticateAndRemember($credentials);
         } else {
             $user = Sentry::authenticate($credentials);
         }
         $url = URL::to('dashboard');
         return Response::json(array('success' => 'You have arrived! Hang on and we\'ll redirect you shortly', 'url' => $url));
     } catch (Cartalyst\Sentry\Users\LoginRequiredException $e) {
         return Response::json(array('message' => 'Login field is required'));
     } catch (Cartalyst\Sentry\Users\PasswordRequiredException $e) {
         return Response::json(array('message' => 'Password field is required.'));
     } catch (Cartalyst\Sentry\Users\WrongPasswordException $e) {
         return Response::json(array('message' => 'Wrong password, please try again.'));
     } catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
         return Response::json(array('message' => 'User was not found.'));
     } catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
         return Response::json(array('message' => 'User is not activated.'));
     } catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e) {
         return Response::json(array('message' => 'User is suspended.'));
     } catch (Cartalyst\Sentry\Throttling\UserBannedException $e) {
         return Response::json(array('message' => 'User is banned.'));
     }
 }
开发者ID:shinichi81,项目名称:Laravel4-Newsletter-Application,代码行数:27,代码来源:FrontendController.php

示例15: loginUser

 /**
  * To Authenticate a user
  *
  * @usage loginUser("rain@walker.com", "123");
  *
  * @return bool
  */
 public function loginUser($email, $password)
 {
     /**
      *	Validation for User Registration
      */
     $validator = Validator::make(array('email' => $email, 'password' => $password), array('email' => array('email', 'required', 'min:5'), 'password' => array('required', 'min:5')));
     // Validation did not pass
     if ($validator->fails()) {
         throw new Exception($validator->messages());
     }
     // Authenticate
     try {
         // Login credentials
         $credentials = array('email' => $email, 'password' => $password);
         // Authenticate the user
         $user = Sentry::authenticate($credentials, true);
         return $user;
     } catch (Cartalyst\Sentry\Users\LoginRequiredException $e) {
         echo 'Login field is required.';
     } catch (Cartalyst\Sentry\Users\PasswordRequiredException $e) {
         echo 'Password field is required.';
     } catch (Cartalyst\Sentry\Users\WrongPasswordException $e) {
         echo 'Wrong password, try again.';
     } catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
         echo 'User was not found.';
     } catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
         echo 'User is not activated.';
     } catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e) {
         echo 'User is suspended.';
     } catch (Cartalyst\Sentry\Throttling\UserBannedException $e) {
         echo 'User is banned.';
     }
 }
开发者ID:arizawan,项目名称:livetvwithyoutube,代码行数:40,代码来源:User.php


注:本文中的Sentry::authenticate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。