Beispiel #1
0
        $errors[] = 'AC_ERROR_INVALID_WEB_SERVICE_ID';
    } else {
        $user_id = $user_row['user_id'];
    }
}
if (!is_array($decisions)) {
    $errors[] = 'AC_ERROR_SEQUENCEID_NOT_GIVEN';
}
// return errors
if (is_array($errors)) {
    if ($output == 'rest') {
        echo RESTWebServiceOutput::generateErrorRpt($errors);
    } else {
        echo HTMLRpt::generateErrorRpt($errors);
    }
    exit;
}
// make decisions
$decision = new Decision($user_id, $uri, $output, $session_id);
if ($decision->hasError()) {
    $decision_error = $decision->getErrorRpt();
    // displays in checker_input_form.tmpl.php
} else {
    // make decsions
    $decision->makeDecisions($decisions);
    if ($output == 'rest') {
        echo RESTWebServiceOutput::generateSuccessRpt();
    } else {
        echo HTMLRpt::generateSuccessRpt();
    }
}
Beispiel #2
0
// set to default guideline if no input guidelines
if (!is_array($gids)) {
    $gids[] = DEFAULT_GUIDELINE;
}
// retrieve user link ID
$userLinksDAO = new UserLinksDAO();
$user_link_id = $userLinksDAO->getUserLinkID($user_id, $uri, $gids);
// set new session id
$userLinksDAO->setLastSessionID($user_link_id, Utility::getSessionID());
// validating uri content
$validate_content = @file_get_contents($uri);
if (isset($validate_content)) {
    $aValidator = new AccessibilityValidator($validate_content, $gids, $uri);
    $aValidator->setLineOffset($offset);
    $aValidator->validate();
    $errors = $aValidator->getValidationErrorRpt();
    // save errors into user_decisions
    //	$userDecisionsDAO = new UserDecisionsDAO();
    //	$userDecisionsDAO->saveErrors($user_link_id, $errors);
    if ($output == 'html') {
        // generate html output
        $htmlWebServiceOutput = new HTMLWebServiceOutput($aValidator, $user_link_id, $gids);
        echo $htmlWebServiceOutput->getWebServiceOutput();
    }
    if ($output == 'rest') {
        // generate html output
        $restWebServiceOutput = new RESTWebServiceOutput($errors, $user_link_id, $gids);
        header('Content-type: text/xml');
        echo $restWebServiceOutput->getWebServiceOutput();
    }
}