$handle = opendir($path);
        while (false !== ($entry = readdir($handle))) {
            if ($entry != '.' && $entry != '..') {
                deleteRecursive($path . DIRECTORY_SEPARATOR . $entry);
            }
        }
        closedir($handle);
        rmdir($path);
    } else {
        unlink($path);
    }
}
db_connect($dbhost, $dbuser, $dbpass, $dbdb);
$errorPrinter = new SegueErrorPrinter();
if (!defined('DATAPORT_SEGUE1_SECRET_KEY')) {
    $errorPrinter->doError(500, 'Invalid configuration: DATAPORT_SEGUE1_SECRET_KEY is not defined.');
}
if (!defined('DATAPORT_SEGUE1_SECRET_VALUE')) {
    $errorPrinter->doError(500, 'Invalid configuration: DATAPORT_SEGUE1_SECRET_VALUE is not defined.');
}
if (!defined('DATAPORT_TMP_DIR')) {
    $errorPrinter->doError(500, 'Invalid configuration: DATAPORT_TMP_DIR is not defined.');
}
if (!is_writable(DATAPORT_TMP_DIR)) {
    $errorPrinter->doError(500, 'Invalid configuration: DATAPORT_TMP_DIR (' . DATAPORT_TMP_DIR . ') is writable.');
}
if (!isset($_GET[DATAPORT_SEGUE1_SECRET_KEY])) {
    $errorPrinter->doError(403, 'Invalid Key/Password combination.');
}
if ($_GET[DATAPORT_SEGUE1_SECRET_KEY] != DATAPORT_SEGUE1_SECRET_VALUE) {
    $errorPrinter->doError(403, 'Invalid Key/Password combination.');
Exemple #2
0
        print "\n\t\t<site>";
        print "\n\t\t\t<title><![CDATA[" . $info['site_title'] . "]]></title>";
        print "\n\t\t\t<history>";
        print "\n\t\t\t\t<creator>" . $info['site_addedby'] . "</creator>";
        print "\n\t\t\t\t<created_time>" . $info['site_added_timestamp'] . "</created_time>";
        print "\n\t\t\t\t<last_editor>" . $info['site_editedby'] . "</last_editor>";
        print "\n\t\t\t\t<last_edited_time>" . $info['site_edited_timestamp'] . "</last_edited_time>";
        print "\n\t\t\t</history>";
        print "\n\t\t</site>";
    }
    print "\n\t</slot>";
}
db_connect($dbhost, $dbuser, $dbpass, $dbdb);
$errorPrinter = new SegueErrorPrinter();
if (!defined('DATAPORT_SEGUE1_SECRET_KEY')) {
    $errorPrinter->doError(500, 'Invalid configuration: DATAPORT_SEGUE1_SECRET_KEY is not defined.');
}
if (!defined('DATAPORT_SEGUE1_SECRET_VALUE')) {
    $errorPrinter->doError(500, 'Invalid configuration: DATAPORT_SEGUE1_SECRET_VALUE is not defined.');
}
if (!isset($_GET[DATAPORT_SEGUE1_SECRET_KEY])) {
    $errorPrinter->doError(403, 'Invalid Key/Password combination.');
}
if ($_GET[DATAPORT_SEGUE1_SECRET_KEY] != DATAPORT_SEGUE1_SECRET_VALUE) {
    $errorPrinter->doError(403, 'Invalid Key/Password combination.');
}
if (!isset($_GET['user']) || !strlen($_GET['user'])) {
    $errorPrinter->doError(400, 'No user specified.');
}
// Validate the username
$usernames = @userlookup($_REQUEST['user'], LDAP_BOTH, LDAP_WILD, LDAP_LASTNAME, 0);
Exemple #3
0
 * Answer a text file with 'true' or 'false' if a site exists for the parameters sent.
 *
 *
 * @since 3/13/08
 * 
 * @copyright Copyright &copy; 2007, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 *
 * @version $Id$
 */
require_once dirname(__FILE__) . '/../config.inc.php';
require_once dirname(__FILE__) . "/../includes.inc.php";
require_once dirname(__FILE__) . '/../objects/slot.inc.php';
require_once dirname(__FILE__) . '/../objects/segue.inc.php';
require_once dirname(__FILE__) . '/../objects/site.inc.php';
require_once dirname(__FILE__) . '/../objects/section.inc.php';
require_once dirname(__FILE__) . '/../objects/page.inc.php';
require_once dirname(__FILE__) . '/../objects/story.inc.php';
require_once dirname(__FILE__) . '/../objects/group.inc.php';
require_once dirname(__FILE__) . '/SegueErrorPrinter.class.php';
$errorPrinter = new SegueErrorPrinter();
if (!isset($_GET['site']) || !strlen($_GET['site'])) {
    $errorPrinter->doError(400, 'No site specified.');
}
$site = new Site($_GET['site']);
header("Content-Type: text/plain");
if (isset($site->site_does_not_exist) && $site->site_does_not_exist) {
    print "false";
} else {
    print "true";
}