function RunService()
 {
     $ci =& get_instance();
     $wsdl_is_set = (isset($_REQUEST['wsdl']) or isset($_REQUEST['WSDL']));
     //if the POST request contains the SoapACTION parameter
     $action_is_set = isset($_SERVER['HTTP_SOAPACTION']);
     //if the query string contains ?op
     $op_is_set = isset($_REQUEST['op']);
     //when the SOAPAction is set, call the appropriate web method
     if ($action_is_set == 1) {
         $action_name = $_SERVER['HTTP_SOAPACTION'];
         $action_name2 = str_replace('"', "", $action_name);
         //removes quotes
         $action = substr($action_name2, strlen('http://www.cuahsi.org/his/1.1/ws/'));
         //read the input parameters
         $postdata = file_get_contents('php://input');
         $authtoken = wof_read_authtoken($postdata);
         //load authToken
         $validToken = $ci->config->item('auth_token');
         if ($validToken == "" || $validToken != "" && $validToken == $authtoken) {
             header('Content-Type: text/html; charset=utf-8');
             if ($action == 'GetSiteInfo') {
                 $site = wof_read_parameter($postdata, 'site');
                 GetSiteInfo($site);
                 exit;
             } elseif ($action == 'GetSiteInfoMultpleObject') {
                 $site = wof_read_array_parameter($postdata, 'site');
                 $siteArray = $site == "" ? array() : explode(",", $site);
                 GetSiteInfoMultpleObject($siteArray);
                 exit;
             } elseif ($action == 'GetSiteInfoObject') {
                 $site = wof_read_parameter($postdata, 'site');
                 GetSiteInfoObject($site);
                 exit;
             } elseif ($action == 'GetSites') {
                 $site = wof_read_array_parameter($postdata, 'site');
                 $siteArray = $site == "" ? array() : explode(",", $site);
                 GetSites($siteArray);
                 exit;
             } elseif ($action == 'GetSitesByBoxObject') {
                 $north = wof_read_parameter($postdata, 'north');
                 $south = wof_read_parameter($postdata, 'south');
                 $east = wof_read_parameter($postdata, 'east');
                 $west = wof_read_parameter($postdata, 'west');
                 $IncludeSeries = wof_read_parameter($postdata, 'includeseries');
                 GetSitesByBoxObject($north, $south, $east, $west, $IncludeSeries);
                 exit;
             } elseif ($action == 'GetSitesObject') {
                 $site = wof_read_array_parameter($postdata, 'site');
                 $siteArray = $site == "" ? array() : explode(",", $site);
                 GetSitesObject($siteArray);
                 exit;
             } elseif ($action == 'GetValues') {
                 $location = wof_read_parameter($postdata, 'location');
                 $variable = wof_read_parameter($postdata, 'variable');
                 $startDate = wof_read_parameter($postdata, 'startDate');
                 $endDate = wof_read_parameter($postdata, 'endDate');
                 GetValues($location, $variable, $startDate, $endDate);
                 exit;
             } elseif ($action == 'GetValuesForASiteObject') {
                 $site = wof_read_parameter($postdata, 'site');
                 $startDate = wof_read_parameter($postdata, 'startDate');
                 $endDate = wof_read_parameter($postdata, 'endDate');
                 GetValuesForASiteObject($site, $startDate, $endDate);
                 exit;
             } elseif ($action == 'GetValuesObject') {
                 $location = wof_read_parameter($postdata, 'location');
                 $variable = wof_read_parameter($postdata, 'variable');
                 $startDate = wof_read_parameter($postdata, 'startDate');
                 $endDate = wof_read_parameter($postdata, 'endDate');
                 GetValuesObject($location, $variable, $startDate, $endDate);
                 exit;
             } elseif ($action == 'GetVariableInfo') {
                 $variable = wof_read_parameter($postdata, 'variable');
                 GetVariableInfo($variable);
                 exit;
             } elseif ($action == 'GetVariableInfoObject') {
                 $variable = wof_read_parameter($postdata, 'variable');
                 GetVariableInfoObject($variable);
                 exit;
             } elseif ($action == 'GetVariables') {
                 GetVariables();
                 exit;
             } elseif ($action == 'GetVariablesObject') {
                 GetVariablesObject();
                 exit;
             } else {
                 echo "ACTION NOT FOUND!! " . $action;
                 exit;
             }
         } else {
             header("Status: 401 Unauthorized");
             header("Content-type: text/plain");
             echo "HTTP/1.0 401 Unauthorized";
         }
     } elseif ($op_is_set == 1) {
         //when the op parameter is set, return the web method test page
         $operation_name = $_REQUEST['op'];
         $name_file = APPPATH . 'views/operations/operation_' . $operation_name . '.html';
         $name = @implode('', @file(APPPATH . 'views/operations/operation_' . $operation_name . '.html'));
         // send the right headers
         $complete_uri = $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
         $absolute_uri = "http://" . substr($complete_uri, 0, strrpos($complete_uri, '/')) . "/cuahsi_1_1.asmx";
         $pattern = "/ABSOLUTEURI_TO_REPLACE/";
         $name2 = preg_replace($pattern, $absolute_uri, $name);
         header("Content-Type: text/html");
         header("Content-Length: " . filesize($name_file));
         echo $name2;
         exit;
     } elseif ($wsdl_is_set == 1) {
         //when the WSDL query string document is set, return the WSDL
         // Return the WSDL
         $wsdl = @implode('', @file(APPPATH . 'views/wateroneflow.wsdl'));
         if (strlen($wsdl) > 1) {
             //replace the absolute uri
             //$absolute_uri = "http://localhost:333/HIS/hydroserver/webservice/cuahsi_1_1.php";
             $complete_uri = $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
             $absolute_uri = "http://" . substr($complete_uri, 0, strrpos($complete_uri, '/')) . "/cuahsi_1_1.asmx";
             $pattern = "/ABSOLUTEURI_TO_REPLACE/";
             $wsdl2 = preg_replace($pattern, $absolute_uri, $wsdl);
             header("Content-type: text/xml");
             echo $wsdl2;
             exit;
         } else {
             header("Status: 500 Internal Server Error");
             header("Content-type: text/plain");
             echo "HTTP/1.0 500 Internal Server Error";
         }
     } else {
         header("Content-Type: text/html");
         $asmx_file_name = APPPATH . 'views/asmx_page.html';
         header("Content-Length: " . filesize($asmx_file_name));
         header("File-Name: " . $asmx_file_name);
         // display the file and stop this script
         readfile($asmx_file_name);
         exit;
     }
 }
Example #2
0
	Header("Location: index.php?".Change_URL_Query("q", "pi_forbid"));
	Die();
	}
?>

<FONT class="h2"><?Print $text_edit_plugin;?></FONT>

<BR><BR>

<?
IF($_GET['word']) {
	$query  = "SELECT * FROM pi_forbid \n";
	$query .= "WHERE `word` LIKE '".$_GET['word']."'";
	$result = $DB_hub->Query($query);
	$row = $result->Fetch_Assoc();
	$flags = GetValues($row['check_mask']);
	}
?>

<FORM action="index.php?<?Print $_SERVER['QUERY_STRING'];?>" method="post">
<TABLE class="b1 fs9px">
	<TR>
		<TD class="bg_light right b"><?Print $text_word;?> : </TD>
		<TD class="bg_light"><INPUT name="word" class="w300px" type="text" value="<?Print $row['word'];?>"></TD>
	</TR><TR>
		<TD class="bg_light right b"><?Print $text_check_mask;?> : </TD>
		<TD class="bg_light">
       			<INPUT class="b0" id="flags_1" name="flags[1]" type="checkbox" value=1<?IF($flags[0]) {Print " checked";}?>><LABLE for="flag_1"><?Print $text_word_flag_1;?></LABLE><BR>
			<INPUT class="b0" id="flags_2" name="flags[2]" type="checkbox" value=2<?IF($flags[1]) {Print " checked";}?>><LABLE for="flag_2"><?Print $text_word_flag_2;?></LABLE><BR>
			<INPUT class="b0" id="flags_4" name="flags[4]" type="checkbox" value=4<?IF($flags[2]) {Print " checked";}?>><LABLE for="flag_4"><?Print $text_word_flag_4;?></LABLE><BR>
                 </TD>
	Header("Location: index.php?".Change_URL_Query("q", "file_trigger"));
	Die();
	}
?>
	
<FONT class="h2"><?Print $text_edit_trigger;?></FONT>

<BR><BR>

<?
IF($_GET['command']) {
	$query  = "SELECT * FROM file_trigger \n";
	$query .= "WHERE `command` LIKE '".$_GET['command']."'";
	$result = $DB_hub->Query($query);
	$row = $result->Fetch_Assoc();
	$flags = GetValues($row['flags']);
	}
?>

<FORM action="index.php?<?Print $_SERVER['QUERY_STRING'];?>" method="post">
<TABLE class="b1 fs9px">
	<TR>
		<TD class="bg_light right b"><?Print $text_command;?> : </TD>
		<TD class="bg_light"><INPUT name="command" class="w300px" type="text" value="<?Print $row['command'];?>"></TD>
	</TR><TR>
		<TD class="bg_light right b"><?Print $text_send_as;?> : </TD>
		<TD class="bg_light"><INPUT name="send_as" class="w300px" type="text" value="<?Print $row['send_as'];?>"></TD>
	</TR><TR>
		<TD class="bg_light right b"><?Print $text_min_class;?> : </TD>
		<TD class="bg_light">
			<SELECT name="min_class">
Example #4
0
location.replace(\"selectdb.php\");

--></SCRIPT>";

Include "library.php";

IF($mysql['HUB']['multi']==1) $DB_hub = NEW VA_MySQL($mysql['HUB']['host'], $mysql['HUB']['user'], $mysql['HUB']['password'], $database);
ELSE $DB_hub = NEW VA_MySQL($mysql['HUB']['host'], $mysql['HUB']['user'], $mysql['HUB']['password'], $mysql['HUB']['database']);
$VA_setup[] = "";
$VA_setup = Array_Merge($VA_setup, GetConfig($DB_hub, 'VerliAdmin'));
$VH_setup = GetConfig($DB_hub, 'config');

Include "version.php";
Include "language.php";

$debug = GetValues($VA_setup['debug']);

IF($debug[0])
	{Error_Reporting(E_ALL ^ E_NOTICE);}
ELSEIF($debug[1])
	{Error_Reporting(E_ALL);}
ELSE
	{Error_Reporting(0);}


IF($VA_setup['version'] < VA_COUNT) {
	$update_OK = FALSE;
	Include "update.php";
	}

$pw_ch_suc = TRUE;