Commit 4ec236fe authored by Étienne Loks's avatar Étienne Loks

When reaching "/" if current profile is not the default return the default (refs #70644)

parent d5835317
Pipeline #4340 failed with stage
......@@ -199,12 +199,16 @@ class Class_Profil extends Storm_Model_Abstract {
* @return Class_Profil
*/
public static function getCurrentProfil() {
if (isset(self::$_current_profil))
return self::$_current_profil;
if (!Zend_Registry::isRegistered('session')
|| (!$id_profil = Zend_Registry::get('session')->id_profil))
if (isset(self::$_current_profil)){
if (self::$_current_profil->id != 1 && $_SERVER['REQUEST_URI'] == "/")
$id_profil = 1;
else
return self::$_current_profil;
}
else if (!Zend_Registry::isRegistered('session')
|| (!$id_profil = Zend_Registry::get('session')->id_profil)) {
$id_profil = 1;
}
return self::$_current_profil = self::getLoader()->find($id_profil);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment