Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2014-09-02 13:49:48 +02:00
commit bd63258d41
2 changed files with 28 additions and 0 deletions

View File

@ -15,6 +15,19 @@ if (! defined('PHPMYADMIN')) {
*/
$server_master_replication = $GLOBALS['dbi']->fetchResult('SHOW MASTER STATUS');
/**
* check for multi-master replication functionality
*/
$server_slave_multi_replication = $GLOBALS['dbi']->fetchResult('SHOW ALL SLAVES STATUS');
/**
* set slave selected server
*/
if ($server_slave_multi_replication && $_REQUEST['master_connection']) {
$GLOBALS['dbi']->query("SET @@default_master_connection = '" . PMA_Util::sqlAddSlashes($_REQUEST['master_connection']) . "'");
$GLOBALS['url_params']['master_connection'] = $_REQUEST['master_connection'];
}
/**
* get slave replication from server
*/

View File

@ -139,6 +139,21 @@ function PMA_getHtmlForSlaveConfiguration(
) {
$html = '<fieldset>';
$html .= '<legend>' . __('Slave replication') . '</legend>';
if ($GLOBALS['server_slave_multi_replication']) {
$html .= __('Master connection:');
$html .= '<form method="get" action="server_replication.php">';
$html .= PMA_URL_getHiddenInputs($url_params);
$html .= ' <select name="master_connection">';
$html .= '<option value="">' . __('Default') . '</option>';
foreach ($GLOBALS['server_slave_multi_replication'] as $server) {
$html .= '<option' . ($server['Connection_name'] == $_REQUEST['master_connection'] ? ' selected="selected"' : '') . '>' .
$server['Connection_name'] . '</option>';
}
$html .= '</select>';
$html .= ' <input type="submit" value="' . __('Go') . '" id="goButton" />';
$html .= '</form>';
$html .= '<br /><br />';
}
if ($server_slave_status) {
$html .= '<div id="slave_configuration_gui">';