예제 #1
0
function get_user_lock($uid)
{
    if (BLOCKING_LOCKS) {
        wait_for_lock_if_no_others_are_waiting($uid);
    } else {
        get_lock_without_waiting($uid);
    }
}
예제 #2
0
    echo "Cancelled!";
    ?>
</h3>
        <p><?php 
    printf(_("Request %s is no more."), $reqid);
    ?>
</p>
    </div><?php 
} else {
    if (isset($_POST['finish_request'])) {
        // mark an order's status as 'FINAL'
        if (!$is_admin) {
            throw new Problem("Nope", "You don't have permission to do that");
        }
        $request_uid = get_request_uid($reqid);
        get_lock_without_waiting($request_uid);
        $result = do_query("SELECT reqid FROM requests WHERE reqid='{$reqid}' AND status='VERIFY'");
        if (has_results($result)) {
            $query = "\n            UPDATE\n                requests\n            SET\n                requests.status='FINAL'\n            WHERE\n                reqid='{$reqid}'\n                AND status='VERIFY'\n                AND req_type='WITHDR'\n                AND curr_type = '" . CURRENCY . "'\n        ";
            do_query($query);
            echo "    <div class='content_box'>\n";
            echo "        <h3>" . _("Finished!") . "</h3>\n";
            echo "        <p>" . sprintf(_("Request %s has been set to %s status."), $reqid, translate_request_code("FINAL")) . "</p>\n";
        } else {
            echo "    <div class='content_box'>\n";
            echo "        <h3>" . _("Warning!") . "</h3>\n";
            echo "        <p>" . sprintf(_("Request %s was cancelled before we could mark it as finished."), $reqid) . "</p>\n";
        }
        release_lock($request_uid);
    } else {
        if ($is_admin) {