/**
 * This file is part of MySQLDumper released under the GNU/GPL 2 license
 * http://www.mysqldumper.net
 *
 * @package         MySQLDumper
 * @version         SVN: $rev: 1207 $
 * @author          $Author$
 * @lastmodified    $Date$
 */
if (!defined('MSD_VERSION')) {
    die('No direct access.');
}
include './inc/define_icons.php';
$hta = '';
$tplHomeProtectionEdit = new MSDTemplate();
$tplHomeProtectionEdit->set_filenames(array('tplHomeProtectionEdit' => 'tpl/home/protection_edit.tpl'));
if (isset($_POST['hta_content'])) {
    if ($fp = fopen('./.htaccess', 'w')) {
        if (fwrite($fp, $_POST['hta_content'])) {
            $tplHomeProtectionEdit->assign_block_vars('HTA_SAVED_SUCCESSFULLY', array());
        } else {
            $tplHomeProtectionEdit->assign_block_vars('HTA_SAVED_UNSUCCESSFULLY', array());
        }
        fclose($fp);
    } else {
        $tplHomeProtectionEdit->assign_block_vars('ERROR_OPENING_HTACCESS', array());
    }
}
if (file_exists('./.htaccess') && is_readable('./.htaccess')) {
    $hta = implode('', file('./.htaccess'));
 */
if (!defined('MSD_VERSION')) {
    die('No direct access.');
}
$selectedFilter = -1;
if (isset($_POST['filter_selected'])) {
    $selectedFilter = $_POST['filter_selected'];
}
$res = $dbo->query('SHOW GLOBAL STATUS', MsdDbFactory::ARRAY_ASSOC);
foreach ($res as $row) {
    $status[$row['Variable_name']] = $row['Value'];
}
$filter = getPrefixArray($status);
// values that will be formatted as times
$timeValues = array('Uptime', 'Uptime_since_flush_status');
$tplSqlbrowserGeneralStatus = new MSDTemplate();
$tplSqlbrowserGeneralStatus->set_filenames(array('tplSqlbrowserGeneralStatus' => 'tpl/sqlbrowser/general/status.tpl'));
if ($selectedFilter != '-1') {
    $query = 'SHOW GLOBAL STATUS LIKE \'' . $selectedFilter . '_%\'';
    $res = $dbo->query($query, MsdDbFactory::ARRAY_ASSOC);
}
if (@sizeof($res) == 0) {
    $tpl->assign_block_vars('NO_STATUS', array());
} else {
    if (count($filter) > 0) {
        $tplSqlbrowserGeneralStatus->assign_block_vars('FILTER', array('SEL_FILTER' => Html::getOptionlist($filter, $selectedFilter)));
    }
    $i = 0;
    foreach ($status as $key => $val) {
        if ($selectedFilter != '-1' && substr($key, 0, strlen($selectedFilter)) != $selectedFilter) {
            continue;
 * @package         MySQLDumper
 * @version         SVN: $rev: 1205 $
 * @author          $Author$
 * @lastmodified    $Date$
 */
if (!defined('MSD_VERSION')) {
    die('No direct access.');
}
/*
 * Fetch and check _GET variables
 */
$db = isset($_GET['db']) ? base64_decode($_GET['db']) : $config['db_actual'];
$tablename = isset($_GET['tablename']) ? base64_decode($_GET['tablename']) : '';
$dbo->selectDb($db);
$tableInfos = $dbo->getTableColumns($tablename, $db);
$tplSqlbrowserTableEditTable = new MSDTemplate();
$tplSqlbrowserTableEditTable->set_filenames(array('tplSqlbrowserTableEditTable' => 'tpl/sqlbrowser/table/edit_table.tpl'));
$tplSqlbrowserTableEditTable->assign_vars(array('DB' => $db, 'TABLE' => $tablename));
$sumSize = 0;
$i = 0;
foreach ($tableInfos as $key => $tableInfo) {
    if ($key != 'primary_keys') {
        $type = $tableInfo['Type'];
        $typeTemp = array();
        // ENUM-/SET-Handling
        if (strpos($type, 'enum') !== false || strpos($type, 'set') !== false) {
            $toBeReplaced = array('set(', 'enum(', ')', '\'');
            $typeTemp = str_replace($toBeReplaced, '', $type);
            $typeTemp = explode(',', $typeTemp);
            sort($typeTemp);
            if (strpos($type, 'enum') !== false) {
 */
if (!defined('MSD_VERSION')) {
    die('No direct access.');
}
$selectedFilter = -1;
if (isset($_POST['filter_selected'])) {
    $selectedFilter = $_POST['filter_selected'];
}
$vars = array();
$res = $dbo->query('SHOW VARIABLES', MsdDbFactory::ARRAY_ASSOC);
$numrows = @sizeof($res);
foreach ($res as $row) {
    $vars[$row['Variable_name']] = $row['Value'];
}
$filter = getPrefixArray($vars);
$tplSqlbrowserGeneralMysqlVariables = new MSDTemplate();
$tplSqlbrowserGeneralMysqlVariables->set_filenames(array('tplSqlbrowserGeneralMysqlVariables' => 'tpl/sqlbrowser/general/mysqlVariables.tpl'));
$tplSqlbrowserGeneralMysqlVariables->assign_vars(array('SEL_FILTER' => Html::getOptionlist($filter, $selectedFilter)));
if (count($vars) == 0) {
    $tpl->assign_block_vars('NO_VALUES', array());
} else {
    $i = 0;
    foreach ($vars as $name => $val) {
        if ($selectedFilter != '-1' && substr($name, 0, strlen($selectedFilter)) != $selectedFilter) {
            continue;
        }
        if (is_numeric($val)) {
            if (strpos($name, 'time') === false) {
                $val = String::formatNumber($val);
            } else {
                $val = getTimeFormat($val);
        getConfig($config['config_file']);
    }
    $del = @unlink('./' . $config['paths']['config'] . $deleteConfig . '.php');
    if ($del) {
        // delete Perl config file
        $delFile = $config['paths']['config'] . $deleteConfig . '.conf.php';
        $del = @unlink('./' . $delFile);
    }
    if ($del === false) {
        $msg = '<p class="error">' . sprintf($lang['L_ERROR_DELETING_CONFIGFILE'], $deleteConfig) . '</p>';
    } else {
        $msg = '<p class="success">' . sprintf($lang['L_SUCCESS_DELETING_CONFIGFILE'], $deleteConfig) . '</p>';
    }
    $sel = 'configs';
}
$tplConfigurationConfigFiles = new MSDTemplate();
$tplConfigurationConfigFiles->set_filenames(array('tplConfigurationConfigFiles' => 'tpl/configuration/configFiles.tpl'));
$tplConfigurationConfigFiles->assign_vars(array('ICON_SAVE' => $icon['small']['save'], 'ICON_SEARCH' => $icon['search'], 'ICON_EDIT' => $icon['edit'], 'ICON_DELETE' => $icon['delete']));
$i = 0;
$configs = getConfigFilenames();
// iterate config files and print settings to screen
foreach ($configs as $c) {
    $i++;
    unset($databases);
    $databases = array();
    getConfig($c);
    $rowclass = $i % 2 ? 'dbrow' : 'dbrow1';
    if ($oldConfig == $c) {
        $rowclass = 'dbrowsel';
        // highlight active configuration
    }
<?php

/**
 * This file is part of MySQLDumper released under the GNU/GPL 2 license
 * http://www.mysqldumper.net
 *
 * @package         MySQLDumper
 * @version         SVN: $rev: 1207 $
 * @author          $Author$
 * @lastmodified    $Date$
 */
if (!defined('MSD_VERSION')) {
    die('No direct access.');
}
if (isset($_POST['save'])) {
    if (!is_array($config['auto_delete'])) {
        $config['auto_delete'] = array();
        $config['auto_delete']['activated'] = 0;
        $config['auto_delete']['max_backup_files'] = 3;
    }
    if (isset($_POST['auto_delete'])) {
        $config['auto_delete']['activated'] = (int) $_POST['auto_delete'];
    }
    if (isset($_POST['max_backup_files'])) {
        $config['auto_delete']['max_backup_files'] = (int) $_POST['max_backup_files'];
    }
}
$tplConfigurationAutodelete = new MSDTemplate();
$tplConfigurationAutodelete->set_filenames(array('tplConfigurationAutodelete' => 'tpl/configuration/autodelete.tpl'));
$tplConfigurationAutodelete->assign_vars(array('ICON_SAVE' => $icon['small']['save'], 'AUTODELETE_ENABLED_SELECTED' => Html::getChecked($config['auto_delete']['activated'], 1), 'AUTODELETE_DISABLED_SELECTED' => Html::getChecked($config['auto_delete']['activated'], 0), 'MAX_BACKUP_FILES' => (int) $config['auto_delete']['max_backup_files'], 'MAX_BACKUP_FILES_DISABLED' => Html::getDisabled($config['auto_delete']['activated'], 0)));
        $config['interface_server_caption_position'] = 0;
    }
    if (isset($_POST['sqlboxsize'])) {
        $config['interface_sqlboxsize'] = (int) $_POST['sqlboxsize'];
    }
    if (isset($_POST['theme'])) {
        $config['theme'] = (string) $_POST['theme'];
    }
    // make sure that the theme exists! If not fall back to standard theme
    if (!is_dir('./css/' . $config['theme']) || !is_readable('./css/' . $config['theme'])) {
        $config['theme'] = 'msd';
    }
    if (isset($_POST['notification_position'])) {
        $config['notification_position'] = $_POST['notification_position'];
    }
    if (isset($_POST['interface_table_compact'])) {
        $config['interface_table_compact'] = (int) $_POST['interface_table_compact'];
    }
    if (isset($_POST['resultsPerPage'])) {
        $config['resultsPerPage'] = (int) $_POST['resultsPerPage'];
    }
    if (isset($_POST['refresh_processlist'])) {
        $config['refresh_processlist'] = (int) $_POST['refresh_processlist'];
    }
    if ($config['refresh_processlist'] < 2) {
        $config['refresh_processlist'] = 2;
    }
}
$tplConfigurationInterface = new MSDTemplate();
$tplConfigurationInterface->set_filenames(array('tplConfigurationInterface' => 'tpl/configuration/interface.tpl'));
$tplConfigurationInterface->assign_vars(array('ICON_SAVE' => $icon['small']['save'], 'SEL_LANGUAGES' => getLanguageCombo(), 'LINK_DOWNLOAD_LANGUAGE_PACKS' => 'http://forum.mysqldumper.de/downloads.php?cat=9', 'LANGUAGE' => $config['language'], 'SERVER_CAPTION' => $config['interface_server_caption'], 'INTERFACE_SERVER_CAPTION_ACTIVATED' => Html::getChecked($config['interface_server_caption'], 1), 'INTERFACE_SERVER_CAPTION_DISABLED' => Html::getDisabled($config['interface_server_caption'], 0), 'SERVER_CAPTION_POS_MAINFRAME_SELECTED' => Html::getChecked($config['interface_server_caption_position'], 1), 'SERVER_CAPTION_POS_MENUE_SELECTED' => Html::getChecked($config['interface_server_caption_position'], 0), 'SEL_THEME' => getThemes(), 'LINK_DOWNLOAD_THEMES' => 'http://forum.mysqldumper.de/downloads.php?cat=3', 'SQLBOX_HEIGHT' => intval($config['interface_sqlboxsize']), 'RESULTS_PER_PAGE' => intval($config['resultsPerPage']), 'SEL_NOTIFICATION_POSITION' => Html::getOptionlist($positions, $config['notification_position']), 'REFRESH_PROCESSLIST' => (int) $config['refresh_processlist'], 'SQL_GRID_TYPE_COMPACT_SELECTED' => $config['interface_table_compact'] == 1 ? ' checked="checked"' : '', 'SQL_GRID_TYPE_NORMAL_SELECTED' => $config['interface_table_compact'] == 0 ? ' checked="checked"' : ''));
Example #8
0
$_GET = Html::trimDeep($_GET);
// get Page to include
$p = isset($_GET['p']) ? (string) $_GET['p'] : 'home';
if (isset($_POST['p'])) {
    $p = (string) $_POST['p'];
}
$action = isset($_GET['action']) ? (string) $_GET['action'] : '';
if (isset($_POST['action'])) {
    $action = (string) $_POST['action'];
}
$dbo = null;
$log = new Log();
if ($action != 'dl') {
    // don't send HTML-Header if download of file is started
    obstart();
    $tplGlobalHeader = new MSDTemplate();
    $tplGlobalHeader->set_filenames(array('tplGlobalHeader' => 'tpl/globalHeader.tpl'));
    $language = explode('_', $config['language'], 2);
    $language = $language[0];
    $tplGlobalHeader->assign_vars(array('LANGUAGE' => $language, 'MSD_VERSION' => MSD_VERSION, 'THEME' => $config['theme'], 'DIRECTION' => 'ltr'));
}
// in some cases (config changed, reload database list, etc.) the menu must be
// rendered before the content
// is handled to update parameters that are used
if (isset($_POST['selected_config']) || isset($_GET['config']) || isset($_GET['dbrefresh']) || isset($_POST['dbindex']) || isset($_GET['dbindex'])) {
    include './inc/menu.php';
}
switch ($p) {
    case 'dump':
        include './inc/dump.php';
        break;
Example #9
0
$dh = opendir($config['paths']['backup']);
while (false !== ($filename = readdir($dh))) {
    if ($filename != '.' && $filename != '..' && !is_dir($config['paths']['backup'] . $filename)) {
        $files[] = $filename;
        $Sum_Files++;
        $Sum_Size += filesize($config['paths']['backup'] . $filename);
        $ft = filectime($config['paths']['backup'] . $filename);
        if (!isset($Last_BU[2]) || isset($Last_BU[2]) && $ft > $Last_BU[2]) {
            $Last_BU[0] = $filename;
            $Last_BU[1] = date("d.m.Y H:i", $ft);
            $Last_BU[2] = $ft;
        }
    }
}
$directory_warnings = DirectoryWarnings();
$tpl = new MSDTemplate();
$tpl->set_filenames(array('show' => 'tpl/home/home.tpl'));
$tpl->assign_vars(array('THEME' => $config['theme'], 'MSD_VERSION' => MSD_VERSION, 'OS' => MSD_OS, 'OS_EXT' => MSD_OS_EXT, 'MYSQL_VERSION' => MSD_MYSQL_VERSION, 'PHP_VERSION' => PHP_VERSION, 'MEMORY' => byte_output($config['php_ram'] * 1024 * 1024), 'MAX_EXECUTION_TIME' => $config['max_execution_time'], 'PHP_EXTENSIONS' => $config['phpextensions'], 'SERVER_NAME' => $_SERVER['SERVER_NAME'], 'MSD_PATH' => $config['paths']['root'], 'DB' => $databases['db_actual'], 'NR_OF_BACKUP_FILES' => $Sum_Files, 'SIZE_BACKUPS' => byte_output($Sum_Size), 'FREE_DISKSPACE' => MD_FreeDiskSpace()));
if ($directory_warnings > '') {
    $tpl->assign_block_vars('DIRECTORY_WARNINGS', array('MSG' => $directory_warnings));
}
if ($config['disabled'] > '') {
    $tpl->assign_block_vars('DISABLED_FUNCTIONS', array('PHP_DISABLED_FUNCTIONS' => str_replace(',', ', ', $config['disabled'])));
}
// Zlib is buggy from version 4.3.0 upto 4.3.2, so lets check for these versions
if (version_compare(PHP_VERSION, '4.3.0', '>=') && version_compare(PHP_VERSION, '4.3.2', '<=')) {
    $tpl->assign_block_vars('ZLIBBUG', array());
}
if (!extension_loaded('ftp')) {
    $tpl->assign_block_vars('NO_FTP', array());
}
    foreach ($sql as $index => $query) {
        //$res = MSD_query($query, false);
        $res = $dbo->query($query, MsdDbFactory::SIMPLE);
        if (true === $res) {
            $tplSqlbrowserDbOperation->assign_block_vars('ROW', array('ROWCLASS' => $index % 2 ? 'dbrow' : 'dbrow1', 'NR' => $index + 1, 'DBNAME' => $associatedDatabase[$index], 'ACTION' => $actionOutput, 'QUERY' => $query));
        } else {
            $tplSqlbrowserDbOperation->assign_block_vars('ERROR', array('ROWCLASS' => $index % 2 ? 'dbrow' : 'dbrow1', 'NR' => $index + 1, 'DBNAME' => $associatedDatabase[$index], 'ACTION' => $actionOutput, 'QUERY' => $query, 'ERROR' => mysql_error($config['dbconnection'])));
        }
        $i++;
    }
    if ($do == 'db_delete') {
        setDefaultConfig();
    }
}
//list databases
$tplSqlbrowserDbListDatabases = new MSDTemplate();
$tplSqlbrowserDbListDatabases->set_filenames(array('tplSqlbrowserDbListDatabases' => 'tpl/sqlbrowser/db/list_databases.tpl'));
$tplSqlbrowserDbListDatabases->assign_vars(array('ICON_DB' => $icon['db'], 'ICON_VIEW' => $icon['view'], 'ICON_EDIT' => $icon['edit'], 'ICON_DELETE' => $icon['delete'], 'ICON_PLUS' => $icon['plus'], 'ICON_MINUS' => $icon['minus'], 'ICON_TRUNCATE' => $icon['truncate'], 'CONFIRM_TRUNCATE_DATABASES' => Html::getJsQuote($lang['L_CONFIRM_TRUNCATE_DATABASES'], true), 'CONFIRM_DROP_DATABASES' => Html::getJsQuote($lang['L_CONFIRM_DROP_DATABASES'], true)));
$i = 0;
foreach ($databases as $dbName => $val) {
    $rowclass = $i % 2 ? 'dbrow' : 'dbrow1';
    if ($dbName == $config['db_actual']) {
        $rowclass = "dbrowsel";
    }
    //does the database exist?
    if (!$dbo->selectDb($dbName, true)) {
        // no -> show message "doesn't exist"
        $tplSqlbrowserDbListDatabases->assign_block_vars('DB_NOT_FOUND', array('ROWCLASS' => $rowclass, 'NR' => $i + 1, 'DB_NAME' => $dbName, 'DB_ID' => $i));
        // if this happens the list is not accurate
        // -> reload db-list to remove deleted dbs
        setDefaultConfig();
 */
if (!defined('MSD_VERSION')) {
    die('No direct access.');
}
// remove table selection from previous runs
if (isset($dump['sel_tbl'])) {
    unset($dump['sel_tbl']);
}
if (isset($_SESSION['dump']['sel_tbl'])) {
    unset($_SESSION['dump']['sel_tbl']);
}
//if we are not in mode expert -> reset hidden settings to safe defaults
if ($config['msd_mode'] == 0) {
    $config['replace_command'] = 0;
}
$tplDumpPrepare = new MSDTemplate();
$tplDumpPrepare->set_filenames(array('tplDumpPrepare' => 'tpl/dump/dump_prepare.tpl'));
if ($config['msd_mode'] > 0) {
    $tplDumpPrepare->assign_block_vars('MODE_EXPERT', array());
}
// set charset-selectbox to standard-encoding of MySQL-Server as initial value
$dump['sel_dump_encoding'] = 'utf8';
$dump['dump_encoding'] = 'utf8';
$charsets = $dbo->getCharsets();
foreach ($charsets as $name => $val) {
    $charsetsDescription[$name] = $name . ' - ' . $val['Description'];
}
// tables will be selected on next page, but we need a dummy val
// for prepareDumpProcess()
$dump['selected_tables'] = false;
$dbsToBackup = array();
// save selected values from the last site
$dump['comment'] = $_POST['comment'];
$dump['sel_dump_encoding'] = $_POST['sel_dump_encoding'];
$dump['dump_encoding'] = $dump['sel_dump_encoding'];
// we need to save this before the Ajax-Requests starts, so we are doing it here
// although it is done in dump.php
$_SESSION['dump'] = $dump;
// checks after first dump-prepare if we need to head over to table selection
// or if we can start the backup process
if (!isset($_POST['tableselect'])) {
    // nothing to select - start dump action
    $action = 'do_dump';
} else {
    // yes, we need to show the table-selection, but first save commetn and
    // encoding that was set before
    $tplDumpSelectTables = new MSDTemplate();
    $tplDumpSelectTables->set_filenames(array('tplDumpSelectTables' => 'tpl/dump/selectTables.tpl'));
    $dbo->selectDb($dump['db_actual']);
    $tables = $dbo->getTableStatus();
    $i = 0;
    foreach ($tables as $tableName => $row) {
        $klasse = $i % 2 ? 1 : '';
        $tableSize = byteOutput($row['Data_length'] + $row['Index_length']);
        $tableType = $row['Engine'];
        $nrOfRecords = String::formatNumber($row['Rows']);
        if (substr($row['Comment'], 0, 4) == 'VIEW' && $row['Engine'] == '') {
            $tableType = 'View';
            $tableSize = '-';
            $nrOfRecords = '-';
        }
        $tplDumpSelectTables->assign_block_vars('ROW', array('CLASS' => 'dbrow' . $klasse, 'ID' => $i, 'NR' => $i + 1, 'TABLENAME' => $tableName, 'TABLETYPE' => $tableType, 'RECORDS' => $nrOfRecords, 'SIZE' => $tableSize, 'LAST_UPDATE' => $row['Update_time']));
<?php

// Edit record -> built Edit-Form
$tpl = new MSDTemplate();
$tpl->set_filenames(array('show' => './tpl/sqlbrowser/sql_record_update_inputmask.tpl'));
$target = $mode == "searchedit" ? '?mode=searchedit' : '?mode=update';
// jump back to search hit list after saving
$fields = getExtendedFieldInfo($db, $tablename);
$sqledit = "SELECT * FROM `{$tablename}` WHERE " . $recordkey;
$res = MSD_query($sqledit);
$record = mysqli_fetch_array($res, MYSQLI_ASSOC);
// get the record
$num = sizeof($record);
// get the nr of fields of the record
// iterate fields
$x = 0;
$fieldnames = '';
foreach ($record as $field => $fieldvalue) {
    $fieldnames .= $field . '|';
    $tpl->assign_block_vars('ROW', array('CLASS' => $x % 2 ? 1 : 2, 'FIELD_NAME' => $field, 'FIELD_VALUE' => my_quotes($fieldvalue), 'FIELD_ID' => correct_post_index($field)));
    if ('YES' == $fields[$field]['null']) {
        //field is nullable - precheck checkbox if value is null
        $tpl->assign_block_vars('ROW.IS_NULLABLE', array('NULL_CHECKED' => is_null($fieldvalue) ? ' checked="checked"' : ''));
    }
    $type = strtoupper($fields[$field]['type']);
    if (in_array($type, array('BLOB', 'TEXT'))) {
        $tpl->assign_block_vars('ROW.IS_TEXTAREA', array());
    } else {
        $tpl->assign_block_vars('ROW.IS_TEXTINPUT', array());
    }
    $x++;
 * @lastmodified    $Date: $
 */
error_reporting(E_ALL);
chdir('./../');
include './inc/classes/db/MsdDbFactory.php';
include './inc/classes/helper/Html.php';
include './inc/functions/functions.php';
include './inc/runtime.php';
include './inc/mysql.php';
include './inc/functions/functions_global.php';
include './lib/template.php';
include './inc/functions/functions_restore.php';
include './lib/json.php';
obstart(true);
include './inc/functions/functions_sql.php';
$tplSqlbrowserTableShowTabledataEntry = new MSDTemplate();
$tplSqlbrowserTableShowTabledataEntry->set_filenames(array('tplSqlbrowserTableShowTabledataEntry' => './tpl/sqlbrowser/table/show_tabledata_entry.tpl'));
/*
 * Fetch and check _GET variables
 */
$validModes = array('VIEW', 'EDIT', 'NEW');
$db = isset($_GET['db']) ? base64_decode($_GET['db']) : $config['db_actual'];
$tablename = isset($_GET['tablename']) ? base64_decode($_GET['tablename']) : '';
$rowKey = isset($_GET['key']) ? base64_decode($_GET['key']) : '';
$mode = 'VIEW';
if (isset($_GET['do'])) {
    $mode = strtoupper((string) $_GET['do']);
}
if (!in_array($mode, $validModes)) {
    $mode = 'VIEW';
}
Example #15
0
/**
 * This file is part of MySQLDumper released under the GNU/GPL 2 license
 * http://www.mysqldumper.net
 *
 * @package         MySQLDumper
 * @version         SVN: $rev: 1207 $
 * @author          $Author$
 * @lastmodified    $Date$
 */
if (!defined('MSD_VERSION')) {
    die('No direct access.');
}
// special div selected? DIV with this id will be shown e.g after pressing
// the save button
$sel = isset($_POST['sel']) ? $_POST['sel'] : 'db';
if (isset($_GET['sel'])) {
    $sel = $_GET['sel'];
}
$tplConfigurationFooter = new MSDTemplate();
$tplConfigurationFooter->set_filenames(array('tplConfigurationFooter' => 'tpl/configuration/footer.tpl'));
$tplConfigurationFooter->assign_vars(array('SELECTED_DIV' => $sel, 'NOTIFICATION_POSITION' => $config['notification_position']));
//output notification message if we have one
if ($msg > '') {
    $tplConfigurationFooter->assign_block_vars('MESSAGE', array('TEXT' => Html::getJsQuote($msg, true)));
}
// if something went wrong with the change of a user or no database was found
// -> blend in connection params and let the user correct it
if (isset($blendInConnectionParams) && $blendInConnectionParams || count($databases) == 0) {
    $tplConfigurationFooter->assign_block_vars('SWITCH_TO_CONNECTION_PARAMETER', array());
}
Example #16
0
<?php

if (!@ob_start("ob_gzhandler")) {
    @ob_start();
}
include_once './inc/header.php';
include './inc/template.php';
$lang_old = $config['language'];
$config_refresh = '';
// define template
$tpl = new MSDTemplate();
$tpl->set_filenames(array('header' => 'tpl/menu/header.tpl', 'footer' => 'tpl/menu/footer.tpl', 'content' => 'tpl/menu/content.tpl'));
$tpl->assign_vars(array('MSD_VERSION' => MSD_VERSION, 'CONFIG_HOMEPAGE' => $config['homepage'], 'CONFIG_THEME' => $config['theme']));
if (isset($_POST['selected_config']) || isset($_GET['config'])) {
    if (isset($_POST['selected_config'])) {
        $new_config = $_POST['selected_config'];
    }
    // Configuration was switched in content frame?
    if (isset($_GET['config'])) {
        $new_config = $_GET['config'];
    }
    // restore the last active menuitem
    if (is_readable($config['paths']['config'] . $new_config . '.php')) {
        clearstatcache();
        unset($databases);
        $databases = array();
        if (read_config($new_config)) {
            $config['config_file'] = $new_config;
            $_SESSION['config_file'] = $new_config;
            //$config['config_file'];
            $config_refresh = '
Example #17
0
<?php

/**
 * This file is part of MySQLDumper released under the GNU/GPL 2 license
 * http://www.mysqldumper.net
 *
 * @package         MySQLDumper
 * @version         SVN: $rev: 1207 $
 * @author          $Author$
 * @lastmodified    $Date$
 */
include './language/lang_list.php';
$langOld = $config['language'];
// define template
$tplMenu = new MSDTemplate();
$tplMenu->set_filenames(array('tplMenu' => 'tpl/menu/menu.tpl'));
$tplMenu->assign_vars(array('PAGE' => $p, 'ACTION_SET' => $action > '' ? '&amp;action=' . $action : '', 'MSD_VERSION' => MSD_VERSION . ' (' . MSD_VERSION_SUFFIX . ')', 'CONFIG_HOMEPAGE' => $config['homepage'], 'CONFIG_THEME' => $config['theme'], 'CONFIG_FILE' => $config['config_file']));
// set picture according to mode
if ($config['msd_mode'] == 0) {
    $tplMenu->assign_block_vars('MSD_MODE_EASY', array());
} else {
    $tplMenu->assign_block_vars('MSD_MODE_EXPERT', array());
}
if (isset($_POST['selected_config']) || isset($_GET['config'])) {
    // Configuration was switched in menu frame
    if (isset($_POST['selected_config'])) {
        $newConfig = $_POST['selected_config'];
    }
    if (is_readable($config['paths']['config'] . $newConfig . '.php')) {
        clearstatcache();
        unset($databases);
<?php

/**
 * This file is part of MySQLDumper released under the GNU/GPL 2 license
 * http://www.mysqldumper.net
 *
 * @package         MySQLDumper
 * @version         SVN: $rev: 1207 $
 * @author          $Author$
 * @lastmodified    $Date$
 */
if (!defined('MSD_VERSION')) {
    die('No direct access.');
}
$tplSqlbrowserTopnav = new MSDTemplate();
$tplSqlbrowserTopnav->set_filenames(array('tplSqlbrowserTopnav' => 'tpl/sqlbrowser/nav/topnav_general.tpl'));
$tplSqlbrowserTopnav->assign_vars(array('ICON_DB' => $icon['db'], 'ICON_VIEW' => $icon['view'], 'ICON_EDIT' => $icon['edit']));
    $_SESSION['restore'] = $restore;
    $logMsg = sprintf($lang['L_START_RESTORE_DB_FILE'], $config['db_actual'], $restore['filename']);
    $log->write(Log::PHP, $logMsg);
} else {
    $config = $_SESSION['config'];
    $databases = $_SESSION['databases'];
    $restore = $_SESSION['restore'];
}
// tables to create
$tablesDone = 0;
if ($restore['table_ready'] > 0) {
    $tablesDone = $restore['table_ready'];
}
if ($restore['tables_total'] > 0) {
    $tablesToDo = $restore['tables_total'];
} else {
    $tablesToDo = $lang['L_UNKNOWN'];
}
if ($restore['tables_total'] > 0) {
    $tablesToCreate = sprintf($lang['L_RESTORE_TABLES_COMPLETED'], $tablesDone, $tablesToDo);
} else {
    $tablesToCreate = sprintf($lang['L_RESTORE_TABLES_COMPLETED0'], $tablesDone);
}
$tplRestore = new MSDTemplate();
$tplRestore->set_filenames(array('tplRestore' => 'tpl/restore/restore.tpl'));
$restoringDb = sprintf($lang['L_RESTORE_DB'], $config['db_actual'], $config['dbhost']);
$tplRestore->assign_vars(array('SESSION_ID' => session_id(), 'ICONPATH' => $config['files']['iconpath'], 'ICON_PLUS' => $icon['plus'], 'DB_ON_SERVER' => $restoringDb, 'FILENAME' => $restore['filename'], 'CHARSET' => $restore['dump_encoding'], 'TABLES_TO_CREATE' => $tablesToCreate, 'NOTIFICATION_POSITION' => $config['notification_position']));
if ($restore['part'] > 0) {
    $tplRestore->assign_block_vars('MULTIPART', array('PART' => $restore['part']));
}
$_SESSION['restore'] = $restore;
        if (isset($databases[$dbToAdd])) {
            $addDbMessage = sprintf($lang['L_DB_IN_LIST'], $dbToAdd);
        } else {
            $dbo = MsdDbFactory::getAdapter($config['dbhost'], $config['dbuser'], $config['dbpass'], $config['dbport'], $config['dbsocket']);
            try {
                $dbo->selectDb($dbToAdd, true);
                addDatabaseToConfig($dbToAdd);
                $saveConfig = true;
            } catch (Exception $e) {
                $addDbMessage = $lang['L_ERROR'] . ': (' . $e->getCode() . ') ';
                $addDbMessage .= $e->getMessage();
            }
        }
    }
}
$tplConfigurationDatabases = new MSDTemplate();
$tplConfigurationDatabases->set_filenames(array('tplConfigurationDatabases' => 'tpl/configuration/databases.tpl'));
$tplConfigurationDatabases->assign_vars(array('ICON_SAVE' => $icon['small']['save'], 'DB_HOST' => $config['dbhost'], 'DB_USER' => $config['dbuser'], 'DB_PASS' => $config['dbpass'], 'DB_PORT' => $config['dbport'], 'DB_SOCKET' => $config['dbsocket'], 'ICON_EDIT' => $icon['edit'], 'ICON_DOWN' => $icon['arrow_down'], 'ICON_PLUS' => $icon['plus'], 'ICON_MINUS' => $icon['minus']));
if (isset($addDbMessage) && $addDbMessage > '') {
    $tplConfigurationDatabases->assign_block_vars('MANUAL_DB_ADD', array('MESSAGE' => $addDbMessage));
}
//Wenn Datenbanken vorhanden sind
if (count($databases) > 0) {
    $dbCount = count($databases);
    $tplConfigurationDatabases->assign_block_vars('DBS', array('DB_COUNT' => $dbCount));
    $i = 0;
    foreach ($databases as $dbName => $val) {
        if (!isset($val['dump'])) {
            $val['dump'] = 0;
        }
        if (!isset($val['prefix'])) {
Example #21
0
    echo '<p align="center"><a href="main.php">&lt;&lt; Home</a></p>';
    phpinfo();
    echo '<p align="center"><a href="main.php">&lt;&lt; Home</a></p>';
    exit;
}
if (isset($_POST['htaccess']) || $action == 'schutz') {
    include './inc/home/protection_create.php';
}
if ($action == 'edithtaccess') {
    include './inc/home/protection_edit.php';
}
if ($action == 'deletehtaccess') {
    include './inc/home/protection_delete.php';
}
// Output headnavi
$tpl = new MSDTemplate();
$tpl->set_filenames(array('show' => 'tpl/home/headnavi.tpl'));
$tpl->assign_vars(array('HEADER' => MSDHeader(), 'HEADLINE' => headline('Home')));
$tpl->pparse('show');
MSD_mysql_connect();
if ($action == 'status') {
    include './inc/home/home.php';
} elseif ($action == 'db') {
    include './inc/home/databases.php';
} elseif ($action == 'sys') {
    include './inc/home/system.php';
} elseif ($action == 'vars') {
    include './inc/home/mysql_variables.php';
}
echo MSDFooter();
ob_end_flush();
Example #22
0
    }
    if (isset($_POST['smtp_port'])) {
        $config['smtp_port'] = (int) $_POST['smtp_port'];
    }
    if (isset($_POST['smtp_pop3_server'])) {
        $config['smtp_pop3_server'] = (string) $_POST['smtp_pop3_server'];
    }
    if (isset($_POST['smtp_pop3_port'])) {
        $config['smtp_pop3_port'] = (int) $_POST['smtp_pop3_port'];
    }
}
// backwards compatibilty with older configurations
if (!isset($config['email_maxsize1'])) {
    $config['email_maxsize1'] = 0;
}
if (!isset($config['email_maxsize2'])) {
    $config['email_maxsize2'] = 1;
}
$tplConfigurationEmail = new MSDTemplate();
$tplConfigurationEmail->set_filenames(array('tplConfigurationEmail' => 'tpl/configuration/email.tpl'));
$tplConfigurationEmail->assign_vars(array('ICON_SAVE' => $icon['small']['save'], 'ICON_PLUS' => $icon['plus'], 'ICON_DELETE' => $icon['delete'], 'SEND_MAIL_ENABLED_SELECTED' => Html::getChecked($config['send_mail'], 1), 'EMAIL_DISABLED' => Html::getDisabled($config['send_mail'], 0), 'SEND_MAIL_DISABLED_SELECTED' => Html::getChecked($config['send_mail'], 0), 'EMAIL_RECIPIENT_NAME' => Html::replaceQuotes($config['email']['recipient_name']), 'EMAIL_RECIPIENT_ADDRESS' => Html::replaceQuotes($config['email']['recipient_address']), 'EMAIL_SENDER_NAME' => Html::replaceQuotes($config['email']['sender_name']), 'EMAIL_SENDER_ADDRESS' => Html::replaceQuotes($config['email']['sender_address']), 'ATTACH_BACKUP_ENABLED_SELECTED' => Html::getChecked($config['email']['attach_backup'], 1), 'ATTACH_BACKUP_DISABLED_SELECTED' => Html::getChecked($config['email']['attach_backup'], 0), 'MAXSIZE_DISABLED' => Html::getDisabled($config['email']['attach_backup'], 0), 'EMAIL_MAXSIZE' => $config['email_maxsize1'], 'EMAIL_UNIT_SIZE_KB_SELECTED' => Html::getSelected($config['email_maxsize2'], 1), 'EMAIL_UNIT_SIZE_MB_SELECTED' => Html::getSelected($config['email_maxsize2'], 2), 'EMAIL_USE_PHPMAIL_SELECTED' => Html::getChecked($config['use_mailer'], 0), 'EMAIL_USE_SENDMAIL_SELECTED' => Html::getChecked($config['use_mailer'], 1), 'EMAIL_USE_SMTP_SELECTED' => Html::getChecked($config['use_mailer'], 2), 'SENDMAIL_CALL' => Html::replaceQuotes($config['sendmail_call']), 'SMTP_SERVER' => $config['smtp_server'], 'SMTP_USER' => $config['smtp_user'], 'SMTP_PASS' => $config['smtp_pass'], 'SMTP_AUTH_DISABLED' => Html::getDisabled($config['smtp_useauth'], 0), 'SMTP_AUTH_SELECTED' => Html::getChecked($config['smtp_useauth'], 1), 'SMTP_AUTH_NOT_SELECTED' => Html::getChecked($config['smtp_useauth'], 0), 'SMTP_SSL_SELECTED' => Html::getChecked($config['smtp_usessl'], 1), 'SMTP_SSL_NOT_SELECTED' => Html::getChecked($config['smtp_usessl'], 0), 'SMTP_PORT' => $config['smtp_port'], 'SMTP_POP3_SERVER' => $config['smtp_pop3_server'], 'SMTP_POP3_PORT' => $config['smtp_pop3_port']));
if ($config['smtp_useauth'] == 0) {
    $tplConfigurationEmail->assign_block_vars('HIDE_SMTP_AUTH_FIELDS', array());
}
if (is_array($config['email']['recipient_cc']) && sizeof($config['email']['recipient_cc']) > 0) {
    foreach ($config['email']['recipient_cc'] as $key => $val) {
        $confirmRecDelete = sprintf($lang['L_CONFIRM_RECIPIENT_DELETE'], $val['name'] . ' ' . $val['address']);
        $confirmRecDelete = Html::replaceQuotes($confirmRecDelete);
        $tplConfigurationEmail->assign_block_vars('EMAIL_RECIPIENT_CC', array('NR' => $key, 'CONFIRM_RECIPIENT_DELETE' => $confirmRecDelete, 'EMAIL_RECIPIENT_CC_NAME' => Html::replaceQuotes($val['name']), 'EMAIL_RECIPIENT_CC_ADDRESS' => Html::replaceQuotes($val['address'])));
    }
}
Example #23
0
<?php

if (!defined('MSD_VERSION')) {
    die('No direct access.');
}
//Start SQL-Box
$tpl = new MSDTemplate();
$tpl->set_filenames(array('show' => $config['paths']['root'] . './tpl/sqlbrowser/sqlbox.tpl'));
if (isset($_GET['readfile']) && $_GET['readfile'] == 1) {
    $tpl->assign_block_vars('SQLUPLOAD', array('POSTTARGET' => $params, 'LANG_OPENSQLFILE' => $lang['L_SQL_OPENFILE'], 'LANG_OPENSQLFILE_BUTTON' => $lang['L_SQL_OPENFILE_BUTTON'], 'LANG_SQL_MAXSIZE' => $lang['L_MAX_UPLOAD_SIZE'], 'MAX_FILESIZE' => $config['upload_max_filesize']));
}
if (isset($_POST['submit_openfile'])) {
    //open file
    if (!isset($_FILES['upfile']['name']) || empty($_FILES['upfile']['name'])) {
        $aus .= '<span class="error">' . $lang['L_FM_UPLOADFILEREQUEST'] . '</span>';
    } else {
        $fn = $_FILES['upfile']['tmp_name'];
        if (strtolower(substr($_FILES['upfile']['name'], -3)) == ".gz") {
            $read__user_sqlfile = gzfile($fn);
        } else {
            $read__user_sqlfile = file($fn);
        }
        $aus .= '<span>geladenes File: <strong>' . $_FILES['upfile']['name'] . '</strong>&nbsp;&nbsp;&nbsp;' . byte_output(filesize($_FILES['upfile']['tmp_name'])) . '</span>';
        $sql_loaded = implode("", $read__user_sqlfile);
    }
}
// Sind SQL-Befehle in der SQLLib vorhanden?
$sqlcombo = SQL_ComboBox();
if ($sqlcombo > '') {
    $tpl->assign_block_vars('SQLCOMBO', array('SQL_COMBOBOX' => $sqlcombo));
}
}
$dba = $htaDir = $overwrite = $msg = '';
$error = array();
$type = 0;
// default encryption type set to crypt()
if (strtoupper(substr(MSD_OS, 0, 3)) == 'WIN') {
    $type = 2;
    // we are on a Win-System; pre-select encryption type
}
if (isset($_POST['type'])) {
    $type = (int) $_POST['type'];
}
$username = isset($_POST['username']) ? $_POST['username'] : '';
$userpassOne = isset($_POST['userpass1']) ? $_POST['userpass1'] : '';
$userpassConfirm = isset($_POST['userpass2']) ? $_POST['userpass2'] : '';
$tplHomeProtectionCreate = new MSDTemplate();
$tplHomeProtectionCreate->set_filenames(array('tplHomeProtectionCreate' => 'tpl/home/protection_create.tpl'));
$tplHomeProtectionCreate->assign_vars(array('THEME' => $config['theme']));
if (isset($_POST['username'])) {
    // Form submitted
    if ($username == '') {
        $error[] = $lang['L_HTACC_NO_USERNAME'];
    }
    if ($userpassOne != $userpassConfirm || $userpassOne == '') {
        $error[] = $lang['L_PASSWORDS_UNEQUAL'];
    }
    if (sizeof($error) == 0) {
        $realm = 'MySQLDumper';
        $htaccess = "AuthName \"" . $realm . "\"\nAuthType Basic\nAuthUserFile \"" . $config['paths']['root'] . ".htpasswd\"\nrequire valid-user\n";
        switch ($type) {
            // Crypt
Example #25
0
<?php

/**
 * This file is part of MySQLDumper released under the GNU/GPL 2 license
 * http://www.mysqldumper.net
 *
 * @package         MySQLDumper
 * @version         SVN: $rev: 1205 $
 * @author          $Author$
 * @lastmodified    $Date$
 */
if (!defined('MSD_VERSION')) {
    die('No direct access.');
}
$tplSqlbrowserGeneralFooter = new MSDTemplate();
$tplSqlbrowserGeneralFooter->set_filenames(array('tplSqlbrowserGeneralFooter' => 'tpl/sqlbrowser/general/footer.tpl'));
Example #26
0
        $tabellen = mysqli_query($config['dbconnection'], 'SHOW TABLES FROM `' . $databases['Name'][$i] . '`');
        $num_tables = mysqli_num_rows($tabellen);
        $tpl->assign_block_vars('ROW', array('ROWCLASS' => $rowclass, 'NR' => $i + 1, 'DB_NAME' => $databases['Name'][$i], 'DB_ID' => $i, 'TABLE_COUNT' => $num_tables));
        if ($num_tables == 1) {
            $tpl->assign_block_vars('ROW.TABLE', array());
        } else {
            $tpl->assign_block_vars('ROW.TABLES', array());
        }
    }
}
$tpl->pparse('show');
//list tables of selected database
if (isset($_GET['dbid'])) {
    $disabled_keys_found = false;
    // Output list of tables of the selected database
    $tpl = new MSDTemplate();
    $tpl->set_filenames(array('show' => 'tpl/home/databases_list_tables.tpl'));
    $dbid = $_GET['dbid'];
    $numrows = 0;
    $res = @mysqli_query($GLOBALS["___mysqli_ston"], "SHOW TABLE STATUS FROM `" . $databases['Name'][$dbid] . "`");
    (bool) mysqli_query($GLOBALS["___mysqli_ston"], "USE " . $databases['Name'][$dbid]);
    if ($res) {
        $numrows = mysqli_num_rows($res);
    }
    $tpl->assign_vars(array('DB_NAME' => $databases['Name'][$dbid], 'DB_NAME_URLENCODED' => urlencode($databases['Name'][$dbid]), 'DB_ID' => $dbid, 'TABLE_COUNT' => $numrows, 'ICONPATH' => $config['files']['iconpath']));
    $numrows = intval($numrows);
    if ($numrows > 1) {
        $tpl->assign_block_vars('MORE_TABLES', array());
    } elseif ($numrows == 1) {
        $tpl->assign_block_vars('1_TABLE', array());
    } elseif ($numrows == 0) {
        $isWritable[$i] = File::isWritable($dir, 0777);
        $tpl->assign_vars(array('LANGUAGE' => $config['language'], 'ICON_OK' => $icon['ok']));
        $tpl->assign_block_vars('DIR', array('NAME' => $config['paths']['root'] . $dir, 'CHMOD' => File::getChmod($dir), 'ICON_EXISTS' => $check === true ? $icon['ok'] : $icon['not_ok'] . ' ' . $check, 'ICON_IS_WRITABLE' => $isWritable[$i] ? $icon['ok'] : $icon['not_ok']));
        $i++;
    }
    if (in_array(false, $isWritable)) {
        $tpl->pparse('show');
        // something is wrong with the dirs -> show info
    } else {
        $phase = 2;
        // everything ok -> continue with db-param-input
    }
}
// Step 3: database parameters
if ($phase == 2) {
    $tpl = new MSDTemplate();
    $tpl->set_filenames(array('show' => 'tpl/install/db_parameter.tpl'));
    // default values
    ############################### Pimped -->
    if (!@(require BASEDIR . "config.php")) {
        die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><strong>config.php not found!</strong><br /></div>");
    }
    if (!isset($config['dbhost'])) {
        $config['dbhost'] = $db_host;
    }
    #### Pimped
    if (!isset($config['dbuser'])) {
        $config['dbuser'] = $db_user;
    }
    #### Pimped
    if (!isset($config['dbpass'])) {
Example #28
0
// default encryption type set to crypt()
if (strtoupper(substr(MSD_OS, 0, 3)) == 'WIN') {
    $type = 2;
}
// we are on a Win-System; pre-select encryption type
if (isset($_POST['type'])) {
    $type = intval($_POST['type']);
}
$username = isset($_POST['username']) ? $_POST['username'] : '';
$userpass1 = isset($_POST['userpass1']) ? $_POST['userpass1'] : '';
$userpass2 = isset($_POST['userpass2']) ? $_POST['userpass2'] : '';
header('Pragma: no-cache');
header("Cache-Control: no-cache, must-revalidate");
header("Expires: -1");
header('Content-Type: text/html; charset=UTF-8');
$tpl = new MSDTemplate();
$tpl->set_filenames(array('show' => './tpl/home/protection_create.tpl'));
$tpl->assign_vars(array('THEME' => $config['theme'], 'HEADLINE' => headline($lang['L_HTACC_CREATE'])));
if (isset($_POST['username'])) {
    // Form submitted
    if ($username == '') {
        $error[] = $lang['L_HTACC_NO_USERNAME'];
    }
    if ($userpass1 != $userpass2 || $userpass1 == '') {
        $error[] = $lang['L_PASSWORDS_UNEQUAL'];
    }
    if (sizeof($error) == 0) {
        $realm = 'MySQLDumper';
        $htaccess = "AuthName \"" . $realm . "\"\nAuthType Basic\nAuthUserFile \"" . $config['paths']['root'] . ".htpasswd\"\nrequire valid-user\n";
        switch ($type) {
            // Crypt
<?php

/**
 * This file is part of MySQLDumper released under the GNU/GPL 2 license
 * http://www.mysqldumper.net
 *
 * @package         MySQLDumper
 * @version         SVN: $rev: 1207 $
 * @author          $Author$
 * @lastmodified    $Date$
 */
if (!defined('MSD_VERSION')) {
    die('No direct access.');
}
$tplConfigurationConfigMenu = new MSDTemplate();
$tplConfigurationConfigMenu->set_filenames(array('tplConfigurationConfigMenu' => 'tpl/configuration/config_menu.tpl'));
$msdMode = $lang['L_MODE_EXPERT'];
if ($config['msd_mode'] == 0) {
    $msdMode = $lang['L_MODE_EASY'];
}
$tplConfigurationConfigMenu->assign_vars(array('CONFIGURATION_NAME' => $config['config_file'], 'ICON_SAVE' => $icon['small']['save'], 'ICON_OPEN_FILE' => $icon['small']['open_file'], 'MSD_MODE' => $msdMode));
 * @version         SVN: $rev: 1205 $
 * @author          $Author$
 * @lastmodified    $Date$
 */
chdir('./../');
include './inc/classes/db/MsdDbFactory.php';
include './inc/functions/functions.php';
include './inc/runtime.php';
include './inc/mysql.php';
include './inc/functions/functions_global.php';
include './lib/template.php';
include './inc/functions/functions_restore.php';
include './lib/json.php';
obstart(true);
include './inc/functions/functions_sql.php';
$tplSqlbrowserTableShowTabledataEntry = new MSDTemplate();
$tplSqlbrowserTableShowTabledataEntry->set_filenames(array('tpl_sqlbrowser_table_show_tabledata' => './tpl/sqlbrowser/table/edit_field.tpl'));
/*
 * Fetch and check _GET variables
 */
$validModes = array('new');
$db = isset($_GET['db']) ? base64_decode($_GET['db']) : $config['db_actual'];
$tablename = isset($_GET['tablename']) ? base64_decode($_GET['tablename']) : '';
$fieldname = isset($_GET['fieldname']) ? base64_decode($_GET['fieldname']) : '';
$rowKey = isset($_GET['key']) ? base64_decode($_GET['key']) : '';
$mode = 'new';
if (isset($_GET['do']) && in_array($_GET['do'], $validModes)) {
    $mode = $_GET['do'];
}
$tableInfos = getExtendedFieldInfo($db, $tablename);
$tplSqlbrowserTableShowTabledataEntry->assign_vars(array('MODE' => $mode));