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


PHP Auth::check方法代码示例

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


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

示例1: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure                 $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $response = $next($request);
     if ($this->auth->check() && $response instanceof Response) {
         $response->header('Cache-Control', 'no-cache, max-age=0, must-revalidate, no-store');
     }
     return $response;
 }
开发者ID:imanghafoori1,项目名称:boom-core,代码行数:16,代码来源:DisableHttpCacheIfLoggedIn.php

示例2: getIndex

 /**
  * Responds to requests to GET /
  */
 public function getIndex()
 {
     if (\Auth::check()) {
         return redirect()->to('/birds');
     }
     return view('welcome.index');
 }
开发者ID:nikoferraz,项目名称:birdwatcher,代码行数:10,代码来源:WelcomeController.php

示例3: __construct

 public function __construct()
 {
     // Asset::add('jquery.dropdown.css', 'css/jquery.dropdown.css');
     Asset::add('bootstrap', 'css/bootstrap.min.css');
     Asset::add('bootstrap-responsive', 'css/bootstrap-responsive.css');
     Asset::add('common', 'css/common.css');
     // Asset::add('style', 'css/style.css');
     Asset::add('fontawsome', 'css/fontawesome.css');
     Asset::add('flickcss', 'css/flick/jquery-ui-1.10.2.custom.css');
     Asset::add('jquery', 'js/jquery-1.9.1.js');
     Asset::add('jquery-migrate-1.1.1.js', 'js/jquery-migrate-1.1.1.js');
     Asset::add('bootstrap-js', 'js/bootstrap.js');
     Asset::add('jqueryui', 'js/jquery-ui-1.10.2.custom.min.js');
     Asset::add('jquery.tablesorter.js', 'js/jquery.tablesorter.js');
     Asset::add('jquery.tablesorter.pager.js', 'js/jquery.tablesorter.pager.js');
     // $files = glob("public/css/pikachoose/*.css", GLOB_BRACE);
     // foreach($files as $file)
     // {
     // 	Asset::add($file, substr($file, 7));
     // }
     if (Session::has('id') && Auth::check()) {
         $account = Account::find(Session::get('id'));
         if ($account->admin == 1) {
             Session::put('admin', '1');
         } else {
             Session::put('admin', '0');
         }
         if ($account->blocked == 1) {
             Session::put('alert', "Your account has been banned. Please contact the admin for more details");
             Session::forget('id');
             Auth::logout();
         } else {
         }
     }
 }
开发者ID:angmark0309,项目名称:remarket,代码行数:35,代码来源:base.php

示例4: create

 public function create()
 {
     if (Auth::check()) {
         return Redirect::route('users.show', Auth::user()->username);
     }
     return View::make('sessions.create');
 }
开发者ID:jatz91,项目名称:mattsteve,代码行数:7,代码来源:SessionsController.php

示例5: action_update

 public function action_update()
 {
     // If not logged in redirect to home
     if (!\Auth::check()) {
         \Messages::info(__('user.login.not-logged'));
         \Response::redirect_back();
     }
     // was the login form posted?
     if (\Input::method() == 'POST') {
         // check the credentials.
         if (\Auth::instance()->validate_user(\Auth::get_email(), \Input::param('password'))) {
             if (\Input::param('new_password') === \Input::param('confirm_password')) {
                 \Auth::change_password(\Input::param('password'), \Input::param('new_password'));
                 // inform the user the password change was successful
                 \Messages::success(__('user.login.changed'));
                 \Response::redirect_back();
             }
             \Messages::warning(__('user.login.mismatch-password'));
         } else {
             // login failed, show an error message
             \Messages::error(__('user.login.bad-password'));
         }
         \Response::redirect_back('/backend/account/index/password');
     }
     // display the password reset page
     $this->template->content = View::forge('user/password/update');
 }
开发者ID:daniel-rodas,项目名称:rodasnet.com,代码行数:27,代码来源:password.php

示例6: getAuthUser

 public function getAuthUser()
 {
     if (\Auth::check()) {
         return \Auth::user();
     }
     return null;
 }
开发者ID:plamenyankov,项目名称:northstyle,代码行数:7,代码来源:Context.php

示例7: before

 public function before()
 {
     parent::before();
     if (!Auth::check()) {
         Response::redirect('login');
     }
 }
开发者ID:nihonLoomba,项目名称:noteshare-,代码行数:7,代码来源:categorymanagement.php

示例8: postVote

 public function postVote()
 {
     Input::merge(array_map('trim', Input::all()));
     $input = Input::all();
     $rules = array('MCUsername' => 'required|max:40', 'g-recaptcha-response' => 'required|recaptcha', 'sid' => 'required');
     $v = Validator::make($input, $rules);
     $sid = $input['sid'];
     $server = DB::table('mcservers')->where('mcs_id', '=', $sid)->first();
     if (!count($server)) {
         return Redirect::to('/minecraft/' . $sid)->withErrors("Ocorreu um erro com a validação do servidor");
     }
     if ($v->passes()) {
         if (mcservers::playerHasVoted($sid, $input['MCUsername']) || mcservers::ipHasVoted($sid, $_SERVER["HTTP_CF_CONNECTING_IP"])) {
             return Redirect::to('/minecraft/' . $sid)->withErrors("Já votaste hoje");
         }
         if ($server->mcs_votifier == 1) {
             $votifier = Votifier::newVote($server->mcs_ip, $server->mcs_vport, $server->mcs_votifierkey, $input['MCUsername']);
             if ($votifier == false) {
                 return Redirect::to('/minecraft/' . $sid)->withErrors("Não foi possivel enviar o voto para o servidor, porfavor contacta o admininstrador do mesmo");
             }
         }
         if (Auth::check()) {
             DB::table('users')->where('id', Auth::user()->id)->update(array('votes' => Auth::user()->votes + 1));
             utilities::log("Voted On Server " . $server->mcs_name);
         }
         DB::table('mcservers')->where('mcs_id', $sid)->update(array('mcs_tvotes' => $server->mcs_tvotes + 1, 'mcs_mvotes' => $server->mcs_mvotes + 1));
         DB::table('mcserversvotes')->insert(array('mcsv_sid' => $sid, 'mcsv_player' => $input['MCUsername'], 'mcsv_ip' => $_SERVER["HTTP_CF_CONNECTING_IP"], 'mcsv_day' => date("j"), 'mcsv_month' => date("n"), 'mcsv_year' => date("Y")));
         return Redirect::to('/minecraft/' . $sid)->With('success', 'Voto Registado!');
     } else {
         return Redirect::to('/minecraft/' . $sid)->withErrors($v);
     }
 }
开发者ID:G4brym,项目名称:ServerList.pt,代码行数:32,代码来源:BaseController.php

示例9: showWelcome

 public function showWelcome()
 {
     if (Auth::check()) {
         return Redirect::action('ProfileController@getProfile', array('username' => Auth::user()->username));
     }
     $this->layout->content = View::make('home.home');
 }
开发者ID:sh1nu11bi,项目名称:CloMa,代码行数:7,代码来源:HomeController.php

示例10: showWelcome

 public function showWelcome()
 {
     if (Auth::check()) {
         return View::make('users.index');
     }
     return View::make('hello');
 }
开发者ID:resumeproductions,项目名称:Resume-Solutions,代码行数:7,代码来源:HomeController.php

示例11: handle

 public function handle($request, Closure $next)
 {
     if (\Auth::check()) {
         return redirect()->route(\Config::get('admin.home_route'));
     }
     return $next($request);
 }
开发者ID:hramose,项目名称:material-admin,代码行数:7,代码来源:GuestMiddleware.php

示例12: before

 public function before()
 {
     parent::before();
     !Auth::check() and Response::redirect('/auth/login');
     $this->current_user = Model_User::find_by_username(Auth::get_screen_name());
     $this->template->set_global('current_user', $this->current_user);
 }
开发者ID:nobuhiko,项目名称:mylogbook,代码行数:7,代码来源:setting.php

示例13: getSales

 public function getSales()
 {
     if (Auth::check()) {
         return View::make('invoice_line');
     }
     return View::make('login');
 }
开发者ID:armannadim,项目名称:restpos,代码行数:7,代码来源:AccountController.php

示例14: account

/**
 * @return \App\Modules\UserModule\Entities\User|\App\Modules\ShopModule\Entities\Shop|null
 */
function account()
{
    if (!Auth::check()) {
        return null;
    }
    return isRouteInShop() ? shop() : Auth::user();
}
开发者ID:gez-studio,项目名称:gez-mall,代码行数:10,代码来源:_eloquent.php

示例15: logout

 public function logout()
 {
     if (Auth::check()) {
         Auth::logout();
     }
     return Redirect::route('frontpage');
 }
开发者ID:Geekathon,项目名称:reddit-clone,代码行数:7,代码来源:UserController.php


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