Code cleanup done during Fosdem2010

This commit is contained in:
Herman van Rink
2010-02-09 19:57:06 +00:00
parent 2ee9ff3e20
commit a82cc85f04
4 changed files with 21 additions and 16 deletions

View File

@@ -350,8 +350,8 @@ foreach ($tables as $keyname => $each_table) {
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
if ((strlen(array_search($truename, $server_slave_Do_Table)) > 0) if ((strlen(array_search($truename, $server_slave_Do_Table)) > 0)
|| (strlen(array_search($db, $server_slave_Do_DB))>0) || (strlen(array_search($db, $server_slave_Do_DB)) > 0)
|| (count($server_slave_Do_DB)==1 && count($server_slave_Ignore_DB)==1) || (count($server_slave_Do_DB) == 1 && count($server_slave_Ignore_DB) == 1)
) { ) {
$do = true; $do = true;
} }
@@ -360,7 +360,7 @@ foreach ($tables as $keyname => $each_table) {
$do = true; $do = true;
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
if ((strlen(array_search($truename, $server_slave_Ignore_Table))>0) || (strlen(array_search($db, $server_slave_Ignore_DB))>0)) { if ((strlen(array_search($truename, $server_slave_Ignore_Table)) > 0) || (strlen(array_search($db, $server_slave_Ignore_DB)) > 0)) {
$ignored = true; $ignored = true;
} }
foreach ($server_slave_Wild_Ignore_Table as $table) { foreach ($server_slave_Wild_Ignore_Table as $table) {

View File

@@ -6,14 +6,16 @@
* @package phpMyAdmin-Designer * @package phpMyAdmin-Designer
*/ */
/**
*
*/
include_once 'pmd_common.php'; include_once 'pmd_common.php';
/**
* If called directly from the designer, first save the positions
*/
if (! isset($scale)) { if (! isset($scale)) {
$no_die_save_pos = 1; $no_die_save_pos = 1;
include_once 'pmd_save_pos.php'; include_once 'pmd_save_pos.php';
} }
require_once './libraries/relation.lib.php'; require_once './libraries/relation.lib.php';
if (isset($scale) && ! isset($createpage)) { if (isset($scale) && ! isset($createpage)) {
@@ -49,6 +51,7 @@ if (isset($scale) && ! isset($createpage)) {
die("<script>alert('$strModifications');history.go(-2);</script>"); die("<script>alert('$strModifications');history.go(-2);</script>");
} }
if (isset($createpage)) { if (isset($createpage)) {
/* /*
* @see pdf_pages.php * @see pdf_pages.php
@@ -57,6 +60,7 @@ if (isset($createpage)) {
$pdf_page_number = PMA_REL_create_page($newpage, $cfgRelation, $db, $query_default_option); $pdf_page_number = PMA_REL_create_page($newpage, $cfgRelation, $db, $query_default_option);
} }
// no need to use pmd/styles // no need to use pmd/styles
require_once './libraries/header_meta_style.inc.php'; require_once './libraries/header_meta_style.inc.php';
?> ?>
@@ -72,17 +76,18 @@ require_once './libraries/header_meta_style.inc.php';
<select name="scale"> <select name="scale">
<option value="1">1:1</option> <option value="1">1:1</option>
<option value="2">1:2</option> <option value="2">1:2</option>
<option value="3" selected>1:3 (<?php echo $strRecommended; ?>)</option> <option value="3" selected>1:3 (<?php echo $strRecommended; ?>)</option>
<option value="4">1:4</option> <option value="4">1:4</option>
<option value="5">1:5</option> <option value="5">1:5</option>
</select> </select>
</p> </p>
<p><?php echo $strToFromPage; ?>: <p><?php echo $strToFromPage; ?>:
<select name="pdf_page_number"> <select name="pdf_page_number">
<?php <?php
$table_info_result = PMA_query_as_controluser('SELECT * FROM '.PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages']).' $table_info_result = PMA_query_as_controluser('SELECT * FROM '
WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''); . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages'])
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'');
while($page = PMA_DBI_fetch_assoc($table_info_result)) while($page = PMA_DBI_fetch_assoc($table_info_result))
{ {
?> ?>
@@ -91,15 +96,15 @@ require_once './libraries/header_meta_style.inc.php';
} }
?> ?>
</select> </select>
<input type="submit" name="exp" value="<?php echo $strExport; ?>"> <input type="submit" name="exp" value="<?php echo $strExport; ?>">
<input type="submit" name="imp" value="<?php echo $strImport; ?>"> <input type="submit" name="imp" value="<?php echo $strImport; ?>">
</fieldset> </fieldset>
</div> </div>
<div> <div>
<fieldset><legend><?php echo $GLOBALS['strCreatePage']; ?></legend> <fieldset><legend><?php echo $GLOBALS['strCreatePage']; ?></legend>
<input type="text" name="newpage" /> <input type="text" name="newpage" />
<input type="submit" name="createpage" value="<?php echo $strGo; ?>"> <input type="submit" name="createpage" value="<?php echo $strGo; ?>">
</fieldset> </fieldset>
</div> </div>
</form> </form>
</div> </div>

View File

@@ -40,7 +40,6 @@ if (! $is_superuser) {
/** /**
* Handling control requests * Handling control requests
*/ */
if (isset($GLOBALS['sr_take_action'])) { if (isset($GLOBALS['sr_take_action'])) {
$refresh = false; $refresh = false;
if (isset($GLOBALS['slave_changemaster'])) { if (isset($GLOBALS['slave_changemaster'])) {
@@ -51,6 +50,7 @@ if (isset($GLOBALS['sr_take_action'])) {
$_SESSION['replication']['m_correct'] = ''; $_SESSION['replication']['m_correct'] = '';
$_SESSION['replication']['sr_action_status'] = 'error'; $_SESSION['replication']['sr_action_status'] = 'error';
$_SESSION['replication']['sr_action_info'] = $strReplicationUnknownError; $_SESSION['replication']['sr_action_info'] = $strReplicationUnknownError;
// Attempt to connect to the new master server // Attempt to connect to the new master server
$link_to_master = PMA_replication_connect_to_master($sr['username'], $sr['pma_pw'], $sr['hostname'], $sr['port']); $link_to_master = PMA_replication_connect_to_master($sr['username'], $sr['pma_pw'], $sr['hostname'], $sr['port']);
@@ -97,7 +97,7 @@ if (isset($GLOBALS['sr_take_action'])) {
} elseif (isset($GLOBALS['sl_sync'])) { } elseif (isset($GLOBALS['sl_sync'])) {
// TODO username, host and port could be read from 'show slave status', // TODO username, host and port could be read from 'show slave status',
// when asked for a password this might work in more situations the just after changing master (where the master password is stored in session) // when asked for a password this might work in more situations then just after changing master (where the master password is stored in session)
$src_link = PMA_replication_connect_to_master($_SESSION['replication']['m_username'], $_SESSION['replication']['m_password'], $_SESSION['replication']['m_hostname'], $_SESSION['replication']['m_port']); $src_link = PMA_replication_connect_to_master($_SESSION['replication']['m_username'], $_SESSION['replication']['m_password'], $_SESSION['replication']['m_hostname'], $_SESSION['replication']['m_port']);
$trg_link = null; // using null to indicate the current PMA server $trg_link = null; // using null to indicate the current PMA server

View File

@@ -36,7 +36,7 @@ if ($result === false) {
} }
/* Avoid corrupting data */ /* Avoid corrupting data */
@ini_set('url_rewriter.tags',''); @ini_set('url_rewriter.tags', '');
header('Content-Type: ' . PMA_detectMIME($result)); header('Content-Type: ' . PMA_detectMIME($result));
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');