Copyright (C) 2003-2013 by the appliances Development Team. https://forge.indepnet.net/projects/appliances ------------------------------------------------------------------------- LICENSE This file is part of appliances. appliances 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. appliances 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 appliances. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ include "../../../inc/includes.php"; Session::checkRight("profile", "r"); $prof = new PluginAppliancesProfile(); //Save profile if (isset($_POST['update_user_profile'])) { $prof->update($_POST); Html::back(); }
function plugin_appliances_install() { global $DB; if (TableExists("glpi_plugin_applicatifs_profiles")) { if (FieldExists("glpi_plugin_applicatifs_profiles", "create_applicatifs")) { // version <1.3 $DB->runFile(GLPI_ROOT . "/plugins/appliances/sql/update-1.3.sql"); } } if (TableExists("glpi_plugin_applicatifs")) { if (!FieldExists("glpi_plugin_applicatifs", "recursive")) { // version 1.3 $DB->runFile(GLPI_ROOT . "/plugins/appliances/sql/update-1.4.sql"); } if (!FieldExists("glpi_plugin_applicatifs", "FK_groups")) { // version 1.4 $DB->runFile(GLPI_ROOT . "/plugins/appliances/sql/update-1.5.0.sql"); } if (!FieldExists("glpi_plugin_applicatifs", "helpdesk_visible")) { // version 1.5.0 $DB->runFile(GLPI_ROOT . "/plugins/appliances/sql/update-1.5.1.sql"); } if (FieldExists("glpi_plugin_applicatifs", "state")) { // empty 1.5.0 not in update 1.5.0 $DB->query("ALTER TABLE `glpi_plugin_applicatifs` DROP `state`"); } if (isIndex("glpi_plugin_applicatifs_optvalues_machines", "optvalue_ID")) { // in empty 1.5.0 not in update 1.5.0 $DB->query("ALTER TABLE `glpi_plugin_applicatifs_optvalues_machines`\n DROP KEY `optvalue_ID`"); } $DB->runFile(GLPI_ROOT . "/plugins/appliances/sql/update-1.6.0.sql"); Plugin::migrateItemType(array(1200 => 'PluginAppliancesAppliance'), array("glpi_bookmarks", "glpi_bookmarks_users", "glpi_displaypreferences", "glpi_documents_items", "glpi_infocoms", "glpi_logs", "glpi_tickets"), array("glpi_plugin_appliances_appliances_items", "glpi_plugin_appliances_optvalues_items")); Plugin::migrateItemType(array(4450 => "PluginRacksRack"), array("glpi_plugin_appliances_appliances_items")); } if (!TableExists("glpi_plugin_appliances_appliances")) { // not installed $DB->runFile(GLPI_ROOT . '/plugins/appliances/sql/empty-1.8.0.sql'); } else { $migration = new Migration(180); include_once GLPI_ROOT . "/plugins/appliances/inc/appliance.class.php"; PluginAppliancesAppliance::updateSchema($migration); $migration->executeMigration(); } // required cause autoload don't work for unactive plugin' include_once GLPI_ROOT . "/plugins/appliances/inc/profile.class.php"; PluginAppliancesProfile::createAdminAccess($_SESSION['glpiactiveprofile']['id']); return true; }