Adminer: Fix and simplify previous auto-login feature (controlled by Default Setting).

This commit is contained in:
reliberate
2016-06-09 14:13:10 -06:00
parent 227e7900ab
commit bf03b763ea
4 changed files with 76 additions and 8 deletions

View File

@@ -453,13 +453,17 @@
echo "<ul class='dropdown-menu'>\n";
foreach ($menu_parent['menu_items'] as $index_sub => $menu_sub) {
$mod_a_2 = $menu_sub['menu_item_link'];
if($mod_a_2 == ''){
if ($mod_a_2 == '') {
$mod_a_2 = '#';
}
else if (($menu_sub['menu_item_category'] == 'internal') ||
(($menu_sub['menu_item_category'] == 'external') && substr($mod_a_2, 0,1) == "/"))
{
$mod_a_2 = PROJECT_PATH . $mod_a_2;
else if (($menu_sub['menu_item_category'] == 'internal') || (($menu_sub['menu_item_category'] == 'external') && substr($mod_a_2,0,1) == '/')) {
// accomodate adminer auto-login, if enabled
if (substr($mod_a_2,0,22) == '/app/adminer/index.php') {
global $db_type;
$mod_a_2 .= '?'.(($db_type == 'mysql') ? 'server' : $db_type).'&db=fusionpbx&ns=public';
$mod_a_2 .= ($_SESSION['adminer']['auto_login']['boolean'] == 'true') ? "&username=auto" : null;
}
$mod_a_2 = PROJECT_PATH.$mod_a_2;
}
$mod_a_3 = ($menu_sub['menu_item_category'] == 'external') ? "target='_blank' " : null;
if ($_SESSION['theme']['menu_sub_icons']['boolean'] != 'false') {