2 /* vim: set expandtab sw=4 ts=4 sts=4: */
11 require_once 'libraries/common.inc.php';
12 require_once 'libraries/server_common.inc.php';
14 require_once 'libraries/replication.inc.php';
15 require_once 'libraries/replication_gui.lib.php';
18 * Does the common work
20 $response = PMA_Response
::getInstance();
21 $header = $response->getHeader();
22 $scripts = $header->getScripts();
23 $scripts->addFile('server_privileges.js');
24 $scripts->addFile('replication.js');
27 * Checks if the user is allowed to do what he tries to...
29 if (! $is_superuser) {
30 $html = PMA_getSubPageHeader('replication');
31 $html .= PMA_Message
::error(__('No Privileges'))->getDisplay();
32 $response->addHTML($html);
36 //change $GLOBALS['url_params'] with $_REQUEST['url_params']
37 if (isset($_REQUEST['url_params'])) {
38 $GLOBALS['url_params'] = $_REQUEST['url_params'];
41 * Handling control requests
43 PMA_handleControlRequest();
48 $response->addHTML('<div id="replication">');
49 $response->addHTML(PMA_getSubPageHeader('replication'));
51 // Display error messages
52 $response->addHTML(PMA_getHtmlForErrorMessage());
54 if ($server_master_status) {
55 $response->addHTML(PMA_getHtmlForMasterReplication());
56 } elseif (! isset($_REQUEST['mr_configure']) &&
57 ! isset($_REQUEST['repl_clear_scr'])) {
58 $response->addHTML(PMA_getHtmlForNotServerReplication());
61 if (isset($_REQUEST['mr_configure'])) {
62 // Render the 'Master configuration' section
63 $response->addHTML(PMA_getHtmlForMasterConfiguration());
67 $response->addHTML('</div>');
69 if (! isset($_REQUEST['repl_clear_scr'])) {
70 // Render the 'Slave configuration' section
72 PMA_getHtmlForSlaveConfiguration(
74 $server_slave_replication
78 if (isset($_REQUEST['sl_configure'])) {
79 $response->addHTML(PMA_getHtmlForReplicationChangeMaster("slave_changemaster"));