Beispiel #1
0
    echo json_encode(array('status' => 1, 'suc' => show_feedback(false)));
    exit;
}
////////////////////////////////////////////////
// admin only code below
// check if user is loged in as admin
if (!checklogin()) {
    header('Location: index.php');
    exit;
}
////////////////////////////////////////////////
// database backup
if (isset($_POST['act']) && $_POST['act'] == 'backup') {
    $backup = isset($_POST['id']) ? $_POST['id'] : 1;
    require_once 'lib/backup.class.php';
    if (backup_imgdb($backup)) {
        echo json_encode(array('status' => 1, 'suc' => show_feedback(false)));
        exit;
    } else {
        echo json_encode(array('status' => 0, 'error' => show_feedback(false)));
        exit;
    }
}
////////////////////////////////////////////////
// unzip  database backup
if (isset($_POST['act']) && $_POST['act'] == 'unzip') {
    $file = isset($_POST['name']) ? $_POST['name'] : 1;
    require_once 'lib/backup.class.php';
    if (backup_unzip($file)) {
        echo json_encode(array('status' => 1, 'suc' => show_feedback(false)));
        exit;
Beispiel #2
0
}
//debug, show PHP errors
if ($debug) {
    error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
} else {
    error_reporting(E_ALL ^ E_NOTICE);
    ini_set('display_errors', 0);
}
if (!(require CFINCPATH . 'functions.php')) {
    die('Can\'t find functions.php');
}
if (!(require CFINCPATH . 'set.php')) {
    die("Can't find setings or installer!");
}
if (!(require CFLIBPATH . 'arraydb.class.php')) {
    die('Can\'t find arraydb.class.php');
}
// auto backup image database
if ($settings['SET_BACKUP_AUTO_ON']) {
    if (time() > $settings['SET_LAST_BACKUP_IMAGE'] + $settings['SET_BACKUP_AUTO_TIME'] * (24 * 60 * 60)) {
        require_once CFLIBPATH . 'backup.class.php';
        backup_imgdb(1, 0);
        $settings['SET_LAST_BACKUP_IMAGE'] = time();
        saveSettings(CFINCPATH . 'set.php', $settings);
        remove_old_blackups();
    }
}
//run auto delete ( remove old and un-viewed images)
if ($settings['SET_AUTO_DELETED']) {
    autoDeleted();
}