Beispiel #1
0
        }
    }
}
//
// restore database
//
if (have_panel_permissions($s_login['user'], 'adm_restore')) {
    if (isset($_POST['adm_restore_doit'])) {
        $s_restore = array('source' => get_request_data('adm_re_source'), 'target' => get_request_data('adm_re_target'), 'overwrite' => (bool) get_request_data('adm_re_overwrite'), 'inactive' => (bool) get_request_data('adm_re_inactive'), 'oneattime' => (bool) get_request_data('adm_re_oneattime'), 'useall' => (bool) get_request_data('adm_re_useall'), 'novalidity' => (bool) get_request_data('adm_re_novalidity'), 'kill' => (bool) get_request_data('adm_re_kill'), 'verbose' => (bool) get_request_data('adm_re_verbose'), 'connect' => (bool) get_request_data('adm_re_connect'));
        if ($s_restore['connect']) {
            $s_restore['verbose'] = TRUE;
        }
    }
    if (isset($_POST['adm_restore_doit']) && !empty($s_restore['source']) && !empty($s_restore['target'])) {
        $s_sysdba_pw = get_sysdba_pw();
        if (!have_db_suffix($s_restore['target'])) {
            $error = sprintf($ERRORS['WRONG_DB_SUFFIX'], "'" . implode("', '", $DATABASE_SUFFIXES) . "'");
        } elseif (!is_allowed_db($s_restore['target'])) {
            $error = sprintf($ERRORS['DB_NOT_ALLOWED'], $s_restore['target']);
        }
        $restore_options = array('inactive' => IBASE_RES_DEACTIVATE_IDX, 'oneattime' => IBASE_RES_ONE_AT_A_TIME, 'useall' => IBASE_RES_USE_ALL_SPACE, 'novalidity' => IBASE_RES_NO_VALIDATE, 'kill' => IBASE_RES_NO_SHADOW);
        $options = 0;
        foreach ($restore_options as $idx => $option) {
            if ($s_restore[$idx]) {
                $options |= $option;
            }
        }
        if ($s_restore['overwrite']) {
            $options |= IBASE_RES_REPLACE;
        } else {
            $options |= IBASE_RES_CREATE;
//
$dbfiles = array();
if (isset($ALLOWED_FILES) && count($ALLOWED_FILES) > 0) {
    foreach ($ALLOWED_FILES as $file) {
        if (strpos($file, '/') === FALSE && strpos($file, '\\') === FALSE || is_file($file) && have_db_suffix($file)) {
            $dbfiles[] = $file;
        }
    }
} elseif (isset($ALLOWED_DIRS) && count($ALLOWED_DIRS) > 0) {
    foreach ($ALLOWED_DIRS as $dir) {
        if (!@is_readable($dir)) {
            $warning .= sprintf($WARNINGS['CAN_NOT_ACCESS_DIR'], $dir);
        } else {
            $dirhandle = opendir($dir);
            while ($filename = readdir($dirhandle)) {
                if (have_db_suffix($filename)) {
                    $dbfiles[] = $dir . $filename;
                }
            }
            closedir($dirhandle);
        }
    }
}
sort($dbfiles);
//
// print out all the panels
//
$s_page = 'Database';
$panels = $s_database_panels;
require './inc/script_end.inc.php';
//