當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AuthManager::check方法代碼示例

本文整理匯總了PHP中Illuminate\Auth\AuthManager::check方法的典型用法代碼示例。如果您正苦於以下問題:PHP AuthManager::check方法的具體用法?PHP AuthManager::check怎麽用?PHP AuthManager::check使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Auth\AuthManager的用法示例。


在下文中一共展示了AuthManager::check方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: filter

 public function filter(Route $route, Request $request)
 {
     if ($this->auth->check()) {
         $config = $this->config->get('c::redirect-login');
         $url = $config ? $this->url->to($config) : '/';
         return $this->redirect->to($url);
     }
 }
開發者ID:anlutro,項目名稱:l4-core,代碼行數:8,代碼來源:GuestFilter.php

示例2: allowedToEdit

 /**
  * Returns whether the logged in user is allowed to edit a page.
  *
  * @return bool
  */
 public function allowedToEdit(Page $page = null)
 {
     if ($page === null) {
         return true;
     }
     return Editor::isEnabled() && $this->auth->check('edit', $page);
 }
開發者ID:imanghafoori1,項目名稱:boom-core,代碼行數:12,代碼來源:Provider.php

示例3: handle

 /**
  * @param $request
  * @param callable $next
  * @return mixed
  */
 public function handle($request, \Closure $next)
 {
     if ($this->auth->check()) {
         $this->app->setLocale($this->auth->user()->getLocale());
     }
     return $next($request);
 }
開發者ID:studiocaro,項目名稱:HorseStories,代碼行數:12,代碼來源:Locale.php

示例4: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure                 $next
  *
  * @return mixed
  */
 public function handle(Request $request, Closure $next)
 {
     $asset = $request->route()->getParameter('asset');
     if ($asset && !$this->auth->check()) {
         $ip = ip2long($request->ip());
         if (!AssetDownload::recentlyLogged($asset->getId(), $ip)->count() > 0) {
             AssetDownload::create(['asset_id' => $asset->getId(), 'ip' => $ip, 'time' => time()]);
             $asset->incrementDownloads();
         }
     }
     return $next($request);
 }
開發者ID:imanghafoori1,項目名稱:boom-core,代碼行數:20,代碼來源:LogAssetDownload.php

示例5: maySeeItem

 /**
  * Returns whether the given item should be visible to the user.
  *
  * @param  array  $item
  * @return bool
  */
 protected function maySeeItem(array $item)
 {
     if (!isset($item['logged_in'])) {
         return true;
     }
     return $item['logged_in'] && $this->auth->check();
 }
開發者ID:janusnic,項目名稱:laravel-tricks,代碼行數:13,代碼來源:Builder.php

示例6: login

 public function login()
 {
     if ($this->auth->check() && $this->auth->user()->can(['Dashboard'])) {
         return $this->redirector->route("dashboard");
     }
     if ($this->auth->check() && !$this->auth->user()->can(['Dashboard'])) {
         return $this->redirector->route("home");
     }
     $url = $this->request->get("url");
     return $this->theme->baseDashboard("Admin::login")->with("url", $url);
 }
開發者ID:PhonemeCms,項目名稱:cms,代碼行數:11,代碼來源:UserController.php

示例7: logout

 public function logout()
 {
     if (phpCAS::isSessionAuthenticated()) {
         if ($this->auth->check()) {
             $this->auth->logout();
         }
         Session::flush();
         phpCAS::logout();
         exit;
     }
 }
開發者ID:MateuszFlisikowski,項目名稱:cas,代碼行數:11,代碼來源:Sso.php

示例8: logout

 /**
  * This method is used to logout from CAS
  *
  * @param string $service a URL that will be transmitted to the CAS server to do a redirect after logout
  *
  * @return none
  */
 public function logout($service = "")
 {
     if (phpCAS::isSessionAuthenticated()) {
         if ($this->auth->check()) {
             $this->auth->logout();
         }
         $this->session->flush();
         if ($service != "") {
             phpCAS::logoutWithRedirectService($service);
         } else {
             phpCAS::logout();
         }
         exit;
     }
 }
開發者ID:rroslaniec,項目名稱:cas,代碼行數:22,代碼來源:Sso.php

示例9: setUserByAuth

 /**
  * Set user by auth
  *
  * @return $this
  */
 public function setUserByAuth()
 {
     if ($this->auth->check()) {
         return $this->setUser($this->auth->user());
     }
 }
開發者ID:reshadman,項目名稱:hammihan-online,代碼行數:11,代碼來源:AclBridge.php

示例10: isLoggedIn

 /**
  * @return mixed
  */
 public function isLoggedIn()
 {
     return $this->auth->check();
 }
開發者ID:coandacms,項目名稱:coanda-core,代碼行數:7,代碼來源:UserManager.php


注:本文中的Illuminate\Auth\AuthManager::check方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。