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("AuthRegistrarAccess.php"); 00036 include_once("../../validator/AuthValidator.php"); 00037 00038 include_once("../../../framework/Logger.php"); 00039 00040 00041 // IP being registered 00042 $registered_ip = ""; 00043 00044 if(isset($_POST['registered_ip'])) 00045 { 00046 $registered_ip = $_POST['registered_ip']; 00047 } 00048 00049 // CRUD access 00050 $crud = ""; 00051 00052 if(isset($_POST['crud'])) 00053 { 00054 $crud = $_POST['crud']; 00055 } 00056 00057 00058 // Web service access(es) 00059 $ws_uris = ""; 00060 00061 if(isset($_POST['ws_uris'])) 00062 { 00063 $ws_uris = $_POST['ws_uris']; 00064 } 00065 00066 // Dataset access 00067 $dataset = ""; 00068 00069 if(isset($_POST['dataset'])) 00070 { 00071 $dataset = $_POST['dataset']; 00072 } 00073 00074 // Type of action 00075 $action = "create"; 00076 00077 if(isset($_POST['action'])) 00078 { 00079 $action = $_POST['action']; 00080 } 00081 00082 // URI of the access to update if action=update 00083 $target_access_uri = ""; 00084 00085 if(isset($_POST['target_access_uri'])) 00086 { 00087 $target_access_uri = $_POST['target_access_uri']; 00088 } 00089 00090 $mtime = microtime(); 00091 $mtime = explode(' ', $mtime); 00092 $mtime = $mtime[1] + $mtime[0]; 00093 $starttime = $mtime; 00094 00095 $start_datetime = date("Y-m-d h:i:s"); 00096 00097 $requester_ip = "0.0.0.0"; 00098 00099 if(isset($_SERVER['REMOTE_ADDR'])) 00100 { 00101 $requester_ip = $_SERVER['REMOTE_ADDR']; 00102 } 00103 00104 $parameters = ""; 00105 00106 if(isset($_SERVER['REQUEST_URI'])) 00107 { 00108 $parameters = $_SERVER['REQUEST_URI']; 00109 00110 $pos = strpos($parameters, "?"); 00111 00112 if($pos !== FALSE) 00113 { 00114 $parameters = substr($parameters, $pos, strlen($parameters) - $pos); 00115 } 00116 } 00117 elseif(isset($_SERVER['PHP_SELF'])) 00118 { 00119 $parameters = $_SERVER['PHP_SELF']; 00120 } 00121 00122 $ws_araccess = 00123 new AuthRegistrarAccess($crud, $ws_uris, $dataset, $action, $target_access_uri, $registered_ip, $requester_ip); 00124 00125 $ws_araccess->ws_conneg($_SERVER['HTTP_ACCEPT'], $_SERVER['HTTP_ACCEPT_CHARSET'], $_SERVER['HTTP_ACCEPT_ENCODING'], 00126 $_SERVER['HTTP_ACCEPT_LANGUAGE']); 00127 00128 $ws_araccess->process(); 00129 00130 $ws_araccess->ws_respond($ws_araccess->ws_serialize()); 00131 00132 $mtime = microtime(); 00133 $mtime = explode(" ", $mtime); 00134 $mtime = $mtime[1] + $mtime[0]; 00135 $endtime = $mtime; 00136 $totaltime = ($endtime - $starttime); 00137 00138 $logger = new Logger("auth_registrar_access", $requester_ip, 00139 "?crud=" . $crud . "&ws_uris=" . $ws_uris . "&dataset=" . $dataset . "$action=" . $action . "&target_access_uri=" 00140 . $target_access_uri . "®istered_ip=" . $registered_ip . "&requester_ip=$requester_ip", $_SERVER['HTTP_ACCEPT'], 00141 $start_datetime, $totaltime, $ws_araccess->pipeline_getResponseHeaderStatus(), $_SERVER['HTTP_USER_AGENT']); 00142 00143 00145 00146 ?>
