Example #1
0
if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS)) {
    $srcname = '';
    $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);