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"]); } }
treeview - TreeView browser plugin for GLPI Copyright (C) 2003-2012 by the treeview Development Team. https://forge.indepnet.net/projects/treeview ------------------------------------------------------------------------- LICENSE This file is part of treeview. treeview is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. treeview is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with treeview. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ include '../../../inc/includes.php'; $pref = new PluginTreeviewPreference(); //Save user preferences if (isset($_POST['plugin_treeview_user_preferences_save'])) { $pref->update($_POST); Html::back(); }
/** * 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"]); } }