Пример #1
0
 $vali = new Validation($_REQUEST);
 $o = $vali->getInput('o', 'Ontology', 1, 60, true);
 if ($vali->getErrorMsg() == '') {
     $settings = getSettings($o);
     $num_queries = 0;
     if (!isset($settings['ns_main'])) {
         $vali->concatError('Invalid ontology specified.');
     }
 }
 if ($vali->getErrorMsg() == '') {
     $iri = $vali->getInput('iri', 'Term IRI', 2, 100, true);
     if (substr($iri, 0, 7) != 'http://') {
         $iri = 'http://purl.obolibrary.org/obo/' . $iri;
     }
     if ($vali->getErrorMsg() == '') {
         $iri = myUrlDecode($iri);
         $outputNSs = array();
         $outputNSs['http://www.w3.org/1999/02/22-rdf-syntax-ns#'] = 'rdf';
         $outputNSs['http://www.w3.org/2002/07/owl#'] = 'owl';
         //			$outputNSs['http://purl.obolibrary.org/obo/'] = 'obo';
         $outputNSs['http://www.w3.org/2000/01/rdf-schema#'] = 'rdfs';
         $outputNSs['http://purl.org/dc/elements/1.1/'] = 'dc';
         //			$outputNSs['http://protege.stanford.edu/plugins/owl/protege#'] = 'protege';
         $strOutput = '';
         $related_terms = array();
         $a_fields = array();
         $querystring = "\nDEFINE sql:describe-mode \"CBD\" \nDESCRIBE <{$iri}> \n\nFROM <{$settings['ns_main']}>";
         //print("<!--$querystring-->");
         $fields = array();
         $fields['default-graph-uri'] = '';
         $fields['format'] = 'application/rdf+xml';
Пример #2
0
    $txt .= '  <td> <input type="text" name="pwd" size="40" maxlength="80"> </td>';
    $txt .= "</tr>\n";
    $txt .= "<tr> <td>&nbsp;</td></tr>\n";
    $txt .= "<tr>\n";
    $txt .= '  <td> <input type="submit" value="download"> </td>';
    $txt .= "</tr>\n";
    $txt .= "</table>\n";
    $txt .= "</form>\n";
    return $txt;
}
verifyMethodPost();
# check if all the POST variables are present (login, pwd)
verifyPostVarExists('login');
verifyPostVarExists('pwd');
$login = stripQuotes(myUrlDecode(getPostVar('login')));
$pwd = stripQuotes(myUrlDecode(getPostVar('pwd')));
$productList = getProductsForLoginPwd($login, $pwd);
if (0 == count($productList)) {
    echo "<b><font color=\"red\">The login '{$login}' and password '{$pwd}' combination didn't match anything in our database.\n";
    echo "Please try again. </font></b>\n";
    echo "If problem persists, please e-mail <a href=\"mailto:support@arslexis.com\">ArsLexis</a>\n";
    echo "<p>\n";
    echo getLoginForm();
    $subject = "[PAYPAL ERROR] failed login";
    $body = "Failed attempt to login using login='******' and pwd='{$pwd}'\n";
    $body .= getInterestingVars();
    sendEmail(MYEMAIL, $subject, $body);
} else {
    # display a list of products with links to download
    echo "<table>\n<tr>\n";
    echo "<td width=\"30\">&nbsp;</td>\n<td>\n";
Пример #3
0
<?php

# Author: Krzysztof Kowalczyk (krzysztofk@pobox.com)
#
# Script called from dl.php, just redirects the download
# to the file if login/pwd/name of the product are valid
require "../phpinc/settings.inc";
error_reporting(E_ALL);
set_error_handler("errorHandler");
# make sure we got login, pwd, name variables
verifyGetVarExists('login');
verifyGetVarExists('pwd');
verifyGetVarExists('name');
$login = stripQuotes(myUrlDecode(getGetVar('login')));
$pwd = stripQuotes(myUrlDecode(getGetVar('pwd')));
$productName = getGetVar(myUrlDecode('name'));
if (!canDownloadProduct($login, $pwd, $productName)) {
    doError("Cannot download for login={$login}, pwd={$pwd}, product={$productName}\n");
}
$fullPath = getProductFilePath($productName);
$fileName = getProductFileName($productName);
verifyFileExists($fullPath);
updateDlCount($login, $pwd, $productName);
// and finally return the file
header("Content-Type: application/octet-stream\n");
header("Content-disposition: attachment; filename={$fileName}\n");
header("Content-transfer-encoding: binary\n");
header("Content-Length: " . filesize($fullPath) . "\n");
$fp = fopen($fullPath, "rb");
fpassthru($fp);
Пример #4
0
    }
    $count = $row[0];
    //check if the file hasn't been used more than 3 times
    if ($count > ALLOWED_DLS_COUNT - 1) {
        return PWD_CHECK_USED_TOO_MANY_TIMES;
    }
    return PWD_CHECK_VALID;
}
// start of the real thing
if (!array_key_exists("pwd", $HTTP_GET_VARS)) {
    //if ( ! key_exists("pwd", $HTTP_GET_VARS) ) {
    header("Location: dlerror-badpwd.php?pwd=no_pwd_given\n");
    exit;
}
$pwd = $HTTP_GET_VARS["pwd"];
$pwd = stripQuotes(myUrlDecode($pwd));
bailIfFileDoesntExists();
$res = checkPassword($pwd);
if ($res == PWD_CHECK_NOT_FOUND) {
    recordPasswordAsUsed($pwd, 0);
    header("Location: dlerror-badpwd.php?pwd=" . urlencode($pwd) . "\n");
    exit;
}
if ($res == PWD_CHECK_USED_TOO_MANY_TIMES) {
    header("Location: dlerror-toomany.php?pwd=" . urlencode($pwd) . "\n");
    exit;
}
// update the file with used password to mark that the
// password has been used
recordPasswordAsUsed($pwd, 1);
// and finally return the file
Пример #5
0
    showBadPwd($pwd);
    echo "</body></html>\n";
    exit;
}
if (array_key_exists("action", $HTTP_GET_VARS)) {
    $action = $HTTP_GET_VARS["action"];
    if ($action != "add-pwd") {
        echo "unknown action: <b>{$action}</b> </body> </html>";
        exit;
    }
    if (!array_key_exists("pwdToAdd", $HTTP_GET_VARS)) {
        echo "action is add-pwd but no password! </body></html>";
        exit;
    }
    $pwdToAdd = $HTTP_GET_VARS["pwdToAdd"];
    $pwdToAdd = stripQuotes(myUrlDecode($pwdToAdd));
    if ($pwdToAdd == "") {
        echo "action is add-pwd but password is empty!</body></html>";
        exit;
    }
    addPassword($pwdToAdd);
    showAddPwdForm($pwd);
    showRecentlyUsed();
} else {
    showAddPwdForm($pwd);
    showRecentlyUsed();
}
?>

</body>
</html>