Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions inc/config.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -563,4 +563,18 @@ function getNodesFromDb() {
echo "d.openTo(" .$nodes[count($nodes)-1]. ");\n";
}
}


/**
* Make sure that GLPI index page location is on top of window hierarchy
*/
public static function loginPageToTop() {
echo HTML::scriptBlock("
$(document).ready(
function() {
if (top != self)
top.location = self.location;
});
");
}
}
8 changes: 8 additions & 0 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ function plugin_init_treeview() {
if (Session::haveRight("config", UPDATE) || Session::haveRight("profile", UPDATE)) {
$PLUGIN_HOOKS['config_page']['treeview'] = 'front/config.form.php';
}

$currentPage = explode("/", $_SERVER['PHP_SELF']);
if (array_pop($currentPage) == "index.php") {
$PLUGIN_HOOKS['display_login']['treeview'] = [
"PluginTreeviewConfig",
"loginPageToTop"
];
}
}


Expand Down