[fix] enhance the display of phpmyadmin SSO access : goes directly to the right database
This commit is contained in:
parent
08f5d9b15c
commit
c4da8edf90
|
@ -97,10 +97,7 @@ if ($r[Rights] == 'All') {
|
|||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<a href="/sql_pma_sso.php" target="_blank"><?php __("Web interface PhpMyAdmin"); ?></a>
|
||||
<p>
|
||||
<code>http://<?php echo $L_FQDN; ?>/alternc-sql/</code>
|
||||
</p>
|
||||
<a href="/sql_pma_sso.php?db=<?php echo $dbname; ?>" target="_blank"><?php __("Click here to access PhpMyAdmin interface"); ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
|
|
|
@ -29,6 +29,12 @@
|
|||
*/
|
||||
require_once("../class/config.php");
|
||||
|
||||
$fields = array (
|
||||
"id" => array ("request", "string", ""),
|
||||
);
|
||||
getFields($fields);
|
||||
|
||||
|
||||
if ($r=$mysql->php_myadmin_connect()) {
|
||||
// SSO of PhpMyAdmin
|
||||
$_SESSION['PMA_single_signon_user'] = $r["login"];
|
||||
|
@ -39,8 +45,16 @@ if ($r=$mysql->php_myadmin_connect()) {
|
|||
// Forget any standard phpmyadmin session
|
||||
setcookie("phpMyAdmin", "", time() - 3600);
|
||||
|
||||
if ($id!="") {
|
||||
$r=$mysql->get_mysql_details($id);
|
||||
if ($r) {
|
||||
$db="?db=".$id;
|
||||
}
|
||||
} else {
|
||||
$db="";
|
||||
}
|
||||
// finally redirect to phpMyAdmin :
|
||||
header("Location: /alternc-sql/index.php");
|
||||
header("Location: /alternc-sql/index.php".$db);
|
||||
exit();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue