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("DatasetUpdate.php"); 00036 include_once("../../auth/validator/AuthValidator.php"); 00037 include_once("../../auth/registrar/access/AuthRegistrarAccess.php"); 00038 00039 include_once("../../framework/Logger.php"); 00040 00041 00042 // URI for the dataset 00043 $uri = ""; 00044 00045 if(isset($_POST['uri'])) 00046 { 00047 $uri = $_POST['uri']; 00048 } 00049 00050 // Title of the dataset (optional) 00051 $title = ""; 00052 00053 if(isset($_POST['title'])) 00054 { 00055 $title = $_POST['title']; 00056 00057 if($title == "") 00058 { 00059 $title = "-delete-"; 00060 } 00061 } 00062 00063 // Description of the dataset (optional) 00064 $description = ""; 00065 00066 if(isset($_POST['description'])) 00067 { 00068 $description = $_POST['description']; 00069 00070 if($description == "") 00071 { 00072 $description = "-delete-"; 00073 } 00074 } 00075 00076 // List of contributor URIs (optional) 00077 $contributors = ""; 00078 00079 if(isset($_POST['contributors'])) 00080 { 00081 $contributors = $_POST['contributors']; 00082 00083 if($contributors == "") 00084 { 00085 $contributors = "-delete-"; 00086 } 00087 } 00088 00089 // Modification date (optional) 00090 $modified = ""; 00091 00092 if(isset($_POST['modified'])) 00093 { 00094 $modified = $_POST['modified']; 00095 00096 if($modified == "") 00097 { 00098 $modified = "-delete-"; 00099 } 00100 } 00101 00102 $mtime = microtime(); 00103 $mtime = explode(' ', $mtime); 00104 $mtime = $mtime[1] + $mtime[0]; 00105 $starttime = $mtime; 00106 00107 $start_datetime = date("Y-m-d h:i:s"); 00108 00109 $requester_ip = "0.0.0.0"; 00110 00111 if(isset($_SERVER['REMOTE_ADDR'])) 00112 { 00113 $requester_ip = $_SERVER['REMOTE_ADDR']; 00114 } 00115 00116 // Optional IP 00117 $registered_ip = ""; 00118 00119 if(isset($_GET['registered_ip'])) 00120 { 00121 $registered_ip = $_GET['registered_ip']; 00122 } 00123 00124 $parameters = ""; 00125 00126 if(isset($_SERVER['REQUEST_URI'])) 00127 { 00128 $parameters = $_SERVER['REQUEST_URI']; 00129 00130 $pos = strpos($parameters, "?"); 00131 00132 if($pos !== FALSE) 00133 { 00134 $parameters = substr($parameters, $pos, strlen($parameters) - $pos); 00135 } 00136 } 00137 elseif(isset($_SERVER['PHP_SELF'])) 00138 { 00139 $parameters = $_SERVER['PHP_SELF']; 00140 } 00141 00142 $ws_du = new DatasetUpdate($uri, $title, $description, $contributors, $modified, $registered_ip, $requester_ip); 00143 00144 $ws_du->ws_conneg($_SERVER['HTTP_ACCEPT'], $_SERVER['HTTP_ACCEPT_CHARSET'], $_SERVER['HTTP_ACCEPT_ENCODING'], 00145 $_SERVER['HTTP_ACCEPT_LANGUAGE']); 00146 00147 $ws_du->process(); 00148 00149 $ws_du->ws_respond($ws_du->ws_serialize()); 00150 00151 $mtime = microtime(); 00152 $mtime = explode(" ", $mtime); 00153 $mtime = $mtime[1] + $mtime[0]; 00154 $endtime = $mtime; 00155 $totaltime = ($endtime - $starttime); 00156 00157 $logger = new Logger("dataset_update", $requester_ip, 00158 "?uri=" . $uri . "&title=" . substr($title, 0, 64) . "&description=" . substr($description, 0, 64) . "&modified=" 00159 . $modified . "&requester_ip=$requester_ip", $_SERVER['HTTP_ACCEPT'], $start_datetime, $totaltime, 00160 $ws_du->pipeline_getResponseHeaderStatus(), $_SERVER['HTTP_USER_AGENT']); 00161 00162 00164 00165 ?>
