diff options
author | Simon Rettberg | 2016-04-29 20:55:59 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-04-29 20:55:59 +0200 |
commit | cbd23b7d191327a7cfb6a98e657659045da71af3 (patch) | |
tree | f029ab85c3ac07d3f2a56b4359fd36c265898d6d /apis/webservice.inc.php | |
parent | More Progress; Merged changes from ufpr up to 775cdbd29f5d0f70946d1d5ff09c091... (diff) | |
download | slx-admin-cbd23b7d191327a7cfb6a98e657659045da71af3.tar.gz slx-admin-cbd23b7d191327a7cfb6a98e657659045da71af3.tar.xz slx-admin-cbd23b7d191327a7cfb6a98e657659045da71af3.zip |
Second half of merge....
Diffstat (limited to 'apis/webservice.inc.php')
-rw-r--r-- | apis/webservice.inc.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/apis/webservice.inc.php b/apis/webservice.inc.php new file mode 100644 index 00000000..42ff674b --- /dev/null +++ b/apis/webservice.inc.php @@ -0,0 +1,34 @@ +<?php +// print results, insert id or affected row count +session_start(); + +if(!isset($_POST['request'])){ + echo json_encode(array( + "errormsg"=>"Request not set, finishing session", + "status" => "error", + "msg" => "")); + session_unset(); + session_destroy(); +}else if($_POST['request']=='logout'){ + echo json_encode(array( + "errormsg"=> "", + "status" => "ok", + "msg" => "Logout successful")); + session_unset(); + session_destroy(); + +}else { + $target_dir = "tmpUploads/"; + $requests = array("login","getinfo","upload","newupload"); + if( in_array($_POST['request'],$requests )) + require("webservice/".$_POST['request'].".php"); + else{ + echo json_encode(array( + "errormsg"=> "Request don't exist, finishing session", + "status" => "error", + "msg" => "")); + session_unset(); + session_destroy(); + } +} +//TODO: analyze session unset/destroy |