$deps = get_dependencies(OT_UDF, $dname); if (count($deps) > 0) { $message = sprintf($MESSAGES['HAVE_DEPENDENCIES'], $acc_strings['UDF'], $dname, dependencies_string($deps)); } else { if ($s_cust['askdel'] == TRUE) { $s_confirmations['udf'] = array('msg' => sprintf($MESSAGES['CONFIRM_UDF_DELETE'], $dname), 'obj' => $dname); } else { $dname == '-=ALL_DEFINED_UDFS=-' ? drop_all_udfs($s_udfs) : drop_udf($dname); } } } } // // exception stuff // if (have_panel_permissions($s_login['user'], 'acc_exc', TRUE)) { include './inc/exceptions.inc.php'; // reload button if (isset($_POST['acc_exc_reload'])) { $s_udfs_valid = FALSE; } // ordering the udfs table if (isset($_GET['excorder'])) { if ($s_exceptions_order == $_GET['order']) { $s_exceptions_dir = $s_exceptions_dir == 'ASC' ? 'DESC' : 'ASC'; } else { $s_exceptions_order = $_GET['order']; $s_exceptions_dir = 'ASC'; } $s_exceptions_valid = FALSE; }
$s_iframejobs = array_filter($s_iframejobs, create_function('$a', '$a["job"]!="backup";')); $iframekey_backup = md5(uniqid('backup')); $s_iframejobs[$iframekey_backup] = array('job' => 'backup', 'source' => $source_db, 'target' => $target_file, 'options' => $options, 'timestamp' => time()); } elseif (($service = fbird_service_attach($s_login['host'], $s_login['user'], $s_login['password'])) != FALSE) { $result = fbird_backup($service, $source_db, $target_file, $options, $s_backup['verbose']); $message = nl2br(str_replace(array(chr(0x1) . chr(0xa), 'gbak: '), '', $result)); fbird_service_detach($service); } else { $ib_error = fbird_errmsg(); } } } // // 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;
$filename = export_filename($s_export); send_export_headers(get_export_mimetype($s_export['format']), $filename); export_data($s_export); // if we don't stop the execution, the client will download // all the html from the panels ... globalize_session_vars(); exit; } } } $js_stack .= js_data_export(); } // // the Import button on the csv-panel was pushed // if (have_panel_permissions($s_login['user'], 'dt_import', TRUE) && isset($_POST['dt_import_doit'])) { // import empty values as NULL option $s_csv['import_null'] = isset($_POST['dt_import_null']) ? TRUE : FALSE; if ($_POST['dt_import_table'] == '') { $warning .= $WARNINGS['SELECT_TABLE_FIRST']; } elseif (isset($_FILES['dt_import_file']['name']) && $_FILES['dt_import_file']['name'] == '') { $warning .= $WARNINGS['SELECT_FILE_FIRST']; } else { $ifile = $_FILES['dt_import_file']['tmp_name']; $itable = $_POST['dt_import_table']; $ihandle = fopen($ifile, 'r') or die('Error opening ' . $ifile); // fill $columns[] with the $s_fields[] elements for $itable // but ignore blob fields and computed fields foreach ($s_fields[$itable] as $field) { if ($field['type'] == 'BLOB' && $field['stype'] != 1 || isset($field['comp']) && $field['comp'] == 'Yes') { // no computed columns please
if (isset($_POST['sql_pointer']) && abs($_POST['sql_pointer'] < SQL_HISTORY_SIZE)) { $s_sql_pointer = abs($_POST['sql_pointer']); } else { $s_sql_pointer = 0; } $s_sql['buffer'] = ''; $sql_script = isset($s_sql_buffer[$s_sql_pointer]) ? $s_sql_buffer[$s_sql_pointer] : ''; } // include the javascript for sql-buffer requests $js_stack .= js_request_sql_buffer(); } // // script is called from the enter command form // if (isset($_POST['sql_run']) || isset($_POST['sql_display_all']) || isset($_POST['sql_execute'])) { if (!have_panel_permissions($s_login['user'], 'sql_enter')) { exit; } // remove empty lines from userinput and put the statements into $lines[] if (isset($_POST['sql_run']) || isset($_POST['sql_execute'])) { $lines = explode(';', $sql_script); //remove whitespace and empty lines foreach ($lines as $idx => $cmd) { $cmd = trim($cmd); if ($cmd == '') { array_splice($lines, $idx, 1); continue; } $lines[$idx] = $cmd; // execute the whole script through isql, if it contains a CREATE DATABASE, PROCEDURE or TRIGGER if (preg_match('/^CREATE(\\s)+(DATABASE|SCHEMA|PROCEDURE|TRIGGER)/i', $cmd)) {
case 'user': if (drop_user($s_confirmations['user']['obj'], $s_sysdba_pw)) { unset($users[$s_confirmations['user']['obj']]); } unset($s_confirmations['user']); break; } } // deleting a subject is canceled if (isset($_POST['confirm_no'])) { unset($s_confirmations[$_POST['confirm_subject']]); } // // customizing // if (have_panel_permissions($s_login['user'], 'usr_cust')) { if (isset($_POST['usr_cust_save'])) { $old_settings = $s_cust; $s_cust['language'] = get_request_data('usr_cust_language'); $s_cust['askdel'] = get_request_data('usr_cust_askdel') == $usr_strings['Yes'] ? 1 : 0; $settings_changed = TRUE; } // reset the customizing values to the configuration defaults if (isset($_POST['usr_cust_defaults'])) { $old_settings = $s_cust; $s_cust = get_customize_defaults($s_useragent); $settings_changed = TRUE; } if ($settings_changed = TRUE && isset($old_settings)) { if ($old_settings['language'] != $s_cust['language']) { include './lang/' . $s_cust['language'] . '.inc.php';
$s_create_table = ''; $s_create_num = 0; $s_coldefs = array(); $s_modify_col = ''; } else { $ib_error = fbird_errmsg(); fbird_rollback($trans); if (isset($mod_flag) && $mod_flag == TRUE) { $col_mod_flag = TRUE; } if (isset($add_flag) && $add_flag == TRUE) { $col_add_flag = TRUE; } } } if (have_panel_permissions($s_login['user'], 'tb_show')) { // include the javascript for detail requests $js_stack .= js_request_details(); // // Reload button from the tb_show panel // if (isset($_POST['tb_show_reload'])) { $s_tables_counts = (bool) get_request_data('tb_show_counts'); $s_tables_cnames = (bool) get_request_data('tb_show_cnames'); $s_tables_def = (bool) get_request_data('tb_show_def'); $s_tables_comp = (bool) get_request_data('tb_show_comp'); $s_tables_comment = (bool) get_request_data('tb_show_comments'); $s_tables_valid = FALSE; } $js_stack .= js_request_comment_area(); }
if (isset($_POST['db_systable_select'])) { if ($s_systable['table'] != $_POST['db_systable']) { $s_systable['order'] = ''; $s_systable['dir'] = 'ASC'; } $s_systable['table'] = $_POST['db_systable']; $s_systable['ffield'] = $_POST['db_sysfield']; $s_systable['fvalue'] = $_POST['db_sysvalue']; $s_systable['sysdata'] = isset($_POST['db_sysdata']) ? TRUE : FALSE; } if (isset($_GET['order'])) { $s_systable['dir'] = $_GET['order'] == $s_systable['order'] && $s_systable['dir'] == 'ASC' ? 'DESC' : 'ASC'; $s_systable['order'] = $_GET['order']; } // determine the informations for the selected system table if (have_panel_permissions($s_login['user'], 'db_systable', TRUE)) { $js_stack .= js_request_filter_fields(); if (FALSE && strpos($s_systable['table'], 'MON$') === 0) { // DISABLED ! $have_refresh = TRUE; // TODO: replace with XMLHttpRequest and markableTable() $js_stack .= js_jsrs_refresh_systable(); } else { $have_refresh = FALSE; } if ($s_connected && !empty($s_systable['table'])) { include './inc/system_table.inc.php'; $systable = get_systable($s_systable); $js_stack .= js_markable_table(); } }