NSSError($smarty->getConfigVariable('ErrorRequestUsedLogin'), "Request Code error"); } } } // // If posted form data is around, creating a new dropoff instance // creates a new dropoff using said form data. // if (!$theDropbox->authorizedUser()) { $captcha = $theDropbox->captcha(); $resp = FALSE; if ($captcha === 'areyouahuman') { $resp = $ayah->scoreResult(); } elseif ($captcha === 'google' || $captcha === '') { // Google or not set at all, so using old version $reCaptchaPrivateKey = $theDropbox->recaptchaPrivateKey(); if ($reCaptchaPrivateKey === 'disabled') { $resp = TRUE; } else { $resp = recaptcha_check_answer($reCaptchaPrivateKey, $_SERVER["REMOTE_ADDR"], $_POST["g-recaptcha-response"]); } } else { // Must be disabled $resp = TRUE; } if ($resp && ($theVerify = new Verify($theDropbox))) { // They passed the Captcha so send them on their way if at all possible! if ($theVerify->formInitError() != "") { NSSError($theVerify->formInitError(), "Verify error"); $smarty->display('error.tpl'); } else {
require "../config/preferences.php"; require_once "ayah.php"; require "recaptchalib.php"; require_once NSSDROPBOX_LIB_DIR . "Smartyconf.php"; require_once NSSDROPBOX_LIB_DIR . "NSSDropoff.php"; // // This is pretty straightforward; depending upon the form data coming // into this PHP session, creating a new dropoff object will either // display the claimID-and-claimPasscode "dialog" (no form data or // missing/invalid passcode); display the selected dropoff if the // claimID and claimPasscode are valid OR the recipient matches the // authenticate user -- it's all built-into the NSSDropoff class. // if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS)) { // If they are an authorised user, just display the normal pickup page. if ($theDropbox->authorizedUser() || !$theDropbox->humanDownloads() || ($theDropbox->captcha() == 'google' || $theDropbox->captcha() == '') && $theDropbox->recaptchaPrivateKey() == 'disabled' || $theDropbox->captcha() == 'disabled') { $theDropbox->SetupPage(); // 2-line addition by Francois Conil to fix problems with no CAPTCHA // and anonymous users who don't have a link to click on. $auth = $theDropbox->WriteAuthData($_SERVER['REMOTE_ADDR'], '', ''); $smarty->assign('auth', $auth); if ($thePickup = new NSSDropoff($theDropbox)) { // // Start the page and add some Javascript for automatically // filling-in the download form and submitting it when the // user clicks on a file in the displayed dropoff. // $theDropbox->SetupPage($thePickup->HTMLOnLoadJavascript()); $output = $thePickup->HTMLWrite(); } $smarty->display($output ? $output : 'error.tpl');