Fixed php warning for Installer::connect_to_database() function
[openemr.git] / phpmyadmin / server_replication.php
blob93e4100d19d2b16363b4b4d17d69db2f8f4b6d5c
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Server replications
6 * @package PhpMyAdmin
7 */
9 /**
10 * include files
12 require_once 'libraries/common.inc.php';
13 require_once 'libraries/server_common.inc.php';
15 require_once 'libraries/replication.inc.php';
16 require_once 'libraries/replication_gui.lib.php';
18 /**
19 * Does the common work
21 $response = PMA_Response::getInstance();
22 $header = $response->getHeader();
23 $scripts = $header->getScripts();
24 $scripts->addFile('server_privileges.js');
25 $scripts->addFile('replication.js');
27 /**
28 * Checks if the user is allowed to do what he tries to...
30 if (! $is_superuser) {
31 $html = PMA_getHtmlForSubPageHeader('replication');
32 $html .= PMA_Message::error(__('No Privileges'))->getDisplay();
33 $response->addHTML($html);
34 exit;
37 //change $GLOBALS['url_params'] with $_REQUEST['url_params']
38 if (isset($_REQUEST['url_params'])) {
39 $GLOBALS['url_params'] = $_REQUEST['url_params'];
41 /**
42 * Handling control requests
44 PMA_handleControlRequest();
46 /**
47 * start output
49 $response->addHTML('<div id="replication">');
50 $response->addHTML(PMA_getHtmlForSubPageHeader('replication'));
52 // Display error messages
53 $response->addHTML(PMA_getHtmlForErrorMessage());
55 if ($GLOBALS['replication_info']['master']['status']) {
56 $response->addHTML(PMA_getHtmlForMasterReplication());
57 } elseif (! isset($_REQUEST['mr_configure'])
58 && ! isset($_REQUEST['repl_clear_scr'])
59 ) {
60 $response->addHTML(PMA_getHtmlForNotServerReplication());
63 if (isset($_REQUEST['mr_configure'])) {
64 // Render the 'Master configuration' section
65 $response->addHTML(PMA_getHtmlForMasterConfiguration());
66 exit;
69 $response->addHTML('</div>');
71 if (! isset($_REQUEST['repl_clear_scr'])) {
72 // Render the 'Slave configuration' section
73 $response->addHTML(
74 PMA_getHtmlForSlaveConfiguration(
75 $GLOBALS['replication_info']['slave']['status'],
76 $server_slave_replication
80 if (isset($_REQUEST['sl_configure'])) {
81 $response->addHTML(PMA_getHtmlForReplicationChangeMaster("slave_changemaster"));