コード例 #1
0
ファイル: status.php プロジェクト: jasanders/os-aios
function SavePostParam()
{
    global $_REQUEST, $editpostparamid;
    $postprocessconfig = LoadPostProcessConfig($config);
    if (!isset($postprocessconfig)) {
        $upload_status = '<font color="red">Could not load configuration of post-processing script</font>';
        SetCookie("upload_status", $upload_status, time() + 30);
        // expire in 30 seconds
        Redirect('index.php');
        return;
    }
    MergeSettings($config, $_REQUEST);
    foreach ($config as $section) {
        if ($section->category == CATEGORY_PPPARAMETERS) {
            foreach ($section->options as $option) {
                $res = GetRequest('editqueue', array('GroupSetParameter', (int) 0, $option->name . '=' . $option->value, (int) $editpostparamid));
                if (!$res) {
                    $upload_status = '<font color="red">Could not change post-processing parameters</font>';
                    SetCookie("upload_status", $upload_status, time() + 30);
                    // expire in 30 seconds
                    Redirect('index.php');
                    return;
                }
            }
        }
    }
    Redirect('index.php');
}
コード例 #2
0
ファイル: imos-lambda.php プロジェクト: sulume/imos-lambda
        $base_price = 1.667E-5;
        // 1GB RAM / sec.
        $usdjpy = 119.6;
        // 1 USD / JPY.
        $requests = $data['replicas'] ?: 1;
        $billed_duration = floatval($data['stats']['Billed Duration']);
        $memory_size = floatval($data['stats']['Memory Size']);
        $price = ($memory_size / 1024 * $base_price * $billed_duration / 1000 + $request_price * $requests) * $usdjpy;
        fprintf(STDERR, "Price: %.4f JPY\n", $price);
    }
}
$replicas = 1;
if (isset($_ENV['IMOS_LAMBDA_REPLICAS'])) {
    $replicas = intval($_ENV['IMOS_LAMBDA_REPLICAS']);
}
$request = GetRequest($argv);
$reqest['replicas'] = $replicas;
$promises = [];
for ($replica_index = 0; $replica_index < $replicas; $replica_index++) {
    $request['replica_index'] = $replica_index;
    $promises[$replica_index] = InvokeLambdaAsync($_ENV['IMOS_LAMBDA_FUNCTION'], $request);
}
$failed = false;
$stats = [];
for ($replica_index = 0; $replica_index < $replicas; $replica_index++) {
    $result = GetLambdaResult($promises[$replica_index]);
    $stats[$replica_index] = $result['stats'];
    unset($result['stats']);
    if (isset($_ENV['IMOS_LAMBDA_PRINT'])) {
        if (!isset($result[$_ENV['IMOS_LAMBDA_PRINT']])) {
            $failed = true;
コード例 #3
0
ファイル: lib_order.php プロジェクト: norain2050/benhu
function get_cart_table()
{
    $getPara = GetRequest();
    if (!empty($getPara['buyType'])) {
        $buyType = $getPara['buyType'];
    }
    switch ($buyType) {
        case 'buy_now':
            $cart_table = 'cart_buy_now';
            break;
        default:
            $cart_table = 'cart';
            break;
    }
    return $cart_table;
}
コード例 #4
0
ファイル: main.action.php プロジェクト: GeoPvN/winstone
$action = $_REQUEST['act'];
$error = '';
$data = '';
$id = $_REQUEST['id'];
switch ($action) {
    case 'get_add_page':
        $number = $_REQUEST['number'];
        $page = GetPage($res = '', $number);
        $data = array('page' => $page);
        break;
    case 'disable':
        mysql_query("DELETE FROM `request`\r\n\t\t\t\t\t\tWHERE id={$id}");
        break;
    case 'get_edit_page':
        $req_id = $_REQUEST['id'];
        $page = GetPage(GetRequest($req_id));
        $data = array('page' => $page);
        break;
    case 'get_list':
        $count = $_REQUEST['count'];
        $hidden = $_REQUEST['hidden'];
        mysql_query("SET @i = 0;");
        $rResult = mysql_query("SELECT `id`,\r\n\t\t\t\t\t\t\t  \t\t\t@i := @i + 1 AS `iterator`,\r\n                                       `date`,\r\n                                       `phone`,\r\n\t\t\t\t\t\t\t\t\t\tCASE\tWHEN `info_category` = '0'  THEN  'ინფორმაცია'\r\n\t\t\t\t\t\t\t\t\t\tWHEN `info_category` = '1'  THEN  'პრეტენზია'\r\n\t\t\t\t\t\t\t\t\t\tWHEN `info_category` = '2'  THEN  'სხვა'\r\n\t\t\t\t\t\t\t\tEND \tAS requester\r\n\t\t\t\t\t\t\t    FROM   `request`");
        $data = array("aaData" => array());
        while ($aRow = mysql_fetch_array($rResult)) {
            $row = array();
            for ($i = 0; $i < $count; $i++) {
                /* General output */
                $row[] = $aRow[$i];
                if ($i == $count - 1) {
                    $row[] = '<input type="checkbox" name="check_' . $aRow[$hidden] . '" class="check" value="' . $aRow[$hidden] . '" />';
コード例 #5
0
ファイル: index.php プロジェクト: robyoung/war-and-peace
<?php

require 'inc/config.php';
include 'lib/Smarty/Smarty.class.php';
$smarty = new Smarty();
$smarty->caching = false;
$smarty->template_dir = $config['path'] . 'smarty/templates';
$smarty->compile_dir = $config['path'] . 'smarty/templates_c';
$smarty->cache_dir = $config['path'] . 'smarty/cache';
$smarty->config_dir = $config['path'] . 'smarty/configs';
function GetRequest($var, $default = false)
{
    return isset($_REQUEST[$var]) ? $_REQUEST[$var] : $default;
}
$module = GetRequest('module');
if (file_exists('modules/' . $module . '.php')) {
    include 'modules/' . $module . '.php';
}
$smarty->assign('config', $config);
if (!isset($tpl)) {
    $tpl = 'index';
}
$smarty->display($tpl . '.tpl');
コード例 #6
0
ファイル: mini.php プロジェクト: hank/nzbgetweb
            $edittext = '';
            if (isset($_REQUEST['edittext'])) {
                $edittext = $_REQUEST['edittext'];
            }
            GetRequest("editqueue", array($action, (int) $_REQUEST['offset'], $edittext, (int) $_REQUEST['id']));
            if ($action == "groupresume") {
                GetRequest("editqueue", array("grouppauseextrapars", (int) $_REQUEST['offset'], '', (int) $_REQUEST['id']));
            }
        } else {
            GetRequest($action, "");
        }
    }
}
if (isset($_REQUEST['rate'])) {
    //set max download option
    GetRequest("rate", (int) $_REQUEST['rate']);
}
if (isset($_FILES['nzbfile'])) {
    $upload_status = upload_file($_FILES['nzbfile']);
    SetCookie("upload_status", $upload_status, time() + 30);
    // expire in 30 seconds
    Redirect($LoginRedirectPage);
}
$page = 0;
if (isset($_REQUEST['page'])) {
    $page = $_REQUEST['page'];
    SetCookie("c_page", $page, 0);
} else {
    if (isset($_COOKIE['c_page'])) {
        $page = (int) $_COOKIE['c_page'];
    }
コード例 #7
0
ファイル: index.php プロジェクト: JeffM2501/HackSharp
         exit;
     }
     $pass = $pass[0]['PassHash'];
     $hash = mysql_real_escape_string(md5($pass1));
     if ($pass != $hash) {
         echo "BAD";
         exit;
     }
     $token = rand();
     DBSetSingleField("UID", $id, "Users", "Token", $token);
     echo "OK {$id} {$token}";
     exit;
 } else {
     if ($action == "token") {
         $id = GetRequest("id");
         $token = GetRequest("token");
         $tokens = DBQuery($db, "SELECT Token FROM Users WHERE UID={$id}");
         if ($tokens == FALSE) {
             echo "BAD";
             exit;
         }
         $t = $tokens[0]['Token'];
         DBSetSingleField("UID", $id, "Users", "Token", 0);
         if ($token == $t) {
             echo "OK";
         } else {
             echo "BAD";
         }
         exit;
     }
 }
コード例 #8
0
ファイル: functions.php プロジェクト: hank/nzbgetweb
function FetchFromNewzbin($id)
{
    $errmsg = GetNzbFromNewzbin($id);
    if ($errmsg) {
        return "<b><font color=red>Error:</font></b>\n{$errmsg}";
    } else {
        GetRequest('scan', '');
        return "<b><font color=green>Report ID: {$id} fetched</font></b>";
    }
}