예제 #1
0
파일: restnewticket.php 프로젝트: dg-wfk/dl
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)));
}
예제 #2
0
파일: restnewgrant.php 프로젝트: dg-wfk/dl
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)));
}
예제 #3
0
    $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'])) {
예제 #4
0
파일: newgrant.php 프로젝트: dg-wfk/dl
<?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";
}
예제 #5
0
파일: editticket.php 프로젝트: dg-wfk/dl
    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";
}
예제 #6
0
파일: newticket.php 프로젝트: dg-wfk/dl
<?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";
}
예제 #7
0
/**
 * 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'];