index.php
Go to the documentation of this file.
00001 <?php 00002 00005 00018 ini_set("display_errors", 00019 "Off"); // Don't display errors to the users. Set it to "On" to see errors for debugging purposes. 00020 00021 ini_set("memory_limit", "64M"); 00022 00023 00024 // Database connectivity procedures 00025 include_once("../../framework/db.php"); 00026 00027 // Content negotion class 00028 include_once("../../framework/Conneg.php"); 00029 00030 // The Web Service parent class 00031 include_once("../../framework/WebService.php"); 00032 00033 include_once("../../framework/ProcessorXML.php"); 00034 00035 include_once("AuthValidator.php"); 00036 00037 include_once("../../framework/Logger.php"); 00038 00039 00040 // IP of the requester 00041 $ip = ""; 00042 00043 if(isset($_POST['ip'])) 00044 { 00045 $ip = $_POST['ip']; 00046 } 00047 00048 // Requested dataset(s) 00049 $datasets = ""; 00050 00051 if(isset($_POST['datasets'])) 00052 { 00053 $datasets = $_POST['datasets']; 00054 } 00055 00056 // URI of the requested web service 00057 $ws_uri = ""; 00058 00059 if(isset($_POST['ws_uri'])) 00060 { 00061 $ws_uri = $_POST['ws_uri']; 00062 } 00063 00064 $mtime = microtime(); 00065 $mtime = explode(' ', $mtime); 00066 $mtime = $mtime[1] + $mtime[0]; 00067 $starttime = $mtime; 00068 00069 $start_datetime = date("Y-m-d h:i:s"); 00070 00071 $requester_ip = "0.0.0.0"; 00072 00073 if(isset($_SERVER['REMOTE_ADDR'])) 00074 { 00075 $requester_ip = $_SERVER['REMOTE_ADDR']; 00076 } 00077 00078 $parameters = ""; 00079 00080 if(isset($_SERVER['REQUEST_URI'])) 00081 { 00082 $parameters = $_SERVER['REQUEST_URI']; 00083 00084 $pos = strpos($parameters, "?"); 00085 00086 if($pos !== FALSE) 00087 { 00088 $parameters = substr($parameters, $pos, strlen($parameters) - $pos); 00089 } 00090 } 00091 elseif(isset($_SERVER['PHP_SELF'])) 00092 { 00093 $parameters = $_SERVER['PHP_SELF']; 00094 } 00095 00096 $ws_av = new AuthValidator($ip, $datasets, $ws_uri); 00097 00098 $ws_av->ws_conneg($_SERVER['HTTP_ACCEPT'], $_SERVER['HTTP_ACCEPT_CHARSET'], $_SERVER['HTTP_ACCEPT_ENCODING'], 00099 $_SERVER['HTTP_ACCEPT_LANGUAGE']); 00100 00101 $ws_av->process(); 00102 00103 $ws_av->ws_respond($ws_av->ws_serialize()); 00104 00105 $mtime = microtime(); 00106 $mtime = explode(" ", $mtime); 00107 $mtime = $mtime[1] + $mtime[0]; 00108 $endtime = $mtime; 00109 $totaltime = ($endtime - $starttime); 00110 00111 $logger = new Logger("auth_validator", $requester_ip, "?ip=" . $ip . "&datasets=" . $datasets . "&ws_uri=" . $ws_uri, 00112 $_SERVER['HTTP_ACCEPT'], $start_datetime, $totaltime, $ws_av->pipeline_getResponseHeaderStatus(), 00113 $_SERVER['HTTP_USER_AGENT']); 00114 00115 00117 00118 ?>
