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');
27 $scripts->addFile('zxcvbn.js');
30 * Checks if the user is allowed to do what he tries to...
32 if (! $is_superuser) {
33 $html = PMA_getHtmlForSubPageHeader('replication');
34 $html .= PMA\libraries\Message
::error(__('No Privileges'))->getDisplay();
35 $response->addHTML($html);
39 // change $GLOBALS['url_params'] with $_REQUEST['url_params']
40 // only if it is an array
41 if (isset($_REQUEST['url_params']) && is_array($_REQUEST['url_params'])) {
42 $GLOBALS['url_params'] = $_REQUEST['url_params'];
46 * Handling control requests
48 PMA_handleControlRequest();
53 $response->addHTML('<div id="replication">');
54 $response->addHTML(PMA_getHtmlForSubPageHeader('replication'));
56 // Display error messages
57 $response->addHTML(PMA_getHtmlForErrorMessage());
59 if ($GLOBALS['replication_info']['master']['status']) {
60 $response->addHTML(PMA_getHtmlForMasterReplication());
61 } elseif (! isset($_REQUEST['mr_configure'])
62 && ! isset($_REQUEST['repl_clear_scr'])
64 $response->addHTML(PMA_getHtmlForNotServerReplication());
67 if (isset($_REQUEST['mr_configure'])) {
68 // Render the 'Master configuration' section
69 $response->addHTML(PMA_getHtmlForMasterConfiguration());
73 $response->addHTML('</div>');
75 if (! isset($_REQUEST['repl_clear_scr'])) {
76 // Render the 'Slave configuration' section
78 PMA_getHtmlForSlaveConfiguration(
79 $GLOBALS['replication_info']['slave']['status'],
80 $server_slave_replication
84 if (isset($_REQUEST['sl_configure'])) {
85 $response->addHTML(PMA_getHtmlForReplicationChangeMaster("slave_changemaster"));