From 3cd13deee3ba239e232c3f91331411747a90affd Mon Sep 17 00:00:00 2001 From: alvaro <alvaro@alia.(none)> Date: Tue, 8 May 2012 00:53:10 -0700 Subject: [PATCH] Session works now --- classes/Utils.php | 39 ------------------- classes/modules/sessionModule.php | 7 ++-- .../{html.queries => queries}/main.query | 0 3 files changed, 4 insertions(+), 42 deletions(-) rename doc/examples/originalComponents/services/instances/{html.queries => queries}/main.query (100%) diff --git a/classes/Utils.php b/classes/Utils.php index 17c36418..3d7b890f 100644 --- a/classes/Utils.php +++ b/classes/Utils.php @@ -1,46 +1,7 @@ <? class Utils{ -<<<<<<< HEAD - public static function send303($uri, $ext){ - header("HTTP/1.0 303 See Other"); - header("Location: ".$uri); - header("Content-type: ".$ext); - echo $uri."\n\n"; - exit(0); - } - - public static function send401($msg){ - header("HTTP/1.0 404 Not Found"); - echo $msg; - exit(0); - } - - public static function send404($uri){ - header("HTTP/1.0 404 Not Found"); - echo "LODSPeaKr could not find ".$uri." or information about it.\nNo URIs in the triple store, or services configured with that URI\n"; - exit(0); - } - - public static function send406($uri){ - header("HTTP/1.0 406 Not Acceptable"); - echo "LODSPeaKr can't find a representation suitable for the content type you accept\n\n"; - exit(0); - } - - public static function send500($msg = null){ - header("HTTP/1.0 500 Internal Server Error"); - echo "An internal error ocurred. Please try later\n\n"; - if($msg != null){ - echo $msg; - } - exit(0); - } - -======= - ->>>>>>> 190d4897be9d90712085169270a6e105600063f5 public static function uri2curie($uri){ global $conf; $ns = $conf['ns']; diff --git a/classes/modules/sessionModule.php b/classes/modules/sessionModule.php index bf2367e6..1d8e52eb 100644 --- a/classes/modules/sessionModule.php +++ b/classes/modules/sessionModule.php @@ -22,9 +22,10 @@ class SessionModule extends abstractModule{ if($this->validateAuthentication($_POST)){ session_start(); $_SESSION['lodspk'] = 1; - Utils::send303($conf['basedir'], ''); + HTTPStatus::send303($conf['basedir'], ''); + return false; }else{ - Utils::send401("Authentication not valid."); + HTTPStatus::send401("Authentication not valid."); return true; } } @@ -33,7 +34,7 @@ class SessionModule extends abstractModule{ if(isset($_SESSION['lodspk'])){ return false; }else{ - Utils::send303($conf['basedir'].$this->sessionUri, ''); + HTTPStatus::send303($conf['basedir'].$this->sessionUri, ''); return true; } } diff --git a/doc/examples/originalComponents/services/instances/html.queries/main.query b/doc/examples/originalComponents/services/instances/queries/main.query similarity index 100% rename from doc/examples/originalComponents/services/instances/html.queries/main.query rename to doc/examples/originalComponents/services/instances/queries/main.query -- GitLab