diff --git a/include/class_pluglist.inc b/include/class_pluglist.inc index 99b917fad3a04c896f558178cff4458a0e63f2a7..8001859cac45485381c65e77dfc5932ecd806647 100644 --- a/include/class_pluglist.inc +++ b/include/class_pluglist.inc @@ -1,9 +1,8 @@ <?php - /* This code is part of FusionDirectory (http://www.fusiondirectory.org/) Copyright (C) 2003-2010 Cajus Pollmeier - Copyright (C) 2011-2016 FusionDirectory + Copyright (C) 2011-2019 FusionDirectory This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,9 +32,8 @@ */ class pluglist { - var $menu = ""; - var $iconmenu = ""; - var $current = ""; + var $menu = ''; + protected $iconmenu = ''; /*! * \brief The plInfo result for all plugin, using class as key. @@ -56,8 +54,8 @@ class pluglist /*! * \brief List plugin indexes of all plugin that the user have acl for */ - var $allowed_plugins = []; - var $silly_cache = []; + protected $allowed_plugins = []; + protected $silly_cache = []; /*! * \brief List the plugins @@ -506,6 +504,19 @@ class pluglist return isset($this->allowed_plugins[$plug_id]); } + /*! + * \brief Resets menu and ACL cache + * + * Called when user ACL rights may have changed + */ + public function resetCache () + { + $this->menu = ''; + $this->iconmenu = ''; + $this->silly_cache = []; + $this->allowed_plugins = []; + } + static function pluginInfos ($cname) { $plist = session::get('plist'); diff --git a/include/class_userinfo.inc b/include/class_userinfo.inc index eeeef4a09271730ba267448b8c8b78d47702f625..ed3d9dea23b3a25dd544f7e54de7b82debdf6c2b 100644 --- a/include/class_userinfo.inc +++ b/include/class_userinfo.inc @@ -129,7 +129,8 @@ class userinfo */ function loadACL () { - global $config; + global $config, $plist; + $this->ACL = []; $this->groups = []; $this->roles = []; @@ -330,6 +331,11 @@ class userinfo if (isset($all_acl[$dn])) { $this->ACLperPath[$this->dn] = $all_acl[$dn]; } + + /* Reset plist menu and ACL cache if needed */ + if (is_object($plist)) { + $plist->resetCache(); + } } /*!