Exemplo n.º 1
0
#!/usr/bin/php
<?php 
if (count($argv) < 2) {
    printf("\n  usage:\n  \n   %s <zendto preference file> {email address}\n  \n   The zendto preference file path should be canonical, not relative.\n\n", $argv[0]);
    return 0;
}
if (!preg_match('/^\\/.+/', $argv[1])) {
    echo "ERROR:  You must provide a canonical path to the preference file.\n";
    return 1;
}
include $argv[1];
require_once NSSDROPBOX_LIB_DIR . "Smartyconf.php";
include_once NSSDROPBOX_LIB_DIR . "NSSDropoff.php";
if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS)) {
    if (SqlBackend === 'SQLite') {
        $qResult = $theDropbox->database()->database->arrayQuery(sprintf("SELECT rowID,* FROM dropoff"), SQLITE_ASSOC);
    } else {
        $res = $theDropbox->database()->database->query(sprintf("SELECT rowID,* FROM dropoff"));
        $i = 0;
        $qResult = array();
        while ($line = $res->fetch_array()) {
            $qResult[$i++] = $line;
        }
    }
    echo "BEGIN TRANSACTION;\n";
    foreach ($qResult as $q) {
        echo "INSERT INTO dropoff\n";
        echo "( rowID, claimID, claimPasscode, authorizedUser, senderName, senderOrganization, senderEmail, senderIP, confirmDelivery, created, note )\n";
        echo sprintf("VALUES (%d,'%s','%s','%s','%s','%s','%s','%s','%s','%s','%s');\n", $q[rowID], sqlite_escape_string($q[claimID]), sqlite_escape_string($q[claimPasscode]), sqlite_escape_string($q[authorizedUser]), sqlite_escape_string($q[senderName]), sqlite_escape_string($q[senderOrganization]), sqlite_escape_string($q[senderEmail]), sqlite_escape_string($q[senderIP]), sqlite_escape_string($q[confirmDelivery]), sqlite_escape_string($q[created]), sqlite_escape_string($q[note]));
    }
    echo "COMMIT;\n";
Exemplo n.º 2
0
#!/usr/bin/php
<?php 
if ($_ENV['ZENDTOPREFS']) {
    array_splice($argv, 1, 0, $_ENV['ZENDTOPREFS']);
}
if (count($argv) < 2) {
    printf("\n  usage:\n  \n   %s <ZendTo preferences.php file>\n  \n   The ZendTo preferences.php file path should be canonical, not relative.\n   Alternatively, do\n     export ZENDTOPREFS=<full file path of preferences.php>\n     %s\n\n", $argv[0], $argv[0]);
    return 0;
}
if (!preg_match('/^\\/.+/', $argv[1])) {
    echo "ERROR:  You must provide a canonical path to the preference file.\n";
    return 1;
}
include $argv[1];
require_once NSSDROPBOX_LIB_DIR . "Smartyconf.php";
include_once NSSDROPBOX_LIB_DIR . "NSSDropoff.php";
if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS, FALSE, TRUE)) {
    printf("Extending the database schema to add the sender verification table\n");
    $theDropbox->setupDatabaseAuthTable();
    printf("Done\n");
}
Exemplo n.º 3
0
// 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 "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));
Exemplo n.º 4
0
//
// 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 NSSDROPBOX_LIB_DIR . "Smartyconf.php";
require_once NSSDROPBOX_LIB_DIR . "NSSDropoff.php";
require_once NSSDROPBOX_LIB_DIR . "Req.php";
// This gets called with nothing, in which case we present the form,
// else it gets called with GET['req'], in which case we read the DB
// info and present the dropoff form,
// else it gets called with POST['Action']==send, in which case we send
// the email.
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)) {
Exemplo n.º 5
0
// GNU General Public License for more details.
//
// 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) . ".");
Exemplo n.º 6
0
// GNU General Public License for more details.
//
// 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 . "Smartyconf.php";
require_once NSSDROPBOX_LIB_DIR . "NSSDropoff.php";
if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS)) {
    //
    // This page handles the listing of dropoffs made by an
    // authenticated user.  If the user is NOT authenticated,
    // then an error is presented.
    //
    $theDropbox->SetupPage();
    if ($theDropbox->authorizedUser()) {
        //
        // Returns an array of all NSSDropoff instances belonging to
        // this user.
        //
        $allDropoffs = NSSDropoff::dropoffsFromCurrentUser($theDropbox);
        //
        // Start the web page and add some Javascript to automatically
        // fill-in and submit a pickup form when a dropoff on the page
Exemplo n.º 7
0
// GNU General Public License for more details.
//
// 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 . "NSSDropoff.php";
if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS, TRUE)) {
    //
    // This page handles the listing of an authenticated user's
    // dropoffs.  If the user is NOT authenticated, then an error
    // is presented.
    //
    $theDropbox->SetupPage();
    // Read the sort order from the page
    $cookieName = $theDropbox->cookieName() . 'MyDropoffsSortOrder';
    $sortOrder = $_POST['sortOrder'];
    if (!$sortOrder) {
        $sortOrder = $_COOKIE[$cookieName];
    }
    if (!$sortOrder) {
        $sortOrder = "ffile";
    }
Exemplo n.º 8
0
// 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)) {
        $claimID = $thePickup->claimID();
        $smarty->assign('claimID', $claimID);
        $success = $thePickup->removeDropoff();
        # If next=="index" then redirect them to the autoHome page without delay
        if ($success && $_POST['next'] == "index") {
            Header("HTTP/1.1 302 Moved Temporarily");
            Header("Location: " . $NSSDROPBOX_URL);
            exit;
        }
        $smarty->assign('success', $success);
        $smarty->assign('autoHome', TRUE);
        if (!$success) {
            NSSError("Unable to remove the dropoff.  Please contact the system administrator.", "Unable to remove " . $claimID);
Exemplo n.º 9
0
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
// Date in the past
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
// always modified
header('Cache-Control: no-cache, must-revalidate');
// HTTP/1.1
header('Pragma: no-cache');
header('Content-type: image/png');
switch ($_GET['p']) {
    case 7:
    case 30:
    case 90:
    case 365:
    case 3650:
        $period = $_GET['p'];
        break;
}
if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS, TRUE)) {
    //
    // This page displays usage graphs for the system.
    //
    if ($theDropbox->authorizedUser() && $theDropbox->authorizedUserData('grantAdminPriv')) {
        if ($period && ($metric = $_GET['m']) || ($metric = $_POST['metric'])) {
            if (is_readable($path = RRD_DATA_DIR . $metric . $period . '.png')) {
                readfile($path);
                exit(0);
            }
        }
    }
}
readfile(RRD_DATA_DIR . 'notfound.png');
Exemplo n.º 10
0
// for the sake of simplicity.
//
// The necessary authentication is all handled by:
//
//   (1) When the dropbox instance is created, the page's cookie is
//       consulted and authentication may be pulled from that.
//   (2) When the pickup instance is created, the authenticated
//       username itself may imply authorization; otherwise, posted
//       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);
Exemplo n.º 11
0
#!/usr/bin/php
<?php 
if ($_ENV['ZENDTOPREFS']) {
    array_splice($argv, 1, 0, $_ENV['ZENDTOPREFS']);
}
if (count($argv) < 2) {
    printf("\n  usage:\n  \n   %s <ZendTo preferences.php file>\n  \n   The ZendTo preferences.php file path should be canonical, not relative.\n   Alternatively, do\n     export ZENDTOPREFS=<full file path of preferences.php>\n     %s\n\n", $argv[0], $argv[0]);
    return 0;
}
if (!preg_match('/^\\/.+/', $argv[1])) {
    echo "ERROR:  You must provide a canonical path to the preference file.\n";
    return 1;
}
include $argv[1];
require_once NSSDROPBOX_LIB_DIR . "Smartyconf.php";
include_once NSSDROPBOX_LIB_DIR . "NSSDropoff.php";
if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS, FALSE, TRUE)) {
    printf("Extending the database schema to add the regexps table\n");
    $theDropbox->setupDatabaseRegexpsTable();
    printf("Done\n");
}
Exemplo n.º 12
0
//
// 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!
//
//echo "fghj";
require "../config/preferences.php";
require_once NSSDROPBOX_LIB_DIR . "Smartyconf.php";
require_once NSSDROPBOX_LIB_DIR . "NSSDropbox.php";
if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS)) {
    //
    // 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.
    //
    // Find if they are an onsite-user or not, so we can show them to login.
    $smarty->assign('isLocalIP', $theDropbox->isLocalIP());
    // These 2 are needed for the intro text on the home page
    $smarty->assign('maxFileSize', NSSFormattedMemSize($theDropbox->maxBytesForFile()));
    $smarty->assign('keepForDays', $NSSDROPBOX_PREFS['numberOfDaysToRetain']);
    switch (isset($_GET['action']) ? $_GET['action'] : (isset($_POST['action']) ? $_POST['action'] : '')) {
        case 'login':
            $aU = $theDropbox->authorizedUser();
            if ($aU) {
Exemplo n.º 13
0
// configuration!
//
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();
Exemplo n.º 14
0
#!/usr/bin/php
<?php 
if ($_ENV['ZENDTOPREFS']) {
    array_splice($argv, 1, 0, $_ENV['ZENDTOPREFS']);
}
if (count($argv) < 2) {
    printf("\n  usage:\n  \n   %s <ZendTo preferences.php file> <email address>\n  \n   The ZendTo preferences.php file path should be canonical, not relative.\n   Alternatively, do\n     export ZENDTOPREFS=<full file path of preferences.php>\n     %s <email address>\n\n", $argv[0], $argv[0]);
    return 0;
}
if (!preg_match('/^\\/.+/', $argv[1])) {
    echo "ERROR:  You must provide a canonical path to the preference file.\n";
    return 1;
}
include $argv[1];
require_once NSSDROPBOX_LIB_DIR . "Smartyconf.php";
include_once NSSDROPBOX_LIB_DIR . "NSSDropoff.php";
if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS, FALSE, TRUE)) {
    $qResult = $theDropbox->database()->arrayQuery("SELECT rowID,* FROM dropoff", SQLITE_ASSOC);
    echo "BEGIN TRANSACTION;\n";
    foreach ($qResult as $q) {
        echo "INSERT INTO dropoff\n";
        echo "( rowID, claimID, claimPasscode, authorizedUser, senderName, senderOrganization, senderEmail, senderIP, confirmDelivery, created, note )\n";
        echo sprintf("VALUES (%d,'%s','%s','%s','%s','%s','%s','%s','%s','%s','%s');\n", $q[rowID], sqlite_escape_string($q[claimID]), sqlite_escape_string($q[claimPasscode]), sqlite_escape_string($q[authorizedUser]), sqlite_escape_string($q[senderName]), sqlite_escape_string($q[senderOrganization]), sqlite_escape_string($q[senderEmail]), sqlite_escape_string($q[senderIP]), sqlite_escape_string($q[confirmDelivery]), sqlite_escape_string($q[created]), sqlite_escape_string($q[note]));
    }
    echo "COMMIT;\n";
}
Exemplo n.º 15
0
//
//
//
// 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');
Exemplo n.º 16
0
<?php 
if ($_ENV['ZENDTOPREFS']) {
    array_splice($argv, 1, 0, $_ENV['ZENDTOPREFS']);
}
if (count($argv) < 2) {
    printf("\n  usage:\n  \n   %s <ZendTo preferences.php file>\n  \n   The ZendTo preferences.php file path should be canonical, not relative.\n   Alternatively, do\n     export ZENDTOPREFS=<full file path of preferences.php>\n     %s\n\n", $argv[0], $argv[0]);
    return 0;
}
if (!preg_match('/^\\/.+/', $argv[1])) {
    echo "ERROR:  You must provide a canonical path to the preference file.\n";
    return 1;
}
include $argv[1];
include_once NSSDROPBOX_LIB_DIR . "Smartyconf.php";
include_once NSSDROPBOX_LIB_DIR . "NSSDropoff.php";
if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS)) {
    //
    // Get all drop-offs; they come back sorted according to their
    // creation date:
    //
    printf("\nNSSDropbox Cleanup of zendto for preference file:\n  %s\n\n", $argv[1]);
    printf("Gathering dropoffs with creation timestamps before: %s\n", timestampForTime(time() - $theDropbox->retainDays() * 24 * 60 * 60));
    $oldDropoffs = NSSDropoff::dropoffsOutsideRetentionTime($theDropbox);
    if ($oldDropoffs && ($iMax = count($oldDropoffs))) {
        $i = 0;
        while ($i < $iMax) {
            printf("- Removing [%s] %s <%s>\n", $oldDropoffs[$i]->claimID(), $oldDropoffs[$i]->senderName(), $oldDropoffs[$i]->senderEmail());
            $oldDropoffs[$i]->removeDropoff();
            $i++;
        }
    } else {
Exemplo n.º 17
0
// GNU General Public License for more details.
//
// 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 . "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;
Exemplo n.º 18
0
#!/usr/bin/php
<?php 
if ($_ENV['ZENDTOPREFS']) {
    array_splice($argv, 1, 0, $_ENV['ZENDTOPREFS']);
}
if (count($argv) < 2) {
    printf("\n  usage:\n  \n   %s <ZendTo preferences.php file>\n  \n   The ZendTo preferences.php file path should be canonical, not relative.\n   Alternatively, do\n     export ZENDTOPREFS=<full file path of preferences.php>\n     %s\n\n", $argv[0], $argv[0]);
    return 0;
}
if (!preg_match('/^\\/.+/', $argv[1])) {
    echo "ERROR:  You must provide a canonical path to the preference file.\n";
    return 1;
}
include $argv[1];
require_once NSSDROPBOX_LIB_DIR . "Smartyconf.php";
include_once NSSDROPBOX_LIB_DIR . "NSSDropoff.php";
if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS, FALSE, TRUE)) {
    printf("Extending the database schema to add the loginlog table\n");
    $theDropbox->setupDatabaseLoginlogTable();
    printf("Done\n");
}
Exemplo n.º 19
0
#!/usr/bin/php
<?php 
if ($_ENV['ZENDTOPREFS']) {
    array_splice($argv, 1, 0, $_ENV['ZENDTOPREFS']);
}
if (count($argv) < 2) {
    printf("\n  usage:\n  \n   %s <ZendTo preferences.php file>\n  \n   The ZendTo preferences.php file path should be canonical, not relative.\n   Alternatively, do\n     export ZENDTOPREFS=<full file path of preferences.php>\n     %s\n\n", $argv[0], $argv[0]);
    return 0;
}
if (!preg_match('/^\\/.+/', $argv[1])) {
    echo "ERROR:  You must provide a canonical path to the preference file.\n";
    return 1;
}
include $argv[1];
require_once NSSDROPBOX_LIB_DIR . "Smartyconf.php";
include_once NSSDROPBOX_LIB_DIR . "NSSDropoff.php";
if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS, FALSE, TRUE)) {
    printf("Extending the database schema to add the Drop-off request table\n");
    $theDropbox->setupDatabaseReqTable();
    printf("Done\n");
}
Exemplo n.º 20
0
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// 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, TRUE)) {
    $theDropbox->SetupPage();
    $smarty->assign('maxFileSize', NSSFormattedMemSize($theDropbox->maxBytesForFile()));
    $smarty->assign('maxDropoffSize', NSSFormattedMemSize($theDropbox->maxBytesForDropoff()));
    $smarty->assign('keepForDays', $NSSDROPBOX_PREFS['numberOfDaysToRetain']);
    $smarty->display('about.tpl');
}
Exemplo n.º 21
0
// GNU General Public License for more details.
//
// 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 . "NSSDropoff.php";
if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS, TRUE)) {
    //
    // This page handles the listing of an authenticated user's
    // dropoffs.  If the user is NOT authenticated, then an error
    // is presented.
    //
    $theDropbox->SetupPage();
    if ($theDropbox->authorizedUser() && $theDropbox->authorizedUserData('grantAdminPriv')) {
        //
        // Returns an array of all NSSDropoff instances belonging to
        // this user.
        //
        $allDropoffs = NSSDropoff::allDropoffs($theDropbox);
        //
        // Start the web page and add some Javascript to automatically
        // fill-in and submit a pickup form when a dropoff on the page
Exemplo n.º 22
0
// 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";
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)) {
    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;
            }
        }
Exemplo n.º 23
0
#!/usr/bin/php
<?php 
if ($_ENV['ZENDTOPREFS']) {
    array_splice($argv, 1, 0, $_ENV['ZENDTOPREFS']);
}
if (count($argv) < 2) {
    printf("\n  usage:\n  \n   %s <ZendTo preferences.php file>\n  \n   The ZendTo preferences.php file path should be canonical, not relative.\n   Alternatively, do\n     export ZENDTOPREFS=<full file path of preferences.php>\n     %s\n\n", $argv[0], $argv[0]);
    return 0;
}
if (!preg_match('/^\\/.+/', $argv[1])) {
    echo "ERROR:  You must provide a canonical path to the preference file.\n";
    return 1;
}
include $argv[1];
require_once NSSDROPBOX_LIB_DIR . "Smartyconf.php";
include_once NSSDROPBOX_LIB_DIR . "NSSDropoff.php";
if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS, FALSE, TRUE)) {
    printf("Extending the database schema to add the local authentication table\n");
    $theDropbox->setupDatabaseUserTable();
    printf("Done\n");
}
Exemplo n.º 24
0
// GNU General Public License for more details.
//
// 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, 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();
Exemplo n.º 25
0
// 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";
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;
            }
        }