// require "../config/preferences.php"; require_once NSSDROPBOX_LIB_DIR . "MyZendTo.Smartyconf.php"; require_once NSSDROPBOX_LIB_DIR . "NSSDropbox.php"; if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS, TRUE)) { // // This page handles several actions. By default, it simply // presents whatever "main menu" is appropriate. This page also // handles the presentation of the login "dialog" and subsequently // the logout facility. // switch ($_GET['action'] ? $_GET['action'] : $_POST['action']) { case 'logout': $theDropbox->logout(); $theDropbox->SetupPage(); $smarty->assign('autoHome', TRUE); $smarty->display('logout.tpl'); break; default: $aU = $theDropbox->authorizedUser(); if ($aU) { // Show their list of dropoffs Header("HTTP/1.1 302 Moved Temporarily"); Header("Location: " . $NSSDROPBOX_URL . "pickup_list.php"); } else { $theDropbox->SetupPage("login.uname"); $smarty->display('login.tpl'); } break; } }
// JKF // // Look up the "auth" parameter from the GET data, and retrieve the // Email, FullName, Organization from the SQL table record pointed // to by the "auth" key. // $authEmail = ''; $authFullName = ''; $authOrganization = ''; $authExpiry = 0; $auth = $_GET['auth']; // Set default values for library. Only gets over-ridden in 1 case. $smarty->assign('usingLibrary', FALSE); $smarty->assign('library', '[]'); $smarty->assign('addressbook', '[]'); if (!$theDropbox->authorizedUser()) { $result = $theDropbox->ReadAuthData($auth, $authFullName, $authEmail, $authOrganization, $authExpiry); if (!$result) { $theDropbox->SetupPage(); NSSError("Sender address verification subsystem failure.", "Authentication Failure"); $smarty->display('new_dropoff.tpl'); exit; } if ($authExpiry < time()) { $theDropbox->SetupPage(); NSSError($smarty->getConfigVariable('ErrorSessionExpired'), "Session Expired"); $smarty->display('new_dropoff.tpl'); exit; } } $theDropbox->SetupPage();
// If it's a real one, then just redirect straight out to the pre- // populated New Dropoff page by simulating them clicking the link // in the email they will receive. if ($_POST['req'] != '') { $reqKey = $_POST['req']; $reqKey = preg_replace('/[^a-zA-Z0-9]/', '', $reqKey); $reqKey = strtolower(substr($reqKey, 0, 12)); // Get 1st 3 words $recordlist = $theDropbox->database->DBReadReqData($reqKey); if ($recordlist && count($recordlist)) { // Key exists in database, so use it. Header("HTTP/1.1 302 Moved Temporarily"); Header('Location: ' . $NSSDROPBOX_URL . 'req.php?req=' . $reqKey); exit(0); } else { if (!$theDropbox->authorizedUser()) { NSSError($smarty->getConfigVariable('ErrorRequestUsed'), "Verify error"); } else { 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();
// You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // // // Include the dropbox preferences -- we need this to have the // dropbox filepaths setup for us, beyond simply needing our // configuration! // require "../config/preferences.php"; require_once NSSDROPBOX_LIB_DIR . "MyZendTo.Smartyconf.php"; require_once NSSDROPBOX_LIB_DIR . "NSSDropbox.php"; if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS)) { $theDropbox->SetupPage(); if ($theDropbox->authorizedUser() && $theDropbox->authorizedUserData('grantAdminPriv')) { if ($_POST['action'] == 'unlock') { // Unlock the ticked users $output = array(); for ($i = 0; $i <= $_POST['unlockMax']; $i++) { $user = $_POST['unlocktick_' . $i]; if ($user) { // Unlock the user $theDropbox->database->DBDeleteLoginlog($user); $output[] = $user; } } if ($output) { NSSError("Unlocked " . implode(', ', $output) . "."); } }
// // // // Include the dropbox preferences -- we need this to have the // dropbox filepaths setup for us, beyond simply needing our // configuration! // require "../config/preferences.php"; require_once NSSDROPBOX_LIB_DIR . "Smartyconf.php"; require_once NSSDROPBOX_LIB_DIR . "NSSDropoff.php"; if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS)) { // // This page displays usage graphs for the system. // $theDropbox->SetupPage(); if ($theDropbox->authorizedUser() && $theDropbox->authorizedUserData('grantStatsPriv')) { switch (isset($_GET['period']) ? $_GET['period'] : NULL) { case 'month': $period = 30; break; case '90days': $period = 90; break; case 'year': $period = 365; break; case 'decade': $period = 3650; break; case 'week': default:
// form data (claimID and claimPasscode) will provide the // authorization. // // Also, once the pickup instance has been created, check for an AuthData // record that matches the posted form data and IP it's being posted from. // Unless they are an authenticated user, in which case don't check AuthData. // if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS)) { $theDropbox->SetupPage(); $thePickup = new NSSDropoff($theDropbox); // If not an authenticated user, go and get their AuthData record from // the posted hash. Even if they are presetnt, check the name matches // their IP address. // If anything fails, use NSSError to post an error message saying they // have failed checks and should click again on the link they were sent. if ($theDropbox->humanDownloads() && !$theDropbox->authorizedUser() && $theDropbox->captcha() !== 'disabled') { // AYAH $theDropbox->recaptchaPrivateKey() !== 'disabled') { $authIP = ''; $authEmail = ''; $authOrganization = ''; $authExpiry = 0; $auth = $_POST['auth'] ? $_POST['auth'] : $_GET['auth']; $result = $theDropbox->ReadAuthData($auth, $authIP, $authEmail, $authOrganization, $authExpiry); if (!$result) { $theDropbox->SetupPage(); NSSError($smarty->getConfigVariable('ErrorDownloadAuth'), "Authentication Failure"); $smarty->display('no_download.tpl'); exit; } if ($authExpiry < time()) { $theDropbox->SetupPage();
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');
$theDropbox->SetupPage(); $smarty->assign('senderName', $destname); $smarty->assign('senderEmail', strtolower($destemail)); $smarty->assign('recipName_1', $srcname); $smarty->assign('recipEmail_1', strtolower($srcemail)); $smarty->assign('note', $note); $smarty->assign('maxBytesForFileInt', $theDropbox->maxBytesForFile()); $smarty->assign('maxBytesForDropoffInt', $theDropbox->maxBytesForDropoff()); $smarty->assign('recipEmailNum', 1); $smarty->assign('reqKey', $authkey); $smarty->assign('addressbook', $theDropbox->getAddressbook()); // Generate unique ID required for progress bars status $smarty->assign('progress_id', uniqid("")); $smarty->assign('useRealProgressBar', $theDropbox->useRealProgressBar()); // And setup the library of files appropriately if ($theDropbox->authorizedUser() && $theDropbox->usingLibrary()) { $library = $theDropbox->getLibraryDescs(); $smarty->assign('library', $library); $smarty->assign('usingLibrary', $library === '[]' ? FALSE : TRUE); } else { $smarty->assign('usingLibrary', FALSE); $smarty->assign('library', '[]'); $smarty->assign('addressbook', '[]'); } $smarty->display('new_dropoff.tpl'); exit; } // They are either trying to submit or display the "New Request" form, // so they must be logged in. if (!$theDropbox->authorizedUser()) { $theDropbox->SetupPage();