Translated using Weblate (Spanish)
[phpmyadmin.git] / server_replication.php
blob022e389b8b6d6db67cbe313a1396ad6425aecebb
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package PhpMyAdmin
6 */
8 /**
9 * include files
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';
17 /**
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');
26 /**
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);
33 exit;
36 //change $GLOBALS['url_params'] with $_REQUEST['url_params']
37 if (isset($_REQUEST['url_params'])) {
38 $GLOBALS['url_params'] = $_REQUEST['url_params'];
40 /**
41 * Handling control requests
43 PMA_handleControlRequest();
45 /**
46 * start output
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());
64 exit;
67 $response->addHTML('</div>');
69 if (! isset($_REQUEST['repl_clear_scr'])) {
70 // Render the 'Slave configuration' section
71 $response->addHTML(
72 PMA_getHtmlForSlaveConfiguration(
73 $server_slave_status,
74 $server_slave_replication
78 if (isset($_REQUEST['sl_configure'])) {
79 $response->addHTML(PMA_getHtmlForReplicationChangeMaster("slave_changemaster"));