当前位置: 首页>>代码示例>>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;未经允许,请勿转载。