Czech translation update.
[phpmyadmin/madhuracj.git] / server_replication.php
blob01cddecaad533290d358fbf756533d42c04d563b
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @version $Id$
6 * @package phpMyAdmin
7 */
9 /**
12 require_once './libraries/common.inc.php';
14 /**
15 * Does the common work
17 $GLOBALS['js_include'][] = 'server_privileges.js';
18 $GLOBALS['js_include'][] = 'functions.js';
19 $GLOBALS['js_include'][] = 'mootools.js';
20 $GLOBALS['js_include'][] = 'mootools_common.js';
22 require './libraries/server_common.inc.php';
23 require './libraries/replication.inc.php';
24 require './libraries/replication_gui.lib.php';
25 require_once './libraries/server_synchronize.lib.php';
27 /**
28 * Checks if the user is allowed to do what he tries to...
30 if (!$is_superuser) {
31 require './libraries/server_links.inc.php';
32 echo '<h2>' . "\n"
33 . PMA_getIcon('s_replication.png')
34 . $GLOBALS['strReplication'] . "\n"
35 . '</h2>' . "\n";
36 PMA_Message::error('strNoPrivileges')->display();
37 require_once './libraries/footer.inc.php';
40 /**
41 * Handling control requests
44 if (isset($GLOBALS['sr_take_action'])) {
45 $refresh = false;
46 if (isset($GLOBALS['slave_changemaster'])) {
47 $_SESSION['replication']['m_username'] = $sr['username'] = PMA_sqlAddslashes($GLOBALS['username']);
48 $_SESSION['replication']['m_password'] = $sr['pma_pw'] = PMA_sqlAddslashes($GLOBALS['pma_pw']);
49 $_SESSION['replication']['m_hostname'] = $sr['hostname'] = PMA_sqlAddslashes($GLOBALS['hostname']);
50 $_SESSION['replication']['m_port'] = $sr['port'] = PMA_sqlAddslashes($GLOBALS['port']);
51 $_SESSION['replication']['m_correct'] = '';
52 $_SESSION['replication']['sr_action_status'] = 'error';
53 $_SESSION['replication']['sr_action_info'] = $strReplicationUnknownError;
54 $url = $sr['hostname'];
56 if ($sr['port'] != '') {
57 $url .= ':' . $sr['port'];
60 // Attempt to connect to the new master server
61 $check_master = null;
62 $old_error_reporting = error_reporting(0);
63 $check_master = @mysql_connect($url, $sr['username'], $sr['pma_pw']);
64 error_reporting($old_error_reporting);
65 unset($url);
67 if (!$check_master) {
68 $_SESSION['replication']['sr_action_status'] = 'error';
69 $_SESSION['replication']['sr_action_info'] = sprintf($GLOBALS['strReplicationErrorMasterConnect'], $sr['hostname']);
70 } else {
71 $link_to_master = PMA_replication_connect_to_master($sr['username'], $sr['pma_pw'], $sr['hostname'], $sr['port']);
73 // Read the current master position
74 $position = PMA_replication_slave_bin_log_master($link_to_master);
76 if (empty($position)) {
77 $_SESSION['replication']['sr_action_status'] = 'error';
78 $_SESSION['replication']['sr_action_info'] = $GLOBALS['strReplicationErrorGetPosition'];
79 } else {
80 $_SESSION['replication']['m_correct'] = true;
82 if (!PMA_replication_slave_change_master($sr['username'], $sr['pma_pw'], $sr['hostname'], $sr['port'], $position, true, false)) {
83 $_SESSION['replication']['sr_action_status'] = 'error';
84 $_SESSION['replication']['sr_action_info'] = $GLOBALS['strReplicationUnableToChange'];
85 } else {
86 $_SESSION['replication']['sr_action_status'] = 'success';
87 $_SESSION['replication']['sr_action_info'] = sprintf($GLOBALS['strReplicationChangedSuccesfully'], $sr['hostname']);
91 } elseif (isset($GLOBALS['sr_slave_server_control'])) {
92 if ($GLOBALS['sr_slave_action'] == 'reset') {
93 PMA_replication_slave_control("STOP");
94 PMA_DBI_try_query("RESET SLAVE;");
95 PMA_replication_slave_control("START");
96 } else {
97 PMA_replication_slave_control($GLOBALS['sr_slave_action'], $GLOBALS['sr_slave_control_parm']);
99 $refresh = true;
101 } elseif (isset($GLOBALS['sr_slave_skip_error'])) {
102 $count = 1;
103 if (isset($GLOBALS['sr_skip_errors_count'])) {
104 $count = $GLOBALS['sr_skip_errors_count'] * 1;
106 PMA_replication_slave_control("STOP");
107 PMA_DBI_try_query("SET GLOBAL SQL_SLAVE_SKIP_COUNTER = ".$count.";");
108 PMA_replication_slave_control("START");
110 } elseif (isset($GLOBALS['sl_sync'])) {
111 // TODO username, host and port could be read from 'show slave status',
112 // when asked for a password this might work in more situations the just after changing master (where the master password is stored in session)
113 $src_link = PMA_replication_connect_to_master($_SESSION['replication']['m_username'], $_SESSION['replication']['m_password'], $_SESSION['replication']['m_hostname'], $_SESSION['replication']['m_port']);
114 $trg_link = null; // using null to indicate the current PMA server
116 $data = PMA_DBI_fetch_result('SHOW MASTER STATUS', null, null, $src_link); // let's find out, which databases are replicated
118 $do_db = array();
119 $ignore_db = array();
120 $dblist = array();
122 if (!empty($data[0]['Binlog_Do_DB'])) {
123 $do_db = explode(',', $data[0]['Binlog_Do_DB']);
125 if (!empty($data[0]['Binlog_Ignore_DB'])) {
126 $ignore_db = explode(',', $data[0]['Binlog_Ignore_DB']);
129 $tmp_alldbs = PMA_DBI_query('SHOW DATABASES;', $src_link);
130 while ($tmp_row = PMA_DBI_fetch_row($tmp_alldbs)) {
131 if ($tmp_row[0] == 'information_schema') {
132 continue;
134 if (count($do_db) == 0) {
135 if (array_search($tmp_row[0], $ignore_db) !== false) {
136 continue;
138 $dblist[] = $tmp_row[0];
140 PMA_DBI_query('CREATE DATABASE IF NOT EXISTS '.$tmp_row[0], $trg_link);
141 } else {
142 if (array_search($tmp_row[0], $do_db) !== false) {
143 $dblist[] = $tmp_row[0];
144 PMA_DBI_query('CREATE DATABASE IF NOT EXISTS '.$tmp_row[0], $trg_link);
147 } // end while
149 unset($do_db, $ignore_db, $data);
151 if (isset($GLOBALS['repl_data'])) {
152 $include_data = true;
153 } else {
154 $include_data = false;
156 foreach ($dblist as $db) {
157 PMA_replication_synchronize_db($db, $src_link, $trg_link, $include_data);
159 // TODO some form of user feedback error/success would be nice
160 // What happens if $dblist is empty?
161 // or sync failed?
164 if ($refresh) {
165 Header("Location: ". PMA_generate_common_url($GLOBALS['url_params']));
167 unset($refresh);
170 * Displays the links
172 require './libraries/server_links.inc.php';
174 echo '<div id="replication">'."\n";
175 echo ' <h2>'."\n";
176 echo ' <img class="icon" src="'. $GLOBALS['pmaThemeImage'] .'s_replication.png" width="16" height="16" alt="" />'."\n";
177 echo $GLOBALS['strReplication']."\n";
178 echo ' </h2>'."\n";
180 if (isset($_SESSION['replication']['sr_action_status']) && isset($_SESSION['replication']['sr_action_info'])) {
181 if ($_SESSION['replication']['sr_action_status'] == 'error') {
182 PMA_Message::error($_SESSION['replication']['sr_action_info'])->display();
183 $_SESSION['replication']['sr_action_status'] = 'unknown';
184 } elseif ($_SESSION['replication']['sr_action_status'] == 'success') {
185 PMA_Message::success($_SESSION['replication']['sr_action_info'])->display();
186 $_SESSION['replication']['sr_action_status'] = 'unknown';
190 if ($server_master_status) {
191 if (!isset($GLOBALS['repl_clear_scr'])) {
192 echo PMA_js_mootools_domready($jscode['master_replication']);
193 echo '<fieldset>'."\n";
194 echo '<legend>'. $GLOBALS['strReplicationMaster'] .'</legend>'."\n";
195 echo $GLOBALS['strReplicationConfiguredMaster']."\n";
196 echo '<ul>'."\n";
197 echo ' <li><a href="#" id="master_status_href">'. $GLOBALS['strReplicationShowMasterStatus'] .'</a></li>';
198 PMA_replication_print_status_table('master', true, false);
199 $_url_params = $GLOBALS['url_params'];
200 $_url_params['mr_adduser'] = true;
201 $_url_params['repl_clear_scr'] = true;
203 echo ' <li><a href="'.PMA_generate_common_url($_url_params).'" id="master_addslaveuser_href">'. $GLOBALS['strReplicationAddSlaveUser'] .'</a></li>';
205 if (isset($GLOBALS['mr_adduser'])) {
206 $fields_info = PMA_DBI_get_fields('mysql', 'user');
207 $username_length = 16;
208 $hostname_length = 41;
209 foreach ($fields_info as $key => $val) {
210 if ($val['Field'] == 'User') {
211 strtok($val['Type'], '()');
212 $v = strtok('()');
213 if (is_int($v)) {
214 $username_length = $v;
216 } elseif ($val['Field'] == 'Host') {
217 strtok($val['Type'], '()');
218 $v = strtok('()');
219 if (is_int($v)) {
220 $hostname_length = $v;
224 unset($fields_info);
226 if (isset($GLOBALS['username']) && strlen($GLOBALS['username']) === 0) {
227 $GLOBALS['pred_username'] = 'any';
229 echo '<div id="master_addslaveuser_gui">'."\n";
230 echo '<form autocomplete="off" method="post" action="server_privileges.php" onsubmit="return checkAddUser(this);">'."\n";
231 echo PMA_generate_common_hidden_inputs('', '');
232 echo '<fieldset id="fieldset_add_user_login">' . "\n"
233 . '<legend>'.$GLOBALS['strReplicationAddSlaveUser'].'</legend>' . "\n"
234 . '<input id="checkbox_Repl_slave_priv" type="hidden" title="Needed for the replication slaves." value="Y" name="Repl_slave_priv"/>'. "\n"
235 . '<input id="checkbox_Repl_client_priv" type="hidden" title="Needed for the replication slaves." value="Y" name="Repl_client_priv"/>'. "\n"
236 . '<input type="hidden" name="sr_take_action" value="true" />'. "\n"
237 . '<div class="item">' . "\n"
238 . '<label for="select_pred_username">' . "\n"
239 . ' ' . $GLOBALS['strUserName'] . ':' . "\n"
240 . '</label>' . "\n"
241 . '<span class="options">' . "\n"
242 . ' <select name="pred_username" id="select_pred_username" title="' . $GLOBALS['strUserName'] . '"' . "\n"
243 . ' onchange="if (this.value == \'any\') { username.value = \'\'; } else if (this.value == \'userdefined\') { username.focus(); username.select(); }">' . "\n"
244 . ' <option value="any"' . ((isset($GLOBALS['pred_username']) && $GLOBALS['pred_username'] == 'any') ? ' selected="selected"' : '') . '>' . $GLOBALS['strAnyUser'] . '</option>' . "\n"
245 . ' <option value="userdefined"' . ((!isset($GLOBALS['pred_username']) || $GLOBALS['pred_username'] == 'userdefined') ? ' selected="selected"' : '') . '>' . $GLOBALS['strUseTextField'] . ':</option>' . "\n"
246 . ' </select>' . "\n"
247 . '</span>' . "\n"
248 . '<input type="text" name="username" maxlength="'
249 . $username_length . '" title="' . $GLOBALS['strUserName'] . '"'
250 . (empty($GLOBALS['username'])
251 ? ''
252 : ' value="' . (isset($GLOBALS['new_username'])
253 ? $GLOBALS['new_username']
254 : $GLOBALS['username']) . '"')
255 . ' onchange="pred_username.value = \'userdefined\';" />' . "\n"
256 . '</div>' . "\n"
257 . '<div class="item">' . "\n"
258 . '<label for="select_pred_hostname">' . "\n"
259 . ' ' . $GLOBALS['strHost'] . ':' . "\n"
260 . '</label>' . "\n"
261 . '<span class="options">' . "\n"
262 . ' <select name="pred_hostname" id="select_pred_hostname" title="' . $GLOBALS['strHost'] . '"' . "\n";
263 $_current_user = PMA_DBI_fetch_value('SELECT USER();');
264 if (! empty($_current_user)) {
265 $thishost = str_replace("'", '', substr($_current_user, (strrpos($_current_user, '@') + 1)));
266 if ($thishost == 'localhost' || $thishost == '127.0.0.1') {
267 unset($thishost);
270 echo ' onchange="if (this.value == \'any\') { hostname.value = \'%\'; } else if (this.value == \'localhost\') { hostname.value = \'localhost\'; } '
271 . (empty($thishost) ? '' : 'else if (this.value == \'thishost\') { hostname.value = \'' . addslashes(htmlspecialchars($thishost)) . '\'; } ')
272 . 'else if (this.value == \'hosttable\') { hostname.value = \'\'; } else if (this.value == \'userdefined\') { hostname.focus(); hostname.select(); }">' . "\n";
273 unset($_current_user);
275 // when we start editing a user, $GLOBALS['pred_hostname'] is not defined
276 if (!isset($GLOBALS['pred_hostname']) && isset($GLOBALS['hostname'])) {
277 switch (strtolower($GLOBALS['hostname'])) {
278 case 'localhost':
279 case '127.0.0.1':
280 $GLOBALS['pred_hostname'] = 'localhost';
281 break;
282 case '%':
283 $GLOBALS['pred_hostname'] = 'any';
284 break;
285 default:
286 $GLOBALS['pred_hostname'] = 'userdefined';
287 break;
290 echo ' <option value="any"'
291 . ((isset($GLOBALS['pred_hostname']) && $GLOBALS['pred_hostname'] == 'any')
292 ? ' selected="selected"' : '') . '>' . $GLOBALS['strAnyHost']
293 . '</option>' . "\n"
294 . ' <option value="localhost"'
295 . ((isset($GLOBALS['pred_hostname']) && $GLOBALS['pred_hostname'] == 'localhost')
296 ? ' selected="selected"' : '') . '>' . $GLOBALS['strLocalhost']
297 . '</option>' . "\n";
298 if (!empty($thishost)) {
299 echo ' <option value="thishost"'
300 . ((isset($GLOBALS['pred_hostname']) && $GLOBALS['pred_hostname'] == 'thishost')
301 ? ' selected="selected"' : '') . '>' . $GLOBALS['strThisHost']
302 . '</option>' . "\n";
304 unset($thishost);
305 echo ' <option value="hosttable"'
306 . ((isset($GLOBALS['pred_hostname']) && $GLOBALS['pred_hostname'] == 'hosttable')
307 ? ' selected="selected"' : '') . '>' . $GLOBALS['strUseHostTable']
308 . '</option>' . "\n"
309 . ' <option value="userdefined"'
310 . ((isset($GLOBALS['pred_hostname']) && $GLOBALS['pred_hostname'] == 'userdefined')
311 ? ' selected="selected"' : '')
312 . '>' . $GLOBALS['strUseTextField'] . ':</option>' . "\n"
313 . ' </select>' . "\n"
314 . '</span>' . "\n"
315 . '<input type="text" name="hostname" maxlength="'
316 . $hostname_length . '" value="'
317 . (isset($GLOBALS['hostname']) ? $GLOBALS['hostname'] : '')
318 . '" title="' . $GLOBALS['strHost']
319 . '" onchange="pred_hostname.value = \'userdefined\';" />' . "\n"
320 . PMA_showHint($GLOBALS['strHostTableExplanation'])
321 . '</div>' . "\n"
322 . '<div class="item">' . "\n"
323 . '<label for="select_pred_password">' . "\n"
324 . ' ' . $GLOBALS['strPassword'] . ':' . "\n"
325 . '</label>' . "\n"
326 . '<span class="options">' . "\n"
327 . ' <select name="pred_password" id="select_pred_password" title="'
328 . $GLOBALS['strPassword'] . '"' . "\n"
329 . ' onchange="if (this.value == \'none\') { pma_pw.value = \'\'; pma_pw2.value = \'\'; } else if (this.value == \'userdefined\') { pma_pw.focus(); pma_pw.select(); }">' . "\n"
330 . ' <option value="none"';
331 if (isset($GLOBALS['username']) && $mode != 'change') {
332 echo ' selected="selected"';
334 echo '>' . $GLOBALS['strNoPassword'] . '</option>' . "\n"
335 . ' <option value="userdefined"' . (isset($GLOBALS['username']) ? '' : ' selected="selected"') . '>' . $GLOBALS['strUseTextField'] . ':</option>' . "\n"
336 . ' </select>' . "\n"
337 . '</span>' . "\n"
338 . '<input type="password" id="text_pma_pw" name="pma_pw" title="' . $GLOBALS['strPassword'] . '" onchange="pred_password.value = \'userdefined\';" />' . "\n"
339 . '</div>' . "\n"
340 . '<div class="item">' . "\n"
341 . '<label for="text_pma_pw2">' . "\n"
342 . ' ' . $GLOBALS['strReType'] . ':' . "\n"
343 . '</label>' . "\n"
344 . '<span class="options">&nbsp;</span>' . "\n"
345 . '<input type="password" name="pma_pw2" id="text_pma_pw2" title="' . $GLOBALS['strReType'] . '" onchange="pred_password.value = \'userdefined\';" />' . "\n"
346 . '</div>' . "\n"
347 . '<div class="item">' . "\n"
348 . '<label for="button_generate_password">' . "\n"
349 . ' ' . $GLOBALS['strGeneratePassword'] . ':' . "\n"
350 . '</label>' . "\n"
351 . '<span class="options">' . "\n"
352 . ' <input type="button" id="button_generate_password" value="' . $GLOBALS['strGenerate'] . '" onclick="suggestPassword(this.form)" />' . "\n"
353 . '</span>' . "\n"
354 . '<input type="text" name="generated_pw" id="generated_pw" />' . "\n"
355 . '</div>' . "\n"
356 . '</fieldset>' . "\n";
357 echo '<fieldset id="fieldset_user_privtable_footer" class="tblFooters">' . "\n"
358 . ' <input type="submit" name="adduser_submit" id="adduser_submit" value="' . $GLOBALS['strGo'] . '" />' . "\n"
359 . '</fieldset>' . "\n";
360 echo '</form>'."\n";
361 echo '</div>'."\n";///////
362 } elseif (!isset($GLOBALS['repl_clear_scr'])) {
363 echo "</ul>\n";
364 echo '</fieldset>'."\n";
366 } elseif (!isset($GLOBALS['mr_configure']) && !isset($GLOBALS['repl_clear_scr'])) {
367 $_url_params = $GLOBALS['url_params'];
368 $_url_params['mr_configure'] = true;
370 echo '<fieldset>'."\n";
371 echo '<legend>'. $GLOBALS['strReplicationMaster'] .'</legend>'."\n";
372 echo sprintf($GLOBALS['strReplicationServernConfiguredMaster'], PMA_generate_common_url($_url_params)) ."\n";
373 echo '</fieldset>'."\n";
376 if (isset($GLOBALS['mr_configure'])) {
377 // Render the 'Master configuration' section
378 echo PMA_js_mootools_domready($jscode['configure_master']);
379 echo '<fieldset>'."\n";
380 echo '<legend>'. $GLOBALS['strReplicationMasterConfiguration'] .'</legend>'."\n";
381 echo $GLOBALS['strReplicationMasterChooseMode'].'<br /><br />'."\n";
383 echo '<select name="db_type" id="db_type">'."\n";
384 echo '<option value="all">'. $GLOBALS['strReplicationMasterChooseAll'] .'</option>'."\n";
385 echo '<option value="ign">'. $GLOBALS['strReplicationMasterChooseIgn'] .'</option>'."\n";
386 echo '</select>'."\n";
387 echo '<br /><br />'."\n";
388 echo $GLOBALS['strReplicationSelectDatabases'].'<br />'."\n";
389 echo PMA_replication_db_multibox();
390 echo '<br /><br />'."\n";
391 echo $GLOBALS['strReplicationAddLines'].'<br />'."\n";
392 echo '<pre><div id="rep">server-id='. $serverid .'<br />log-bin=mysql-bin<br />log-error=mysql-bin.err<br /></div></pre>'."\n";
393 echo $GLOBALS['strReplicationRestartServer'] ."\n";
394 echo '</fieldset>'."\n";
395 echo '<fieldset class="tblFooters">';
396 echo ' <form autocomplete="off" method="post" action="server_replication.php" >'."\n";
397 echo PMA_generate_common_hidden_inputs('', '');
398 echo ' <input type="submit" value="' . $GLOBALS['strGo'] . '" id="goButton" />';
399 echo ' </form>'."\n";
400 echo '</fieldset>';
402 require_once './libraries/footer.inc.php';
403 exit;
406 echo '</div>';
408 if (!isset($GLOBALS['repl_clear_scr'])) {
409 // Render the 'Slave configuration' section
410 echo '<fieldset>'."\n";
411 echo '<legend>' . $GLOBALS['strReplicationSlave'] . '</legend>'."\n";
412 if ($server_slave_status) {
413 echo PMA_js_mootools_domready($jscode['slave_control']);
414 echo '<div id="slave_configuration_gui">'."\n";
416 $_url_params = $GLOBALS['url_params'];
417 $_url_params['sr_take_action'] = true;
418 $_url_params['sr_slave_server_control'] = true;
420 if ($server_slave_replication[0]['Slave_IO_Running'] == 'No') {
421 $_url_params['sr_slave_action'] = 'start';
422 } else {
423 $_url_params['sr_slave_action'] = 'stop';
426 $_url_params['sr_slave_control_parm'] = 'IO_THREAD';
427 $slave_control_io_link = PMA_generate_common_url($_url_params);
429 if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No') {
430 $_url_params['sr_slave_action'] = 'start';
431 } else {
432 $_url_params['sr_slave_action'] = 'stop';
435 $_url_params['sr_slave_control_parm'] = 'SQL_THREAD';
436 $slave_control_sql_link = PMA_generate_common_url($_url_params);
438 if ($server_slave_replication[0]['Slave_IO_Running'] == 'No'
439 || $server_slave_replication[0]['Slave_SQL_Running'] == 'No'
441 $_url_params['sr_slave_action'] = 'start';
442 } else {
443 $_url_params['sr_slave_action'] = 'stop';
446 $_url_params['sr_slave_control_parm'] = null;
447 $slave_control_full_link = PMA_generate_common_url($_url_params);
449 $_url_params['sr_slave_action'] = 'reset';
450 $slave_control_reset_link = PMA_generate_common_url($_url_params);
452 $_url_params = $GLOBALS['url_params'];
453 $_url_params['sr_slave_skip_error'] = true;
454 $slave_skip_error_link = PMA_generate_common_url($_url_params);
456 if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No')
457 PMA_Message::warning('Slave SQL Thread not running!')->display();
458 if ($server_slave_replication[0]['Slave_IO_Running'] == 'No')
459 PMA_Message::warning('Slave IO Thread not running!')->display();
461 $_url_params = $GLOBALS['url_params'];
462 $_url_params['sl_configure'] = true;
463 $_url_params['repl_clear_scr'] = true;
465 $reconfiguremaster_link = PMA_generate_common_url($_url_params);
467 echo $GLOBALS['strReplicationSlaveConfigured']."\n";
468 echo '<br />'."\n";
469 echo '<ul>'."\n";
470 echo ' <li><a href="#" id="slave_status_href">'. $GLOBALS['strReplicationSlaveSeeStatus'].'</a></li>'."\n";
471 echo PMA_replication_print_status_table('slave', true, false);
472 if (isset($_SESSION['replication']['m_correct']) && $_SESSION['replication']['m_correct'] == true) {
473 echo PMA_js_mootools_domready($jscode['slave_control_sync']);
474 echo ' <li><a href="#" id="slave_synchronization_href">'.$GLOBALS['strReplicationSynchronize'].'</a></li>'."\n";
475 echo ' <div id="slave_synchronization_gui" style="display: none">'."\n";
476 echo ' <form method="post" action="server_replication.php">'."\n";
477 echo PMA_generate_common_hidden_inputs('', '');
478 echo ' <input type="checkbox" name="repl_struc" value="1" checked disabled /> '. $GLOBALS['strStructure']. '<br />'."\n"; // this is just for vizualization, it has no other purpose
479 echo ' <input type="checkbox" name="repl_data" value="1" checked /> '. $GLOBALS['strData'] .' <br />'."\n";
480 echo ' <input type="hidden" name="sr_take_action" value="1" />'."\n";
481 echo ' <input type="submit" name="sl_sync" value="'. $GLOBALS['strGo'] .'" />'."\n";
482 echo ' </form>'."\n";
483 echo ' </div>'."\n";
485 echo ' <li><a href="#" id="slave_control_href">'. $GLOBALS['strReplicationControlSlave'] .'</a>'."\n";
486 echo ' <div id="slave_control_gui" style="display: none">'."\n";
487 echo ' <ul>'."\n";
488 echo ' <li><a href="'. $slave_control_full_link .'">'. (($server_slave_replication[0]['Slave_IO_Running'] == 'No' || $server_slave_replication[0]['Slave_SQL_Running'] == 'No') ? $GLOBALS['strFullStart'] : $GLOBALS['strFullStop']). ' </a></li>'."\n";
489 echo ' <li><a href="'. $slave_control_reset_link .'">'. $GLOBALS['strReplicationSlaveReset'] .'</a></li>'."\n";
490 echo ' <li><a href="'. $slave_control_sql_link .'">'. sprintf($GLOBALS['strReplicationSlaveSQLThread'], ($server_slave_replication[0]['Slave_SQL_Running'] == 'No' ? $GLOBALS['strStart'] : $GLOBALS['strStop'])) .'</a></li>'."\n";
491 echo ' <li><a href="'. $slave_control_io_link .'">'. sprintf($GLOBALS['strReplicationSlaveIOThread'], ($server_slave_replication[0]['Slave_IO_Running'] == 'No' ? $GLOBALS['strStart'] : $GLOBALS['strStop'])) .'</a></li>'."\n";
492 echo ' </ul>'."\n";
493 echo ' </div>'."\n";
494 echo ' </li>'."\n";
495 echo ' <li><a href="#" id="slave_errormanagement_href">'. $GLOBALS['strReplicationSlaveErrorManagement'] .'</a>'."\n";
496 echo ' <div id="slave_errormanagement_gui" style="display: none">'."\n";
497 PMA_Message::warning($GLOBALS['strReplicationSkippingErrorWarn'])->display();
498 echo ' <ul>'."\n";
499 echo ' <li><a href="'. $slave_skip_error_link .'">'. $GLOBALS['strReplicationSlaveSkipCurrentError'] .'</a></li>'."\n";
500 echo ' <li>'.$GLOBALS['strReplicationSlaveSkipNext']."\n";
501 echo ' <form method="post" action="server_replication.php">'."\n";
502 echo PMA_generate_common_hidden_inputs('', '');
503 echo ' <input type="text" name="sr_skip_errors_count" value="1" style="width: 30px" />'.$GLOBALS['strReplicationSlaveSkipNextErrors']."\n";
504 echo ' <input type="submit" name="sr_slave_skip_error" value="'. $GLOBALS['strGo'] .'" />'."\n";
505 echo ' <input type="hidden" name="sr_take_action" value="1" />'."\n";
506 echo ' </form></li>'."\n";
507 echo ' </ul>'."\n";
508 echo ' </div>'."\n";
509 echo ' </li>'."\n";
510 echo ' <li><a href="'. $reconfiguremaster_link .'">'.$GLOBALS['strReplicationSlaveChangeMaster'].'</a></li>'."\n";
511 echo '</ul>'."\n";
513 } elseif (!isset($GLOBALS['sl_configure'])) {
514 $_url_params = $GLOBALS['url_params'];
515 $_url_params['sl_configure'] = true;
516 $_url_params['repl_clear_scr'] = true;
518 echo sprintf($GLOBALS['strReplicationSlaveNotConfigured'], PMA_generate_common_url($_url_params))."\n";
520 echo '</div>'."\n";
521 echo '</fieldset>'."\n";
523 if (isset($GLOBALS['sl_configure'])) {
524 PMA_replication_gui_changemaster("slave_changemaster");
526 require_once './libraries/footer.inc.php';