function newticket($msg, $params = null) { global $ticketRestParams; // handle the upload itself $DATA = $validated = false; if (isset($_FILES["file"]) && is_uploaded_file($_FILES["file"]["tmp_name"]) && $_FILES["file"]["error"] == UPLOAD_ERR_OK && ($validated = validateParams($ticketRestParams, $msg))) { $DATA = handleUpload($_FILES["file"], $msg); } if ($DATA === false) { // ticket creation unsucessfull if ($validated && !empty($_FILES["file"]) && !empty($_FILES["file"]["name"])) { $err = uploadErrorStr($_FILES["file"]); logError("ticket upload failure: {$err}"); return array('httpInternalError', $err); } elseif (!$validated) { logError('invalid ticket parameters'); return array('httpBadRequest', 'bad parameters'); } else { // errors already generated in handleUpload return array('httpInternalError', 'internal error'); } } // return ticket instance return array(false, array("id" => $DATA['id'], "url" => ticketUrl($DATA))); }
function newgrant($msg, $params = null) { global $grantRestParams; // handle the request $DATA = false; if ($validated = validateParams($grantRestParams, $msg)) { $DATA = handleGrant($msg); } if ($DATA === false) { // grant creation unsucessfull if ($validated) { logError('invalid grant parameters'); return array('httpInternalError', 'internal error'); } else { // errors already generated in handleGrant return array('httpBadRequest', 'bad parameters'); } } // return grant instance return array(false, array("id" => $DATA['id'], "url" => grantUrl($DATA))); }
$uuidURL = $_REQUEST['u']; } else { $uuidURL = NULL; } if (validateParams('shareId')) { $shareId = $_REQUEST['shareId']; } else { $shareId = NULL; } if ($type === 'l') { $sharedPree = TRUE; } else { $sharedPree = FALSE; } /* NOTE: if debug=true then PHP will echo variables and exit */ if (validateParams('debug')) { $debug = TRUE; } else { $debug = FALSE; } $errorMessage = NULL; $appleTouchIcon60URL = NULL; $isPrivate = FALSE; $canCreateAnonymousUser = FALSE; $apiURL = $protocol . $server . "/apptsvc/rest/pree/retrieveSitelette?UID=&latitude=&longitude="; $siteletteJSON = makeApiCall($apiURL); if ($siteletteJSON['curl_error']) { $errorMessage = $siteletteJSON['curl_error']; $errorMessage = 'Service unavailable.'; } else { if (isset($siteletteJSON['error'])) {
<?php // process a grant request require_once "grantfuncs.php"; // handle the request $DATA = false; if (validateParams($grantNewParams, $_POST)) { // uniform the request parameters to the REST api if (isset($_POST['grant_totaldays'])) { $_POST['grant_total'] = (int) ($_POST['grant_totaldays'] * 3600 * 24); } if (isset($_POST['ticket_totaldays'])) { $_POST['ticket_total'] = (int) ($_POST['ticket_totaldays'] * 3600 * 24); } if (isset($_POST['ticket_lastdldays'])) { $_POST['ticket_lastdl'] = (int) ($_POST['ticket_lastdldays'] * 3600 * 24); } $DATA = handleGrant($_POST); } // resulting page if ($DATA !== false) { include "newgrantr.php"; } else { include "newgrants.php"; }
onTicketUpdate($DATA); return $DATA; } // fetch the ticket id and check for permissions $DATA = false; $id =& $_REQUEST['id']; if (empty($id) || !isTicketId($id)) { $id = false; } else { $sql = "SELECT * FROM ticket WHERE id = " . $db->quote($id); $DATA = $db->query($sql)->fetch(); if ($DATA === false || isTicketExpired($DATA) || !$auth["admin"] && $DATA["user_id"] != $auth["id"]) { $DATA = false; } } // handle update if ($DATA) { if (validateParams($ticketEditParams, $_POST)) { // if update succeeds, return to listings if (handleUpdate($id)) { $DATA = false; } } } // resulting page $src = array_key_exists(@$_REQUEST['src'], $pages) ? $_REQUEST['src'] : 'tlist'; if ($DATA === false) { header("Location: " . tokenUrl($adminPath, array('a' => $src))); } else { include "edittickets.php"; }
<?php // process a file submission require_once "ticketfuncs.php"; // handle the request $DATA = false; if (isset($_FILES["file"]) && is_uploaded_file($_FILES["file"]["tmp_name"]) && $_FILES["file"]["error"] == UPLOAD_ERR_OK && validateParams($ticketNewParams, $_POST)) { // uniform the request parameters to the REST api if (isset($_POST['ticket_totaldays'])) { $_POST['ticket_total'] = (int) ($_POST['ticket_totaldays'] * 3600 * 24); } if (isset($_POST['ticket_lastdldays'])) { $_POST['ticket_lastdl'] = (int) ($_POST['ticket_lastdldays'] * 3600 * 24); } if (isset($_POST['ticket_permanent'])) { $_POST['permanent'] = !empty($_POST['ticket_permanent']); } $DATA = handleUpload($_FILES["file"], $_POST); } // resulting page if ($DATA !== false) { include "newticketr.php"; } else { include "newtickets.php"; }
/** * Global property : $_SEPARATOR * {String} The character used to separate values since sometimes spaces " " * and comma "," can be used. */ $_SEPARATOR = "#"; /** * Global property : $_MSVERSION * {Integer} The version of mapserver used. */ $_MSVERSION = ms_GetVersionInt(); //var_dump($_GET); /*************************/ /* PARAMETERS VALIDATION */ /*************************/ validateParams(); /**********************/ /* PARAMETERS PARSING */ /**********************/ /** * Each parameter is assigned to a variable, ready to be used. */ $aszExtents = explode(",", $_GET['BBOX']); if ($aszExtents && count($aszExtents) == 4) { $minx = min($aszExtents[0], $aszExtents[2]); $miny = min($aszExtents[1], $aszExtents[3]); $maxx = max($aszExtents[0], $aszExtents[2]); $maxy = max($aszExtents[1], $aszExtents[3]); } $szSRS = $_GET['SRS']; $szScale = $_GET['SCALE'];