Example #1
0
 public function checkLogin()
 {
     $crud = $this;
     Auth::checkLogin(function () use($crud) {
         // Get request object
         $req = $crud->getSlim()->request;
         //Get root URI
         $rootUri = $req->getRootUri();
         //Get resource URI
         $resourceUri = $req->getResourceUri();
         $_SESSION["redirect"] = $resourceUri;
         header("Location: " . Util::fullURL("auth/login"));
         die;
     });
 }
Example #2
0
 public static function checkLogin($callback)
 {
     if (!Auth::isLoggedIn()) {
         $callback();
     }
 }