getHeader();
$scripts = $header->getScripts();
$scripts->addFile('server_privileges.js');
$scripts->addFile('replication.js');
require 'libraries/server_common.inc.php';
require 'libraries/replication.inc.php';
require 'libraries/replication_gui.lib.php';
/**
* Checks if the user is allowed to do what he tries to...
*/
if (! $is_superuser) {
echo '
';
echo '
';
echo ' ' . PMA_Util::getImage('s_replication.png');
echo __('Replication');
echo ' ';
// Display error messages
if (isset($_SESSION['replication']['sr_action_status'])
&& isset($_SESSION['replication']['sr_action_info'])
) {
if ($_SESSION['replication']['sr_action_status'] == 'error') {
PMA_Message::error($_SESSION['replication']['sr_action_info'])->display();
$_SESSION['replication']['sr_action_status'] = 'unknown';
} elseif ($_SESSION['replication']['sr_action_status'] == 'success') {
PMA_Message::success($_SESSION['replication']['sr_action_info'])->display();
$_SESSION['replication']['sr_action_status'] = 'unknown';
}
}
if ($server_master_status) {
if (! isset($GLOBALS['repl_clear_scr'])) {
echo '
';
echo '' . __('Master replication') . ' ';
echo __('This server is configured as master in a replication process.');
echo '';
echo ' ' . __('Show master status') . ' ';
PMA_replication_print_status_table('master', true, false);
echo ' ';
echo ' ' . __('Show connected slaves') . ' ';
PMA_replication_print_slaves_table(true);
echo ' ';
$_url_params = $GLOBALS['url_params'];
$_url_params['mr_adduser'] = true;
$_url_params['repl_clear_scr'] = true;
echo ' ';
echo __('Add slave replication user') . ' ';
}
// Display 'Add replication slave user' form
if (isset($GLOBALS['mr_adduser'])) {
PMA_replication_gui_master_addslaveuser();
} elseif (! isset($GLOBALS['repl_clear_scr'])) {
echo " ";
echo " ";
}
} elseif (! isset($GLOBALS['mr_configure']) && ! isset($GLOBALS['repl_clear_scr'])) {
$_url_params = $GLOBALS['url_params'];
$_url_params['mr_configure'] = true;
echo '
';
echo '' . __('Master replication') . ' ';
echo sprintf(__('This server is not configured as master in a replication process. Would you like to configure it?'), 'server_replication.php' . PMA_generate_common_url($_url_params));
echo ' ';
}
if (isset($GLOBALS['mr_configure'])) {
// Render the 'Master configuration' section
echo '
';
echo '' . __('Master configuration') . ' ';
echo __('This server is not configured as master server in a replication process. You can choose from either replicating all databases and ignoring certain (useful if you want to replicate majority of databases) or you can choose to ignore all databases by default and allow only certain databases to be replicated. Please select the mode:') . ' ';
echo '';
echo '' . __('Replicate all databases; Ignore:') . ' ';
echo '' . __('Ignore all databases; Replicate:') . ' ';
echo ' ';
echo ' ';
echo __('Please select databases:') . ' ';
echo PMA_replication_db_multibox();
echo ' ';
echo __('Now, add the following lines at the end of [mysqld] section in your my.cnf and please restart the MySQL server afterwards.') . ' ';
echo ' ';
echo __('Once you restarted MySQL server, please click on Go button. Afterwards, you should see a message informing you, that this server is configured as master');
echo ' ';
echo '';
exit;
}
echo '
';
if (! isset($GLOBALS['repl_clear_scr'])) {
// Render the 'Slave configuration' section
echo '