コード例 #1
0
ファイル: request_test.php プロジェクト: ahelsing/geni-portal
function test_requests_for_url($url, $context_type, $context_id)
{
    global $signer;
    $insert_result = create_request($url, $signer, $context_type, $context_id, RQ_REQUEST_TYPE::JOIN, 'foobar', '');
    error_log("IR = " . print_r($insert_result, true));
    $request_id = $insert_result;
    $rows = get_requests_for_context($url, $signer, $context_type, $context_id);
    dump_rows($rows);
    $rows = get_requests_by_user($url, $signer, $signer->account_id, $context_type, $context_id);
    dump_rows($rows);
    $row = get_request_by_id($url, $signer, $request_id, $context_type);
    dump_row($row);
    $num_pending = get_number_of_pending_requests_for_user($url, $signer, $signer->account_id, $context_type, $context_id);
    error_log("Num_pending(pre) = " . print_r($num_pending, true));
    $pending = get_pending_requests_for_user($url, $signer, $signer->account_id, $context_type, $context_id);
    dump_rows($pending);
    resolve_pending_request($url, $signer, $context_type, $request_id, RQ_REQUEST_STATUS::APPROVED, 'resolved');
    $num_pending = get_number_of_pending_requests_for_user($url, $signer, $signer->account_id, $context_type, $context_id);
    error_log("Num_pending(post) = " . print_r($num_pending, true));
}
コード例 #2
0
        if (isset($dbs)) {
            $strOutput .= "host=" . $dbH . " user="******" pass="******" name=" . $dbn . "<br/>sql=" . $dbs . "</td></tr><tr><td>";
            if (isset($dumpfile)) {
                $strOutput .= dump_query($dbH, $dbu, $dbp, $dbn, $dbs, $dumpfile);
            } else {
                $strOutput .= display_query($dbH, $dbu, $dbp, $dbn, $dbs);
            }
        } else {
            if (isset($dbt)) {
                $strOutput .= "host=" . $dbH . " user="******" pass="******" name=" . $dbn . " table=" . $dbt;
                if ($dumpfile != "") {
                    $strOutput .= " dumpfile=" . $dumpfile;
                }
                $strOutput .= "</td></tr><tr><td> ";
                if (isset($dumpfile)) {
                    $strOutput .= dump_rows($dbH, $dbu, $dbp, $dbn, $dbt, $dumpfile);
                } else {
                    $strOutput .= display_rows($dbH, $dbu, $dbp, $dbn, $dbt);
                }
            } else {
                $strOutput .= "host=" . $dbH . " user="******" pass="******" name=" . $dbn . "</td></tr><tr><td>" . display_tables($dbH, $dbu, $dbp, $dbn);
            }
        }
    }
    $strOutput .= "</pre></td></tr></table><br/>";
}
if (isset($Odbh)) {
    $strOutput .= "<table border=1><tr><td><b>odbc access</b></td></tr>";
    eval("\$Gdbhost = \"\${$Odbh}\";");
    eval("\$Gdbuser = \"\${$dbu}\";");
    eval("\$Gdbpass = \"\${$dbp}\";");