Translated using Weblate (Portuguese (Brazil))
[phpmyadmin.git] / server_replication.php
blob5fbd4300eb9c6f56de543fd99eba98495d4be133
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Server replications
6 * @package PhpMyAdmin
7 */
8 use PMA\libraries\Response;
10 /**
11 * include files
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';
19 /**
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');
28 /**
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);
35 exit;
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'];
44 /**
45 * Handling control requests
47 PMA_handleControlRequest();
49 /**
50 * start output
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'])
62 ) {
63 $response->addHTML(PMA_getHtmlForNotServerReplication());
66 if (isset($_REQUEST['mr_configure'])) {
67 // Render the 'Master configuration' section
68 $response->addHTML(PMA_getHtmlForMasterConfiguration());
69 exit;
72 $response->addHTML('</div>');
74 if (! isset($_REQUEST['repl_clear_scr'])) {
75 // Render the 'Slave configuration' section
76 $response->addHTML(
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"));