Skip to content
Snippets Groups Projects
Commit 3cd13dee authored by alvaro's avatar alvaro
Browse files

Session works now

parent 0fb71c37
No related branches found
No related tags found
No related merge requests found
<?
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'];
......
......@@ -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;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment