示例#1
0
 /**
  * Only process the request if the user is an admin.
  * Otherwise redirect to the admin login page.
  * @param Request $request
  * @return mixed
  */
 public function process($request)
 {
     $this->admin = $this->loggedAdmin();
     if ($this->admin === null) {
         return $this->adminLoginRedirect();
     }
     return parent::process($request);
 }
示例#2
0
 /**
  * Only process the request if the user is logged in.
  * Otherwise redirect to the login page.
  * @param Request $request
  * @return mixed
  */
 public function process($request)
 {
     $this->user = $this->loggedUser();
     if ($this->user === null) {
         return $this->userLoginRedirect();
     }
     return parent::process($request);
 }