static function changeProfile() { $prof = new self(); if ($prof->getFromDB($_SESSION['glpiactiveprofile']['id'])) { $_SESSION["glpi_plugin_treeview_profile"] = $prof->fields; } else { unset($_SESSION["glpi_plugin_treeview_profile"]); } // require 'preference.class.php'; $Pref = new PluginTreeviewPreference(); $pref_value = $Pref->checkPreferenceValue(Session::getLoginUserID()); if ($pref_value == 1) { $_SESSION["glpi_plugin_treeview_preference"] = 1; } else { unset($_SESSION["glpi_plugin_treeview_preference"]); } }
/** * Initialize profiles, and migrate it necessary */ static function changeProfile() { global $DB; foreach ($DB->request("SELECT *\n FROM `glpi_profilerights` \n WHERE `profiles_id`='" . $_SESSION['glpiactiveprofile']['id'] . "' \n AND `name` LIKE '%plugin_treeview%'") as $prof) { $_SESSION['glpiactiveprofile'][$prof['name']] = $prof['rights']; } // require 'preference.class.php'; $Pref = new PluginTreeviewPreference(); $pref_value = $Pref->checkPreferenceValue(Session::getLoginUserID()); if ($pref_value == 1) { $_SESSION["glpi_plugin_treeview_preference"] = 1; } else { unset($_SESSION["glpi_plugin_treeview_preference"]); } }