Functionalised server selection and use it in cookie auth (RFE #1362727).
This commit is contained in:
@@ -38,6 +38,10 @@ $Source$
|
|||||||
information.
|
information.
|
||||||
* libraries/display_select_lang.lib.php,
|
* libraries/display_select_lang.lib.php,
|
||||||
libraries/auth/cookie.auth.lib.php: Use fieldset for language selection.
|
libraries/auth/cookie.auth.lib.php: Use fieldset for language selection.
|
||||||
|
* main.php, libraries/left_header.inc.php,
|
||||||
|
libraries/select_server.lib.php, libraries/auth/cookie.auth.lib.php:
|
||||||
|
Functionalised server selection and use it in cookie auth (RFE
|
||||||
|
#1362727).
|
||||||
|
|
||||||
2005-11-22 Sebastian Mendel <cybot_tm@users.sourceforge.net>
|
2005-11-22 Sebastian Mendel <cybot_tm@users.sourceforge.net>
|
||||||
* added test/theme.php: for testing themes
|
* added test/theme.php: for testing themes
|
||||||
|
@@ -201,40 +201,8 @@ echo sprintf( $GLOBALS['strWelcome'],
|
|||||||
?>
|
?>
|
||||||
>
|
>
|
||||||
<?php
|
<?php
|
||||||
echo "\n";
|
require_once('./libraries/select_server.lib.php');
|
||||||
// Displays the MySQL servers choice
|
PMA_select_server(FALSE, FALSE);
|
||||||
foreach ($cfg['Servers'] AS $key => $val) {
|
|
||||||
if (!empty($val['host'])) {
|
|
||||||
echo ' <option value="' . $key . '"';
|
|
||||||
if (!empty($server) && ($server == $key)) {
|
|
||||||
echo ' selected="selected"';
|
|
||||||
}
|
|
||||||
echo '>';
|
|
||||||
if ($val['verbose'] != '') {
|
|
||||||
echo htmlspecialchars($val['verbose']);
|
|
||||||
} else {
|
|
||||||
echo htmlspecialchars($val['host']);
|
|
||||||
if (!empty($val['port'])) {
|
|
||||||
echo ':' . $val['port'];
|
|
||||||
}
|
|
||||||
// loic1: skip this because it's not a so good idea to
|
|
||||||
// display sockets used to everybody
|
|
||||||
// if (!empty($val['socket']) && PMA_PHP_INT_VERSION >= 30010) {
|
|
||||||
// echo ':' . $val['socket'];
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
// loic1: if 'only_db' is an array and there is more than one
|
|
||||||
// value, displaying such informations may not be a so
|
|
||||||
// good idea
|
|
||||||
if (!empty($val['only_db'])) {
|
|
||||||
echo ' - ' . (is_array($val['only_db']) ? implode(', ', $val['only_db']) : $val['only_db']);
|
|
||||||
}
|
|
||||||
if (!empty($val['user']) && ($val['auth_type'] == 'basic')) {
|
|
||||||
echo ' (' . $val['user'] . ')';
|
|
||||||
}
|
|
||||||
echo ' </option>' . "\n";
|
|
||||||
} // end if (!empty($val['host']))
|
|
||||||
} // end while
|
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -80,8 +80,11 @@ if ($GLOBALS['cfg']['MainPageIconic']) {
|
|||||||
}
|
}
|
||||||
echo '</div>' . "\n";
|
echo '</div>' . "\n";
|
||||||
|
|
||||||
if ( $GLOBALS['cfg']['LeftDisplayServers'] ) {
|
/**
|
||||||
$show_server_left = TRUE;
|
* Displays the MySQL servers choice form
|
||||||
|
*/
|
||||||
|
if ( $GLOBALS['cfg']['LeftDisplayServers'] && count($cfg['Servers']) > 1 ) {
|
||||||
include('./libraries/select_server.lib.php');
|
include('./libraries/select_server.lib.php');
|
||||||
|
PMA_select_server(TRUE, TRUE);
|
||||||
} // end if LeftDisplayServers
|
} // end if LeftDisplayServers
|
||||||
?>
|
?>
|
||||||
|
@@ -4,20 +4,30 @@
|
|||||||
* $Id$
|
* $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (count($cfg['Servers']) > 1) {
|
function PMA_select_server($form, $left) {
|
||||||
if ($show_server_left) {
|
global $cfg, $lang, $convcharset;
|
||||||
echo '<div class="heada">' . $strServer . ':</div>';
|
|
||||||
} else {
|
// Show as list?
|
||||||
?>
|
$list = $cfg['DisplayServersList'];
|
||||||
<fieldset>
|
if (!$form) {
|
||||||
<legend><?php echo $strServerChoice; ?></legend>
|
$list = FALSE;
|
||||||
<?php
|
|
||||||
}
|
}
|
||||||
if (!$cfg['DisplayServersList']) {
|
|
||||||
?>
|
if ($form) {
|
||||||
<form method="post" action="index.php" target="_parent">
|
if ($left) {
|
||||||
<select name="server" onchange="this.form.submit();">
|
echo '<div class="heada">' . $GLOBALS['strServer']. ':</div>';
|
||||||
<?php
|
} else {
|
||||||
|
?>
|
||||||
|
<fieldset>
|
||||||
|
<legend><?php echo $GLOBALS['strServerChoice']; ?></legend>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
if (!$list) {
|
||||||
|
?>
|
||||||
|
<form method="post" action="index.php" target="_parent">
|
||||||
|
<select name="server" onchange="this.form.submit();">
|
||||||
|
<?php
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach ($cfg['Servers'] AS $key => $val) {
|
foreach ($cfg['Servers'] AS $key => $val) {
|
||||||
if (!empty($val['host'])) {
|
if (!empty($val['host'])) {
|
||||||
@@ -43,8 +53,8 @@ if (count($cfg['Servers']) > 1) {
|
|||||||
$label .= ' (' . $val['user'] . ')';
|
$label .= ' (' . $val['user'] . ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($cfg['DisplayServersList']){
|
if ($list){
|
||||||
if ($selected && !$show_server_left) {
|
if ($selected && !$left) {
|
||||||
echo '» <b>' . htmlspecialchars($label) . '</b><br />';
|
echo '» <b>' . htmlspecialchars($label) . '</b><br />';
|
||||||
}else{
|
}else{
|
||||||
echo '» <a class="item" href="index.php?server=' . $key . '&lang=' . $lang . '&convcharset=' . $convcharset . '" target="_top">' . htmlspecialchars($label) . '</a><br />';
|
echo '» <a class="item" href="index.php?server=' . $key . '&lang=' . $lang . '&convcharset=' . $convcharset . '" target="_top">' . htmlspecialchars($label) . '</a><br />';
|
||||||
@@ -56,23 +66,25 @@ if (count($cfg['Servers']) > 1) {
|
|||||||
} // end if (!empty($val['host']))
|
} // end if (!empty($val['host']))
|
||||||
} // end while
|
} // end while
|
||||||
|
|
||||||
if ( ! $cfg['DisplayServersList'] ) {
|
if ($form) {
|
||||||
|
if ( ! $list ) {
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
||||||
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
|
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
|
||||||
<noscript>
|
<noscript>
|
||||||
<input type="submit" value="<?php echo $strGo; ?>" />
|
<input type="submit" value="<?php echo $GLOBALS['strGo']; ?>" />
|
||||||
</noscript>
|
</noscript>
|
||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
if (!$show_server_left) {
|
if (!$left) {
|
||||||
?>
|
?>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
echo '<hr />';
|
echo '<hr />';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
4
main.php
4
main.php
@@ -126,9 +126,9 @@ if (($server > 0) && isset($mode) && ($mode == 'reload')) {
|
|||||||
/**
|
/**
|
||||||
* Displays the MySQL servers choice form
|
* Displays the MySQL servers choice form
|
||||||
*/
|
*/
|
||||||
if (!$cfg['LeftDisplayServers']) {
|
if (!$cfg['LeftDisplayServers'] && count($cfg['Servers']) > 1) {
|
||||||
$show_server_left = FALSE;
|
|
||||||
include('./libraries/select_server.lib.php');
|
include('./libraries/select_server.lib.php');
|
||||||
|
PMA_select_server(TRUE, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// nested table needed
|
// nested table needed
|
||||||
|
Reference in New Issue
Block a user