API crash with GLPI 9.4.5
rk4an opened this issue · 8 comments
Hi,
This plugin crash the GLPI API: glpi-project/glpi#7161
At first request with a new session-token we get a redirect to auth page from /var/www/html/glpi/plugins/mydashboard/front/menu.php
Thanks
Hello which version ? Can you try with 1.7.7 version ?
We already have 1.7.7 version
Can you try to change this line :
Line 90 in 9c0b463
if (isset($_SERVER['HTTP_REFERER'])
&& strpos($_SERVER['HTTP_REFERER'], 'redirect') !== false
&& strpos($_SERVER['REQUEST_URI'], 'apirest.php') === false) {
$_SESSION["glpi_plugin_mydashboard_loaded"] = 1;
}
I already have this portion of code in this file and line number.
It same that #75 (who was closed but no fix)
Tell me what test I can do to help you.
Thanks,
For test, if you comment
Line 93 in 9c0b463
/*
if (isset($_SESSION["glpi_plugin_mydashboard_loaded"])
&& $_SESSION["glpi_plugin_mydashboard_loaded"] == 0) {
if (strpos($_SERVER['REQUEST_URI'], 'central.php?redirect') === false) {
if(Session::getCurrentInterface() == 'central'){
if (!$_SESSION['glpiactiveprofile']['create_ticket_on_login']) {
$_SESSION["glpi_plugin_mydashboard_loaded"] = 1;
Html::redirect($CFG_GLPI['root_doc'] . "/plugins/mydashboard/front/menu.php");
} else if (!$plugin->isActivated("servicecatalog")
|| Session::haveRight("plugin_servicecatalog", 1)) {
$_SESSION["glpi_plugin_mydashboard_loaded"] = 1;
Html::redirect($CFG_GLPI['root_doc'] . "/plugins/mydashboard/front/menu.php");
} else if (!$_SESSION['glpiactiveprofile']['create_ticket_on_login']) {
$_SESSION["glpi_plugin_mydashboard_loaded"] = 1;
Html::redirect($CFG_GLPI['root_doc'] . "/plugins/mydashboard/front/menu.php");
}
}
}
}*/
It's OK ?
Yes it works if the code is comment
Have you in your preferences Mydashboard : Replace central interface to Yes ?
If yes can you uncomment & unactivate it into preferences & test ?
I just apply your last commit and all works now, thanks!