if (isset($_REQUEST["product_id"])) {
    $product_id = $_REQUEST["product_id"];
}
if ($token == $longtoken) {
    $user = "******";
} else {
    $token = preg_replace('/X/', '', $token);
    // Remove the X
    $user = strrev($token);
}
$state = "";
$comments = array();
$message = '';
$issues = null;
$secret = $pugpigCredsSecret;
if (patcf_is_status_coder($user)) {
    $user = patcf_return_status_code($user, 2);
}
$flip_active = patcf_flip_is_active($seconds);
$deny_issue_based = false;
if ($token == "") {
    $state = "stale";
    $message = "No token!";
    $comments[] = "No token supplied";
} elseif (empty($product_id)) {
    $state = "inactive";
    $message = "No product requested!";
    $comments[] = "No product_id supplied";
} elseif (in_array(strrev($token), array("expiredtoken", "blockedtoken", "alwaysstaletoken"))) {
    $state = "stale";
    $message = "You need to log in again!";
Beispiel #2
0
==============================================================================
(c) 2011, Kaldor Holdings Ltd
This module is released under the GNU General Public License.
See COPYRIGHT.txt and LICENSE.txt
*/
include_once "auth_test_inc.php";
// Take the first param that isn't one of the special set
$params = $_REQUEST;
unset($params["product_id"]);
unset($params["issue_prefix"]);
unset($params["issue_start"]);
unset($params["issue_end"]);
$cred = array_shift($params);
$cred = strtolower($cred);
$comments = array();
if (patcf_is_status_coder($cred)) {
    patcf_return_status_code($cred, 0);
    $comments[] = "User follows special pattern";
    $token = strrev($cred);
} else {
    if ($cred == "badtoken") {
        $comments[] = "This token is no good. Simulate expired or cancelled";
        $token = "badbad";
    } else {
        if (in_array($cred, $all_users)) {
            $comments[] = "User is in the predefined list";
            $token = strrev($cred);
        } else {
            $comments[] = "User not in the predefined list";
            $token = null;
        }