2 /* vim: set expandtab sw=4 ts=4 sts=4: */
12 require_once 'libraries/common.inc.php';
13 require_once 'libraries/server_common.inc.php';
15 require_once 'libraries/replication.inc.php';
16 require_once 'libraries/replication_gui.lib.php';
19 * Does the common work
21 $response = PMA\libraries\Response
::getInstance();
22 $header = $response->getHeader();
23 $scripts = $header->getScripts();
24 $scripts->addFile('server_privileges.js');
25 $scripts->addFile('replication.js');
28 * Checks if the user is allowed to do what he tries to...
30 if (! $is_superuser) {
31 $html = PMA_getHtmlForSubPageHeader('replication');
32 $html .= PMA\libraries\Message
::error(__('No Privileges'))->getDisplay();
33 $response->addHTML($html);
37 // change $GLOBALS['url_params'] with $_REQUEST['url_params']
38 // only if it is an array
39 if (isset($_REQUEST['url_params']) && is_array($_REQUEST['url_params'])) {
40 $GLOBALS['url_params'] = $_REQUEST['url_params'];
44 * Handling control requests
46 PMA_handleControlRequest();
51 $response->addHTML('<div id="replication">');
52 $response->addHTML(PMA_getHtmlForSubPageHeader('replication'));
54 // Display error messages
55 $response->addHTML(PMA_getHtmlForErrorMessage());
57 if ($GLOBALS['replication_info']['master']['status']) {
58 $response->addHTML(PMA_getHtmlForMasterReplication());
59 } elseif (! isset($_REQUEST['mr_configure'])
60 && ! isset($_REQUEST['repl_clear_scr'])
62 $response->addHTML(PMA_getHtmlForNotServerReplication());
65 if (isset($_REQUEST['mr_configure'])) {
66 // Render the 'Master configuration' section
67 $response->addHTML(PMA_getHtmlForMasterConfiguration());
71 $response->addHTML('</div>');
73 if (! isset($_REQUEST['repl_clear_scr'])) {
74 // Render the 'Slave configuration' section
76 PMA_getHtmlForSlaveConfiguration(
77 $GLOBALS['replication_info']['slave']['status'],
78 $server_slave_replication
82 if (isset($_REQUEST['sl_configure'])) {
83 $response->addHTML(PMA_getHtmlForReplicationChangeMaster("slave_changemaster"));