2 /* vim: set expandtab sw=4 ts=4 sts=4: */
8 use PMA\libraries\Response
;
13 require_once 'libraries/common.inc.php';
14 require_once 'libraries/server_common.inc.php';
16 require_once 'libraries/replication.inc.php';
17 require_once 'libraries/replication_gui.lib.php';
20 * Does the common work
22 $response = Response
::getInstance();
23 $header = $response->getHeader();
24 $scripts = $header->getScripts();
25 $scripts->addFile('server_privileges.js');
26 $scripts->addFile('replication.js');
29 * Checks if the user is allowed to do what he tries to...
31 if (! $is_superuser) {
32 $html = PMA_getHtmlForSubPageHeader('replication');
33 $html .= PMA\libraries\Message
::error(__('No Privileges'))->getDisplay();
34 $response->addHTML($html);
38 // change $GLOBALS['url_params'] with $_REQUEST['url_params']
39 // only if it is an array
40 if (isset($_REQUEST['url_params']) && is_array($_REQUEST['url_params'])) {
41 $GLOBALS['url_params'] = $_REQUEST['url_params'];
45 * Handling control requests
47 PMA_handleControlRequest();
52 $response->addHTML('<div id="replication">');
53 $response->addHTML(PMA_getHtmlForSubPageHeader('replication'));
55 // Display error messages
56 $response->addHTML(PMA_getHtmlForErrorMessage());
58 if ($GLOBALS['replication_info']['master']['status']) {
59 $response->addHTML(PMA_getHtmlForMasterReplication());
60 } elseif (! isset($_REQUEST['mr_configure'])
61 && ! isset($_REQUEST['repl_clear_scr'])
63 $response->addHTML(PMA_getHtmlForNotServerReplication());
66 if (isset($_REQUEST['mr_configure'])) {
67 // Render the 'Master configuration' section
68 $response->addHTML(PMA_getHtmlForMasterConfiguration());
72 $response->addHTML('</div>');
74 if (! isset($_REQUEST['repl_clear_scr'])) {
75 // Render the 'Slave configuration' section
77 PMA_getHtmlForSlaveConfiguration(
78 $GLOBALS['replication_info']['slave']['status'],
79 $server_slave_replication
83 if (isset($_REQUEST['sl_configure'])) {
84 $response->addHTML(PMA_getHtmlForReplicationChangeMaster("slave_changemaster"));