Exemple #1
0
 @copyright Copyright (c) 2010-2013 Uninstall plugin team
 @license   GPLv2+
            http://www.gnu.org/licenses/gpl.txt
 @link      https://forge.indepnet.net/projects/uninstall
 @link      http://www.glpi-project.org/
 @since     2009
 ---------------------------------------------------------------------- */
include '../../../inc/includes.php';
Html::header(__('Transfer'), $_SERVER['PHP_SELF'], "admin", "transfer");
if (!isset($_REQUEST["device_type"]) || !isset($_REQUEST["model_id"]) || $_REQUEST["model_id"] == 0) {
    Html::back();
}
if (isset($_REQUEST["locations_id"])) {
    $location = $_REQUEST["locations_id"];
} else {
    $location = PluginUninstallPreference::getLocationByUserByEntity($_SESSION["glpiID"], $_REQUEST["model_id"], $_SESSION["glpiactive_entity"]);
}
if (isset($_REQUEST["replace"])) {
    PluginUninstallReplace::replace($_REQUEST["device_type"], $_REQUEST["model_id"], $_REQUEST['newItems'], $location);
    unset($_SESSION['glpi_uninstalllist']);
    Session::addMessageAfterRedirect(__('Replacement successful', 'uninstall'));
    Html::footer();
    $device_type = $_REQUEST["device_type"];
    Html::redirect($device_type::getSearchURL());
}
$model = new PluginUninstallModel();
$model->getConfig($_REQUEST["model_id"]);
//Case of a uninstallation initiated from the object form
if (isset($_REQUEST["uninstall"])) {
    //Uninstall only if a model is selected
    if ($model->fields['types_id'] == PluginUninstallModel::TYPE_MODEL_UNINSTALL) {
 Uninstall plugin 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.

 Uninstall plugin 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 uninstall. If not, see <http://www.gnu.org/licenses/>.
 --------------------------------------------------------------------------
 @package   uninstall
 @author    the uninstall plugin team
 @copyright Copyright (c) 2010-2013 Uninstall plugin team
 @license   GPLv2+
            http://www.gnu.org/licenses/gpl.txt
 @link      https://forge.indepnet.net/projects/uninstall
 @link      http://www.glpi-project.org/
 @since     2009
 ---------------------------------------------------------------------- */
include '../../../inc/includes.php';
// Save user preferences
if (isset($_POST['update_user_preferences_uninstall'])) {
    $pref = new PluginUninstallPreference();
    foreach ($_POST["id"] as $prefid => $values) {
        $pref->update($values);
    }
    Html::back();
}
Exemple #3
0
 This file is part of the uninstall plugin.

 Uninstall plugin 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.

 Uninstall plugin 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 uninstall. If not, see <http://www.gnu.org/licenses/>.
 --------------------------------------------------------------------------
 @package   uninstall
 @author    the uninstall plugin team
 @copyright Copyright (c) 2010-2013 Uninstall plugin team
 @license   GPLv2+
            http://www.gnu.org/licenses/gpl.txt
 @link      https://forge.indepnet.net/projects/uninstall
 @link      http://www.glpi-project.org/
 @since     2009
 ---------------------------------------------------------------------- */
include '../../../inc/includes.php';
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
if (Session::haveRight(PluginUninstallProfile::$rightname, READ) && $_POST['templates_id']) {
    $location = PluginUninstallPreference::getLocationByUserByEntity($_POST["users_id"], $_POST["templates_id"], $_POST["entity"]);
    Location::dropdown(array('value' => $location == '' ? 0 : $location, 'comments' => 1, 'entity' => $_POST["entity"], 'toadd' => array(-1 => __('Keep previous location', 'uninstall'), 0 => __('Empty location', 'uninstall'))));
}
 function cleanDBonPurge()
 {
     PluginUninstallPreference::deleteUserPreferenceForModel($this->fields['id']);
 }
Exemple #5
0
function plugin_uninstall_uninstall()
{
    require_once GLPI_ROOT . "/plugins/uninstall/inc/uninstall.class.php";
    require_once GLPI_ROOT . "/plugins/uninstall/inc/profile.class.php";
    require_once GLPI_ROOT . "/plugins/uninstall/inc/preference.class.php";
    require_once GLPI_ROOT . "/plugins/uninstall/inc/model.class.php";
    require_once GLPI_ROOT . "/plugins/uninstall/inc/replace.class.php";
    PluginUninstallProfile::uninstall();
    PluginUninstallModel::uninstall();
    PluginUninstallPreference::uninstall();
    return true;
}