diff --git a/inc/config.class.php b/inc/config.class.php index d70d938..eb53c18 100644 --- a/inc/config.class.php +++ b/inc/config.class.php @@ -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; + }); + "); + } } diff --git a/setup.php b/setup.php index aed115d..20fb27d 100644 --- a/setup.php +++ b/setup.php @@ -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" + ]; + } }