Translated using Weblate (Slovenian)
[phpmyadmin.git] / server_replication.php
blob9e07e194d48b708af1c669f203d3b437c6cfb28e
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');
27 $scripts->addFile('zxcvbn.js');
29 /**
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);
36 exit;
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'];
45 /**
46 * Handling control requests
48 PMA_handleControlRequest();
50 /**
51 * start output
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'])
63 ) {
64 $response->addHTML(PMA_getHtmlForNotServerReplication());
67 if (isset($_REQUEST['mr_configure'])) {
68 // Render the 'Master configuration' section
69 $response->addHTML(PMA_getHtmlForMasterConfiguration());
70 exit;
73 $response->addHTML('</div>');
75 if (! isset($_REQUEST['repl_clear_scr'])) {
76 // Render the 'Slave configuration' section
77 $response->addHTML(
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"));