Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 84 lines (72 sloc) 2.054 kb
feb562e @tomassrnka Replication support - tomas_zahra branch merged
tomassrnka authored
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
db39eeb @xmujay refactor server_variables
xmujay authored
4 * Server replications
feb562e @tomassrnka Replication support - tomas_zahra branch merged
tomassrnka authored
5 *
e56949f @nijel Use package name PhpMyAdmin
nijel authored
6 * @package PhpMyAdmin
feb562e @tomassrnka Replication support - tomas_zahra branch merged
tomassrnka authored
7 */
8
9 /**
1044df6 @xmujay refactor server_replication.php
xmujay authored
10 * include files
feb562e @tomassrnka Replication support - tomas_zahra branch merged
tomassrnka authored
11 */
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored
12 require_once 'libraries/common.inc.php';
1044df6 @xmujay refactor server_replication.php
xmujay authored
13 require_once 'libraries/server_common.inc.php';
14
15 require_once 'libraries/replication.inc.php';
16 require_once 'libraries/replication_gui.lib.php';
feb562e @tomassrnka Replication support - tomas_zahra branch merged
tomassrnka authored
17
18 /**
19 * Does the common work
20 */
a054562 @roccivic PMA_Footer and PMA_Header no longer need to be singletons
roccivic authored
21 $response = PMA_Response::getInstance();
22 $header = $response->getHeader();
23 $scripts = $header->getScripts();
4a74037 @roccivic Dropped header.inc.php in favor of the PMA_Header class
roccivic authored
24 $scripts->addFile('server_privileges.js');
25 $scripts->addFile('replication.js');
feb562e @tomassrnka Replication support - tomas_zahra branch merged
tomassrnka authored
26
27 /**
28 * Checks if the user is allowed to do what he tries to...
29 */
97ff371 @lem9 code cleanup
lem9 authored
30 if (! $is_superuser) {
db39eeb @xmujay refactor server_variables
xmujay authored
31 $html = PMA_getHtmlForSubPageHeader('replication');
1044df6 @xmujay refactor server_replication.php
xmujay authored
32 $html .= PMA_Message::error(__('No Privileges'))->getDisplay();
33 $response->addHTML($html);
eb98110 @roccivic Dropped footer.inc.php
roccivic authored
34 exit;
feb562e @tomassrnka Replication support - tomas_zahra branch merged
tomassrnka authored
35 }
36
252a392 @xmujay 1. change the function name
xmujay authored
37 //change $GLOBALS['url_params'] with $_REQUEST['url_params']
38 if (isset($_REQUEST['url_params'])) {
39 $GLOBALS['url_params'] = $_REQUEST['url_params'];
ac37be0 @lem9 For replication, no longer depend on grab_globals.lib.php for $_GET v…
lem9 authored
40 }
41 /**
feb562e @tomassrnka Replication support - tomas_zahra branch merged
tomassrnka authored
42 * Handling control requests
43 */
239067f @xmujay refactor server_replication
xmujay authored
44 PMA_handleControlRequest();
7b85c70 @roccivic Dropped server_links.inc.php
roccivic authored
45
1044df6 @xmujay refactor server_replication.php
xmujay authored
46 /**
47 * start output
48 */
49 $response->addHTML('<div id="replication">');
db39eeb @xmujay refactor server_variables
xmujay authored
50 $response->addHTML(PMA_getHtmlForSubPageHeader('replication'));
d972ed5 @helmo Fix indentation for gsoc replication code
helmo authored
51
ed31f35 @helmo Moved 'Add slave replication user' form to separate function.
helmo authored
52 // Display error messages
1044df6 @xmujay refactor server_replication.php
xmujay authored
53 $response->addHTML(PMA_getHtmlForErrorMessage());
feb562e @tomassrnka Replication support - tomas_zahra branch merged
tomassrnka authored
54
d972ed5 @helmo Fix indentation for gsoc replication code
helmo authored
55 if ($server_master_status) {
1044df6 @xmujay refactor server_replication.php
xmujay authored
56 $response->addHTML(PMA_getHtmlForMasterReplication());
9310e76 @nijel Fix indentation
nijel authored
57 } elseif (! isset($_REQUEST['mr_configure'])
58 && ! isset($_REQUEST['repl_clear_scr'])
59 ) {
1044df6 @xmujay refactor server_replication.php
xmujay authored
60 $response->addHTML(PMA_getHtmlForNotServerReplication());
feb562e @tomassrnka Replication support - tomas_zahra branch merged
tomassrnka authored
61 }
62
252a392 @xmujay 1. change the function name
xmujay authored
63 if (isset($_REQUEST['mr_configure'])) {
78b0082 @nijel [core] Updated mootools to fix some glitches with Safari.
nijel authored
64 // Render the 'Master configuration' section
1044df6 @xmujay refactor server_replication.php
xmujay authored
65 $response->addHTML(PMA_getHtmlForMasterConfiguration());
d972ed5 @helmo Fix indentation for gsoc replication code
helmo authored
66 exit;
feb562e @tomassrnka Replication support - tomas_zahra branch merged
tomassrnka authored
67 }
68
1044df6 @xmujay refactor server_replication.php
xmujay authored
69 $response->addHTML('</div>');
feb562e @tomassrnka Replication support - tomas_zahra branch merged
tomassrnka authored
70
252a392 @xmujay 1. change the function name
xmujay authored
71 if (! isset($_REQUEST['repl_clear_scr'])) {
78b0082 @nijel [core] Updated mootools to fix some glitches with Safari.
nijel authored
72 // Render the 'Slave configuration' section
239067f @xmujay refactor server_replication
xmujay authored
73 $response->addHTML(
74 PMA_getHtmlForSlaveConfiguration(
9310e76 @nijel Fix indentation
nijel authored
75 $server_slave_status,
239067f @xmujay refactor server_replication
xmujay authored
76 $server_slave_replication
77 )
78 );
feb562e @tomassrnka Replication support - tomas_zahra branch merged
tomassrnka authored
79 }
252a392 @xmujay 1. change the function name
xmujay authored
80 if (isset($_REQUEST['sl_configure'])) {
81 $response->addHTML(PMA_getHtmlForReplicationChangeMaster("slave_changemaster"));
feb562e @tomassrnka Replication support - tomas_zahra branch merged
tomassrnka authored
82 }
83 ?>
Something went wrong with that request. Please try again.