// 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, 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; }
// // // // 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 "recaptchalib.php"; require_once "ayah.php"; var_dump(NSSDROPBOX_LIB_DIR); require_once NSSDROPBOX_LIB_DIR . "Smartyconf.php"; require_once NSSDROPBOX_LIB_DIR . "NSSDropoff.php"; require_once NSSDROPBOX_LIB_DIR . "Verify.php"; if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS)) { $theDropbox->SetupPage(); $ayah = new AYAH(); if ($_POST['Action'] == "verify") { // // Posted form data indicates that a dropoff form was filled-out // and submitted. // // If the request key is provided, then pull it out and look it up. // 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
$srcemail = ''; $srcorg = ''; $destname = ''; $destemail = ''; $note = ''; $subject = ''; $expiry = 0; if (isset($_GET['req'])) { // They got this link in an email, so... // Read the DB info and present the dropoff form $authkey = preg_replace('/[^a-zA-Z0-9]/', '', $_GET['req']); $authkey = strtolower(substr($authkey, 0, 12)); // Get 1st 3 words if (!$theDropbox->ReadReqData($authkey, $srcname, $srcemail, $srcorg, $destname, $destemail, $note, $subject, $expiry)) { // Error! $theDropbox->SetupPage(); NSSError($smarty->getConfigVariable('ErrorRequestUsed'), "Request Code Used"); $smarty->display('error.tpl'); exit; } if ($expiry < time()) { $theDropbox->SetupPage(); NSSError($smarty->getConfigVariable('ErrorRequestExpired'), "Request Code Expired"); $smarty->display('error.tpl'); exit; } // Present the new_dropoff form $theDropbox->SetupPage(); $smarty->assign('senderName', $destname); $smarty->assign('senderEmail', strtolower($destemail)); $smarty->assign('recipName_1', $srcname);
// // // // 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 . "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, TRUE)) { $theDropbox->SetupPage(); 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');
global $smarty; # Generate unique ID required for progress bars status $smarty->assign('progress_id', uniqid("")); function generateEmailTable($aDropbox, $label = 1) { global $smarty; $smarty->assign('recipEmailNum', $label); } if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS, TRUE)) { if ($_POST['Action'] == "dropoff") { // // Posted form data indicates that a dropoff form was filled-out // and submitted; if posted from data is around, creating a new // dropoff instance creates a new dropoff using said form data. // $theDropbox->SetupPage(); $template = 'show_dropoff.tpl'; if ($theDropoff = new NSSDropoff($theDropbox)) { // Allow HTMLWrite to over-ride the template file if it wants to $template2 = $theDropoff->HTMLWrite(); if ($template2 != "") { $template = $template2; } } $smarty->display($template); } else { // // We need to present the dropoff form. This page will include some // JavaScript that does basic checking of the form prior to submission // as well as the code to handle the attachment of multiple files. // After all that, we start the page body and write-out the HTML for