77 | Kapellenstr. 1A
78 | 22117 Hamburg, Germany
79 |
80 | FirebirdWebAdmin is published under the terms of the [GNU GPL v.2][gnu_gpl_v2_license], please read the file LICENCE for details.
81 |
82 | This software is provided 'as-is', without any expressed or implied warranty. In no event will the author be held liable for any damages arising from the use of this software.
83 |
84 | [gnu_gpl_v2_license]: https://opensource.org/licenses/GPL-2.0
85 | [changelog]: CHANGELOG.md
86 |
--------------------------------------------------------------------------------
/assets/css/main.css:
--------------------------------------------------------------------------------
1 | html {
2 | position: relative;
3 | min-height: 100%;
4 | }
5 |
6 | body {
7 | padding-top: 70px;
8 | }
9 |
10 | .margin-bottom-0px {
11 | margin-bottom: 0
12 | }
13 |
14 | .footer {
15 | position: absolute;
16 | bottom: 0;
17 | width: 100%;
18 | /* Set the fixed height of the footer here */
19 | height: 60px;
20 | background-color: #f5f5f5;
21 | }
22 |
23 | .container {
24 | -width: auto;
25 | -max-width: 680px;
26 | -padding: 0 15px;
27 | }
28 | .container .text-muted {
29 | margin: 20px 0;
30 | }
31 |
32 | .margin-left-10px {
33 | margin-left: 10px !important;
34 | }
35 |
36 | .margin-left-20px {
37 | margin-left: 20px !important;
38 | }
39 |
40 |
41 | .CodeMirror {
42 | border-top: 1px solid gainsboro;
43 | border-right: 1px solid gainsboro;
44 | }
--------------------------------------------------------------------------------
/iframe_content.php:
--------------------------------------------------------------------------------
1 |
5 | // Copyright (c) 2000-2006 by Lutz Brueckner,
6 | // published under the terms of the GNU General Public Licence v.2,
7 | // see file LICENCE for details
8 |
9 | // do not overwrite $s_referer in script_start.inc.php
10 | $no_session_referer = true;
11 |
12 | require './inc/script_start.inc.php';
13 |
14 | $key = get_request_data('key', 'GET');
15 |
16 | if ($job = get_iframejob($s_iframejobs, $key)) {
17 | switch ($job['job']) {
18 | case 'metadata':
19 | list($content, $error) = isql_get_metadata($s_login['user'], $s_login['password'], $s_login['database'], $s_login['host']);
20 | $content = implode("\n", $content);
21 | break;
22 |
23 | case 'dbstat':
24 | if (($service = fbird_service_attach($s_login['host'], $s_login['user'], $s_login['password'])) != false) {
25 | $content = fbird_db_info($service, $s_login['database'], $job['option']);
26 | $content = trim(str_replace(array(chr(0x01), "\n\n"), array('', "\n"), $content));
27 | fbird_service_detach($service);
28 | } else {
29 | $error = fbird_errmsg();
30 | }
31 | break;
32 |
33 | case 'backup':
34 | if (($service = fbird_service_attach($s_login['host'], $s_login['user'], $s_login['password'])) != false) {
35 | $content = fbird_backup($service, $job['source'], $job['target'], $job['options'], true);
36 | $content = str_replace(array(chr(0x01).chr(0x0a), 'gbak: '), '', $content);
37 | fbird_service_detach($service);
38 | } else {
39 | $error = fbird_errmsg();
40 | }
41 | break;
42 |
43 | case 'restore':
44 | if (($service = fbird_service_attach($s_login['host'], $s_login['user'], $s_login['password'])) != false) {
45 | $content = fbird_restore($service, $job['source'], $job['target'], $job['options'], true);
46 | $content = str_replace(array(chr(0x01).chr(0x0a), 'gbak: '), '', $content);
47 | fbird_service_detach($service);
48 |
49 | // try to connect the restored database
50 | if ($job['connect']) {
51 | $s_login['database'] = $job['target'];
52 | if (!empty($s_sysdba_pw)) {
53 | $s_login['user'] = 'SYSDBA';
54 | $s_login['password'] = $s_sysdba_pw;
55 | }
56 |
57 | if ($dbhandle = db_connect()) {
58 | // connected successfully
59 | $s_connected = true;
60 | remove_edit_panels();
61 | } else {
62 | // connect failed
63 | $content .= ''.$info_strings['FBError'].':'.fbird_errmsg()."
\n";
64 | $s_login['password'] = '';
65 | $s_connected = false;
66 | }
67 | cleanup_session();
68 | }
69 | } else {
70 | $error = fbird_errmsg();
71 | }
72 | break;
73 |
74 | case 'export':
75 |
76 | include './inc/export.inc.php';
77 |
78 | ob_start();
79 | export_data($job['data']);
80 | $content = ob_get_contents();
81 | ob_end_clean();
82 | break;
83 | }
84 |
85 | echo iframe_content($content, $error);
86 |
87 | unset($s_iframejobs[$key]);
88 | globalize_session_vars();
89 | }
90 |
91 | function get_iframejob($iframejobs, $key)
92 | {
93 | if (isset($iframejobs[$key])) {
94 | return $iframejobs[$key];
95 | }
96 |
97 | return false;
98 | }
99 |
100 | function iframe_content($content, $error)
101 | {
102 | return html_head('FirebirdWebAdmin '.VERSION)
103 | ."\n"
104 | .($error ? ''.$GLOBALS['info_strings']['Error'].': '.$error."
\n" : '')
105 | ."\n"
106 | .htmlspecialchars($content)."\n"
107 | ."
\n"
108 | ."\n"
109 | ."