<?php

// Purpose        display output for backup, restore, metadata and dbstats processes
//                ubside of an iframe
// Author         Lutz Brueckner <*****@*****.**>
// Copyright      (c) 2000-2006 by Lutz Brueckner,
//                published under the terms of the GNU General Public Licence v.2,
//                see file LICENCE for details
// do not overwrite $s_referer in script_start.inc.php
$no_session_referer = TRUE;
require './inc/script_start.inc.php';
$key = get_request_data('key', 'GET');
if ($job = get_iframejob($s_iframejobs, $key)) {
    switch ($job['job']) {
        case 'metadata':
            list($content, $error) = isql_get_metadata($s_login['user'], $s_login['password'], $s_login['database'], $s_login['host']);
            $content = implode("\n", $content);
            break;
        case 'dbstat':
            if (($service = fbird_service_attach($s_login['host'], $s_login['user'], $s_login['password'])) != FALSE) {
                $content = fbird_db_info($service, $s_login['database'], $job['option']);
                $content = trim(str_replace(array(chr(0x1), "\n\n"), array('', "\n"), $content));
                fbird_service_detach($service);
            } else {
                $error = fbird_errmsg();
            }
            break;
        case 'backup':
            if (($service = fbird_service_attach($s_login['host'], $s_login['user'], $s_login['password'])) != FALSE) {
                $content = fbird_backup($service, $job['source'], $job['target'], $job['options'], TRUE);
                $content = str_replace(array(chr(0x1) . chr(0xa), 'gbak: '), '', $content);
Esempio n. 2
0
    unset($s_confirmations['database']);
    $s_delete_db['database'] = '';
}
//
// get the data for the metadata panel
//
if (have_panel_permissions($s_login['user'], 'db_meta', TRUE)) {
    // remove pending metadata-jobs from session
    $s_iframejobs = array_filter($s_iframejobs, create_function('$a', '$a["job"]!="metadata";'));
    $iframekey_meta = md5(uniqid('meta'));
    $s_iframejobs[$iframekey_meta] = array('job' => 'metadata', 'timestamp' => time());
    //
    // Save to File on the Metadata panel was selected
    //
    if (isset($_POST['db_meta_save'])) {
        list($metadata, $binary_error) = isql_get_metadata($s_login['user'], $s_login['password'], $s_login['database'], $s_login['host']);
        if (empty($binary_error) && count($metadata) > 0) {
            send_export_headers('application/octet-stream', 'meta.sql');
            print implode("\n", $metadata);
            exit;
        }
    }
}
//
// something happened on the System Tables panel
//
if (isset($_POST['db_systable_select'])) {
    if ($s_systable['table'] != $_POST['db_systable']) {
        $s_systable['order'] = '';
        $s_systable['dir'] = 'ASC';
    }