[fix] enhance the display of phpmyadmin SSO access : goes directly to the right database

This commit is contained in:
Benjamin Sonntag 2017-10-07 18:28:02 +02:00
parent 08f5d9b15c
commit c4da8edf90
2 changed files with 16 additions and 5 deletions

View File

@ -97,10 +97,7 @@ if ($r[Rights] == 'All') {
</tr> </tr>
<tr> <tr>
<td colspan="2" align="center"> <td colspan="2" align="center">
<a href="/sql_pma_sso.php" target="_blank"><?php __("Web interface PhpMyAdmin"); ?></a> <a href="/sql_pma_sso.php?db=<?php echo $dbname; ?>" target="_blank"><?php __("Click here to access PhpMyAdmin interface"); ?></a>
<p>
<code>http://<?php echo $L_FQDN; ?>/alternc-sql/</code>
</p>
</td> </td>
</tr> </tr>
<?php <?php

View File

@ -29,6 +29,12 @@
*/ */
require_once("../class/config.php"); require_once("../class/config.php");
$fields = array (
"id" => array ("request", "string", ""),
);
getFields($fields);
if ($r=$mysql->php_myadmin_connect()) { if ($r=$mysql->php_myadmin_connect()) {
// SSO of PhpMyAdmin // SSO of PhpMyAdmin
$_SESSION['PMA_single_signon_user'] = $r["login"]; $_SESSION['PMA_single_signon_user'] = $r["login"];
@ -39,8 +45,16 @@ if ($r=$mysql->php_myadmin_connect()) {
// Forget any standard phpmyadmin session // Forget any standard phpmyadmin session
setcookie("phpMyAdmin", "", time() - 3600); setcookie("phpMyAdmin", "", time() - 3600);
if ($id!="") {
$r=$mysql->get_mysql_details($id);
if ($r) {
$db="?db=".$id;
}
} else {
$db="";
}
// finally redirect to phpMyAdmin : // finally redirect to phpMyAdmin :
header("Location: /alternc-sql/index.php"); header("Location: /alternc-sql/index.php".$db);
exit(); exit();
} }