mise à jour ansible glpi

This commit is contained in:
lucas.dubief
2022-02-11 15:48:06 +01:00
parent 3bae0bc39a
commit 9ddd78ea91
1017 changed files with 394347 additions and 0 deletions

View File

@@ -0,0 +1,92 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the agent form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
$agent = new PluginFusioninventoryAgent();
Session::checkRight('plugin_fusioninventory_agent', READ);
if (isset ($_POST["update"])) {
Session::checkRight('plugin_fusioninventory_agent', UPDATE);
if (isset($_POST['items_id'])) {
if (($_POST['items_id'] != "0") AND ($_POST['items_id'] != "")) {
$_POST['itemtype'] = '1';
}
}
$agent->update($_POST);
Html::back();
} else if (isset ($_POST["purge"])) {
Session::checkRight('plugin_fusioninventory_agent', PURGE);
$agent->delete($_POST, true);
$agent->redirectToList();
} else if (isset ($_POST["disconnect"])) {
Session::checkRight('plugin_fusioninventory_agent', UPDATE);
$agent->disconnect($_POST);
Html::back();
}
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"], "admin",
"pluginfusioninventorymenu", "agent");
PluginFusioninventoryMenu::displayMenu("mini");
if (isset($_GET["id"])) {
$agent->display(
[
"id" => $_GET["id"]
]
);
} else {
$agent->display(
[
"id" => 0
]
);
}
Html::footer();

View File

@@ -0,0 +1,59 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the agent search list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"], "admin",
"pluginfusioninventorymenu", "agent");
Session::checkRight('plugin_fusioninventory_agent', READ);
PluginFusioninventoryMenu::displayMenu("mini");
Search::show('PluginFusioninventoryAgent');
Html::footer();

View File

@@ -0,0 +1,137 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the agent module form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"], "admin",
"fusioninventory", "agentmodules");
Session::checkRight('plugin_fusioninventory_agent', READ);
$agentmodule = new PluginFusioninventoryAgentmodule();
if (isset($_POST["agent_add"])) {
$agentmodule->getFromDB($_POST['id']);
$a_agentList = importArrayFromDB($agentmodule->fields['exceptions']);
$a_agentList[] = $_POST['agent_to_add'][0];
$input = [];
$input['exceptions'] = exportArrayToDB($a_agentList);
$input['id'] = $_POST['id'];
$agentmodule->update($input);
Html::back();
} else if (isset($_POST["agent_delete"])) {
$agentmodule->getFromDB($_POST['id']);
$a_agentList = importArrayFromDB($agentmodule->fields['exceptions']);
foreach ($a_agentList as $key=>$value) {
if ($value == $_POST['agent_to_delete'][0]) {
unset($a_agentList[$key]);
}
}
$input = [];
$input['exceptions'] = exportArrayToDB($a_agentList);
$input['id'] = $_POST['id'];
$agentmodule->update($input);
Html::back();
} else if (isset ($_POST["updateexceptions"])) {
$a_modules = $agentmodule->find();
foreach ($a_modules as $data) {
$a_agentList = importArrayFromDB($data['exceptions']);
$agentModule = 0;
if (isset($_POST['activation-'.$data['modulename']])
&& $_POST['activation-'.$data['modulename']] != 0) {
$agentModule = 1;
}
$agentModuleBase = 0;
if (in_array($_POST['id'], $a_agentList)) {
$agentModuleBase = 1;
}
if ($data['is_active'] == 0) {
if (($agentModule == 1) AND ($agentModuleBase == 0)) {
$a_agentList[] = $_POST['id'];
} else if (($agentModule == 0) AND ($agentModuleBase == 1)) {
foreach ($a_agentList as $key=>$value) {
if ($value == $_POST['id']) {
unset($a_agentList[$key]);
}
}
}
} else if ($data['is_active'] == 1) {
if (($agentModule == 1) AND ($agentModuleBase == 1)) {
foreach ($a_agentList as $key=>$value) {
if ($value == $_POST['id']) {
unset($a_agentList[$key]);
}
}
} else if (($agentModule == 0) AND ($agentModuleBase == 0)) {
$a_agentList[] = $_POST['id'];
}
}
$data['exceptions'] = exportArrayToDB($a_agentList);
$agentmodule->update($data);
}
Html::back();
} else if (isset ($_POST["update"])) {
$agentmodule->getFromDB($_POST['id']);
$input = [];
if (isset($_POST['activation'])
&& $_POST['activation']) {
$input['is_active'] = 1;
} else {
$input['is_active'] = 0;
}
if ($agentmodule->fields['is_active'] != $input['is_active']) {
$a_agentList = [];
$input['exceptions'] = exportArrayToDB($a_agentList);
}
$input['id'] = $_POST['id'];
$agentmodule->update($input);
Html::back();
}
Html::footer();

View File

@@ -0,0 +1,77 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the collect form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('Collect management', 'fusioninventory'),
$_SERVER["PHP_SELF"],
"admin",
"pluginfusioninventorymenu",
"collect");
$pfCollect = new PluginFusioninventoryCollect();
if (isset($_POST["add"])) {
$collects_id = $pfCollect->add($_POST);
Html::redirect(Toolbox::getItemTypeFormURL('PluginFusioninventoryCollect').
"?id=".$collects_id);
} else if (isset($_POST["update"])) {
$pfCollect->update($_POST);
Html::back();
} else if (isset($_REQUEST["purge"])) {
$pfCollect->delete($_POST);
$pfCollect->redirectToList();
}
PluginFusioninventoryMenu::displayMenu("mini");
if (!isset($_GET["id"])) {
$_GET['id'] = '';
}
$pfCollect->display($_GET);
Html::footer();

View File

@@ -0,0 +1,62 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the collect search list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'),
$_SERVER["PHP_SELF"],
"admin",
"pluginfusioninventorymenu",
"collect");
Session::checkRight("plugin_fusioninventory_collect", READ);
PluginFusioninventoryMenu::displayMenu("mini");
Search::show('PluginFusioninventoryCollect');
Html::footer();

View File

@@ -0,0 +1,75 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the collect file form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
$pfCollect_File = new PluginFusioninventoryCollect_File();
if (isset($_POST["add"])) {
// conversions
if ($_POST['sizetype'] != 'none'
&& $_POST['size'] != '') {
$_POST['filter_size'.$_POST['sizetype']] = $_POST['size'];
}
if ($_POST['filter_nametype'] != 'none'
&& $_POST['filter_name'] != '') {
$_POST['filter_'.$_POST['filter_nametype']] = $_POST['filter_name'];
}
if ($_POST['type'] == 'file') {
$_POST['filter_is_file'] = 1;
$_POST['filter_is_dir'] = 0;
} else {
$_POST['filter_is_file'] = 0;
$_POST['filter_is_dir'] = 1;
}
$pfCollect_File->add($_POST);
Html::back();
} else if (isset($_POST["delete_x"])) {
$pfCollect_File->delete($_POST);
Html::back();
}

View File

@@ -0,0 +1,65 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the collect registry form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
$pfCollect_Registry = new PluginFusioninventoryCollect_Registry();
if (isset($_POST["add"])) {
if (!preg_match('/^\/()/', $_POST['path'])) {
$_POST['path'] = "/".$_POST['path'];
}
if (!preg_match('/\/$/', $_POST['path'])) {
$_POST['path'] = $_POST['path']."/";
}
$pfCollect_Registry->add($_POST);
Html::back();
} else if (isset($_POST["delete_x"])) {
$pfCollect_Registry->delete($_POST);
Html::back();
}

View File

@@ -0,0 +1,58 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the collect WMI form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
$pfCollect_Wmi = new PluginFusioninventoryCollect_Wmi();
if (isset($_POST["add"])) {
$pfCollect_Wmi->add($_POST);
Html::back();
} else if (isset($_POST["delete_x"])) {
$pfCollect_Wmi->delete($_POST);
Html::back();
}

View File

@@ -0,0 +1,61 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the collect rules form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'),
$_SERVER["PHP_SELF"],
"plugins",
"pluginfusioninventorymenu",
"collectrule");
Session::checkLoginUser();
PluginFusioninventoryMenu::displayMenu("mini");
$rulecollection = new PluginFusioninventoryCollectRuleCollection();
include (GLPI_ROOT . "/front/rule.common.form.php");

View File

@@ -0,0 +1,63 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the collect rules list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkLoginUser();
Html::header(__('FusionInventory', 'fusioninventory'),
$_SERVER["PHP_SELF"],
"admin",
"pluginfusioninventorymenu",
"collectrule");
PluginFusioninventoryMenu::displayMenu("mini");
RuleCollection::titleBackup();
$rulecollection = new PluginFusioninventoryCollectRuleCollection();
include (GLPI_ROOT . "/front/rule.common.php");

View File

@@ -0,0 +1,96 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the communication with the agent.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Vincent Mazzoni
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
ob_start();
ini_set("memory_limit", "-1");
ini_set("max_execution_time", "0");
ini_set('display_errors', 1);
if (session_id()=="") {
session_start();
}
if (!defined('GLPI_ROOT')) {
include_once("../../../inc/includes.php");
}
$_SESSION['glpi_use_mode'] = Session::NORMAL_MODE;
if (!isset($_SESSION['glpilanguage'])) {
$_SESSION['glpilanguage'] = 'fr_FR';
}
$_SESSION['glpi_fusionionventory_nolock'] = true;
ini_set('display_errors', 'On');
error_reporting(E_ALL | E_STRICT);
$_SESSION['glpi_use_mode'] = 0;
$_SESSION['glpiparententities'] = '';
$_SESSION['glpishowallentities'] = true;
ob_end_clean();
header("server-type: glpi/fusioninventory ".PLUGIN_FUSIONINVENTORY_VERSION);
if (!class_exists("PluginFusioninventoryConfig")) {
header("Content-Type: application/xml");
echo "<?xml version='1.0' encoding='UTF-8'?>
<REPLY>
<ERROR>Plugin FusionInventory not installed!</ERROR>
</REPLY>";
session_destroy();
exit();
}
$pfCommunication = new PluginFusioninventoryCommunication();
if (!isset($rawdata)) {
$rawdata = file_get_contents("php://input");
}
if (isset($_GET['action']) && isset($_GET['machineid'])) {
PluginFusioninventoryCommunicationRest::handleFusionCommunication();
} else if (!empty($rawdata)) {
$pfCommunication->handleOCSCommunication($rawdata);
}
session_destroy();

View File

@@ -0,0 +1,59 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the computer entity lock configuration form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
if (isset($_GET['id'])
&& isset($_GET['lock'])) {
$pfInventoryComputerComputer = new PluginFusioninventoryInventoryComputerComputer();
$input = [];
$input['id'] = $_GET['id'];
$input['is_entitylocked'] = $_GET['lock'];
$pfInventoryComputerComputer->update($input);
}
Html::back();

View File

@@ -0,0 +1,60 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the computer license info form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Vincent Mazzoni
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkRight('license', UPDATE);
if (isset($_POST['associate']) && is_array($_POST['associate'])) {
$pflicenseinfo = new PluginFusioninventoryComputerLicenseInfo();
$pflicenseinfo->associate($_POST);
} else if (isset($_POST['dissociate']) && is_array($_POST['dissociate'])) {
$pflicenseinfo = new PluginFusioninventoryComputerLicenseInfo();
$pflicenseinfo->dissociate($_POST);
}
Html::back();

View File

@@ -0,0 +1,80 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the general configuration form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Vincent Mazzoni
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkRight('plugin_fusioninventory_configuration', READ);
Html::header(__('Features', 'fusioninventory'), $_SERVER["PHP_SELF"],
"admin", "pluginfusioninventorymenu", "config");
PluginFusioninventoryMenu::displayMenu("mini");
$pfConfig = new PluginFusioninventoryConfig();
if (isset($_POST['update'])) {
$data = $_POST;
unset($data['update']);
unset($data['id']);
unset($data['_glpi_csrf_token']);
foreach ($data as $key=>$value) {
$pfConfig->updateValue($key, $value);
}
Html::back();
}
$a_config = current($pfConfig->find([], [], 1));
$pfConfig->getFromDB($a_config['id']);
if (isset($_GET['glpi_tab'])) {
$_SESSION['glpi_tabs']['pluginfusioninventoryconfiguration'] = $_GET['glpi_tab'];
Html::redirect(Toolbox::getItemTypeFormURL($pfConfig->getType()));
}
$pfConfig->display();
Html::footer();

View File

@@ -0,0 +1,92 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the configuration log fields form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkRight('config', UPDATE);
Html::header(__('Features', 'fusioninventory'), $_SERVER["PHP_SELF"], "admin",
"pluginfusioninventorymenu", "configlogfield");
if (isset($_POST['update'])) {
if (empty($_POST['cleaning_days'])) {
$_POST['cleaning_days'] = 0;
}
$_POST['id']=1;
switch ($_POST['tabs']) {
case 'config' :
break;
case 'history' :
$pfConfigLogField = new PluginFusioninventoryConfigLogField();
foreach ($_POST as $key=>$val) {
$split = explode("-", $key);
if (isset($split[1]) AND is_numeric($split[1])) {
$pfConfigLogField->getFromDB($split[1]);
$input = [];
$input['id'] = $pfConfigLogField->fields['id'];
$input['days'] = $val;
$pfConfigLogField->update($input);
}
}
break;
}
if (isset($pfConfig)) {
$pfConfig->update($_POST);
}
Html::back();
} else if ((isset($_POST['Clean_history']))) {
$pfNetworkPortLog = new PluginFusioninventoryNetworkPortLog();
$pfNetworkPortLog->cronCleannetworkportlogs();
Html::back();
}
Html::footer();

View File

@@ -0,0 +1,87 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the configuration security form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkRight('plugin_fusioninventory_configsecurity', READ);
$pfConfigSecurity = new PluginFusioninventoryConfigSecurity();
$config = new PluginFusioninventoryConfig();
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"], "admin",
"pluginfusioninventorymenu", "configsecurity");
PluginFusioninventoryMenu::displayMenu("mini");
if (isset ($_POST["add"])) {
Session::checkRight('plugin_fusioninventory_configsecurity', CREATE);
$new_ID = 0;
$new_ID = $pfConfigSecurity->add($_POST);
Html::back();
} else if (isset ($_POST["update"])) {
Session::checkRight('plugin_fusioninventory_configsecurity', UPDATE);
$pfConfigSecurity->update($_POST);
Html::back();
} else if (isset ($_POST["delete"])) {
Session::checkRight('plugin_fusioninventory_configsecurity', PURGE);
$pfConfigSecurity->delete($_POST);
Html::redirect("configsecurity.php");
}
$id = "";
if (isset($_GET["id"])) {
$id = $_GET["id"];
}
if (strstr($_SERVER['HTTP_REFERER'], "wizard.php")) {
Html::redirect($_SERVER['HTTP_REFERER']."&id=".$id);
}
$pfConfigSecurity->showForm($id);
Html::footer();

View File

@@ -0,0 +1,61 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the configuration security search list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"],
"admin", "pluginfusioninventorymenu", "configsecurity");
Session::checkRight('plugin_fusioninventory_configsecurity', READ);
PluginFusioninventoryMenu::displayMenu("mini");
$_GET['target']="configsecurity.php";
Search::show('PluginFusioninventoryConfigSecurity');
Html::footer();

View File

@@ -0,0 +1,56 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the ESX credential form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Walid Nouh
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
$dropdown = new PluginFusioninventoryCredential();
include (GLPI_ROOT . "/front/dropdown.common.form.php");
if (isset($_GET['popup'])) {
Ajax::refreshDropdownPopupInMainWindow();
}

View File

@@ -0,0 +1,52 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the ESX credential search list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Walid Nouh
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
$dropdown = new PluginFusioninventoryCredential();
include (GLPI_ROOT . "/front/dropdown.common.php");

View File

@@ -0,0 +1,54 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the ESX server form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Walid Nouh
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
$dropdown = new PluginFusioninventoryCredentialIp();
if (empty($_POST['plugin_fusioninventory_credentials_id'])) {
$_POST['plugin_fusioninventory_credentials_id'] = -1;
}
include (GLPI_ROOT . "/front/dropdown.common.form.php");

View File

@@ -0,0 +1,51 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the ESX server search list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Walid Nouh
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
$dropdown = new PluginFusioninventoryCredentialIp();
include (GLPI_ROOT . "/front/dropdown.common.php");

View File

@@ -0,0 +1,72 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to clean the unused deploy files.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Alexandre Delaunay
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkLoginUser();
Session::checkRight('plugin_fusioninventory_package', PURGE);
Html::header(__('FusionInventory DEPLOY'), $_SERVER["PHP_SELF"], "admin",
"pluginfusioninventorymenu", "deploypackage");
$pfDeployfile = new PluginFusioninventoryDeployFile();
if (isset($_GET['delete'])) {
$pfDeployfile->deleteUnusedFiles();
Html::back();
}
PluginFusioninventoryMenu::displayMenu("mini");
$pfDeployfile->numberUnusedFiles();
echo "<center>";
echo "<a href='".$_SERVER['PHP_SELF']."?delete=1' class='vsubmit'>Delete unused files</a>";
echo "</center>";
Html::footer();

View File

@@ -0,0 +1,125 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the deploy group form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Alexandre Delaunay
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkLoginUser();
$group = new PluginFusioninventoryDeployGroup();
if (isset($_GET['plugin_fusioninventory_deploygroups_id'])) {
$_SESSION['glpisearch']['PluginFusioninventoryComputer'] = $_GET;
}
if (isset($_GET['save'])) {
$group_item = new PluginFusioninventoryDeployGroup_Dynamicdata();
if (!countElementsInTable($group_item->getTable(),
['plugin_fusioninventory_deploygroups_id' => $_GET['id']])) {
$criteria = ['criteria' => $_GET['criteria'],
'metacriteria' => $_GET['metacriteria']];
$values['fields_array'] = serialize($criteria);
$values['plugin_fusioninventory_deploygroups_id'] = $_GET['id'];
$group_item->add($values);
} else {
$item = getAllDataFromTable($group_item->getTable(),
['plugin_fusioninventory_deploygroups_id' => $_GET['id']]);
$values = array_pop($item);
$criteria = ['criteria' => $_GET['criteria'],
'metacriteria' => $_GET['metacriteria']];
$values['fields_array'] = serialize($criteria);
$group_item->update($values);
}
Html::redirect(Toolbox::getItemTypeFormURL("PluginFusioninventoryDeployGroup")."?id=".$_GET['id']);
} else if (isset($_FILES['importcsvfile'])) {
PluginFusioninventoryDeployGroup_Staticdata::csvImport($_POST, $_FILES);
Html::back();
} else if (isset($_POST["add"])) {
$group->check(-1, UPDATE, $_POST);
$newID = $group->add($_POST);
Html::redirect(Toolbox::getItemTypeFormURL("PluginFusioninventoryDeployGroup")."?id=".$newID);
} else if (isset($_POST["delete"])) {
// $group->check($_POST['id'], DELETE);
$ok = $group->delete($_POST);
$group->redirectToList();
} else if (isset($_POST["purge"])) {
// $group->check($_POST['id'], DELETE);
$ok = $group->delete($_REQUEST, 1);
$group->redirectToList();
} else if (isset($_POST["update"])) {
$group->check($_POST['id'], UPDATE);
$group->update($_POST);
Html::back();
} else {
Html::header(__('FusionInventory DEPLOY'), $_SERVER["PHP_SELF"], "admin",
"pluginfusioninventorymenu", "deploygroup");
PluginFusioninventoryMenu::displayMenu("mini");
$values = $_POST;
if (!isset($_GET['id'])) {
$id = '';
} else {
$id = $_GET['id'];
if (isset($_GET['sort']) AND isset($_GET['order'])) {
$group->getFromDB($id);
PluginFusioninventoryDeployGroup::getSearchParamsAsAnArray($group, true);
}
}
$values['id'] = $id;
if (isset($_GET['preview'])) {
$values['preview'] = $_GET['preview'];
}
$group->display($values);
Html::footer();
}

View File

@@ -0,0 +1,60 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the deploy group search list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Alexandre Delaunay
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkLoginUser();
Html::header(__('Groups of computers', 'fusioninventory'), $_SERVER["PHP_SELF"], "admin",
"pluginfusioninventorymenu", "deploygroup");
PluginFusioninventoryMenu::displayMenu("mini");
Search::show('PluginFusioninventoryDeployGroup');
Html::footer();

View File

@@ -0,0 +1,81 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the deploy mirror form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Alexandre Delaunay
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkLoginUser();
Html::header(__('Mirror servers'), $_SERVER["PHP_SELF"], "admin",
"pluginfusioninventorymenu", "deploymirror");
//PluginFusioninventoryProfile::checkRight("Fusioninventory", "agents", "r");
PluginFusioninventoryMenu::displayMenu("mini");
$mirror = new PluginFusioninventoryDeployMirror();
if (isset ($_POST["add"])) {
// PluginFusioninventoryProfile::checkRight("Fusinvdeloy", "package", "w");
$newID = $mirror->add($_POST);
Html::back();
} else if (isset ($_POST["update"])) {
// PluginFusioninventoryProfile::checkRight("Fusinvdeloy", "package", "w");
$mirror->update($_POST);
Html::back();
} else if (isset ($_POST["delete"])) {
// PluginFusioninventoryProfile::checkRight("Fusinvdeloy", "package", "w");
$mirror->delete($_POST);
Html::redirect(Toolbox::getItemTypeFormURL('PluginFusioninventoryDeployMirror'));
}
$id = "";
if (isset($_GET["id"])) {
$id = $_GET["id"];
}
$mirror->display(['id' => $id]);
//$mirror->showForm($id);
Html::footer();

View File

@@ -0,0 +1,60 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the deploy miror search list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Alexandre Delaunay
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkLoginUser();
Html::header(__('Mirror servers'), $_SERVER["PHP_SELF"], "admin",
"pluginfusioninventorymenu", "deploymirror");
//PluginFusioninventoryProfile::checkRight("Fusioninventory", "agents", "r");
PluginFusioninventoryMenu::displayMenu("mini");
Search::show('PluginFusioninventoryDeployMirror');
Html::footer();

View File

@@ -0,0 +1,140 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the deploy package form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Alexandre Delaunay
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkLoginUser();
$package = new PluginFusioninventoryDeployPackage();
if (isset($_POST['update_json'])) {
$json_clean = stripcslashes($_POST['json']);
$json = json_decode($json_clean, true);
$ret = PluginFusioninventoryDeployPackage::updateOrderJson($_POST['packages_id'], $json);
Html::back();
exit;
} else if (isset($_POST['add_item'])) {
$data = array_map(['Toolbox', 'stripslashes_deep'],
$package->escapeText($_POST));
PluginFusioninventoryDeployPackage::alterJSON('add_item', $data);
Html::back();
} else if (isset($_POST['save_item'])) {
$data = array_map(['Toolbox', 'stripslashes_deep'],
$package->escapeText($_POST));
PluginFusioninventoryDeployPackage::alterJSON('save_item', $data);
Html::back();
} else if (isset($_POST['remove_item'])) {
$data = array_map(['Toolbox', 'stripslashes_deep'],
$package->escapeText($_POST));
PluginFusioninventoryDeployPackage::alterJSON('remove_item', $data);
Html::back();
}
//$data = Toolbox::stripslashes_deep($_POST);
$data = $_POST;
//general form
if (isset ($data["add"])) {
Session::checkRight('plugin_fusioninventory_package', CREATE);
$newID = $package->add($data);
Html::redirect(Toolbox::getItemTypeFormURL('PluginFusioninventoryDeployPackage')."?id=".$newID);
} else if (isset ($data["update"])) {
Session::checkRight('plugin_fusioninventory_package', UPDATE);
$package->update($data);
Html::back();
} else if (isset ($data["purge"])) {
Session::checkRight('plugin_fusioninventory_package', PURGE);
$package->delete($data, 1);
$package->redirectToList();
} else if (isset($_POST["addvisibility"])) {
if (isset($_POST["_type"]) && !empty($_POST["_type"])
&& isset($_POST["plugin_fusioninventory_deploypackages_id"])
&& $_POST["plugin_fusioninventory_deploypackages_id"]) {
$item = null;
switch ($_POST["_type"]) {
case 'User' :
if (isset($_POST['users_id']) && $_POST['users_id']) {
$item = new PluginFusioninventoryDeployPackage_User();
}
break;
case 'Group' :
if (isset($_POST['groups_id']) && $_POST['groups_id']) {
$item = new PluginFusioninventoryDeployPackage_Group();
}
break;
case 'Profile' :
if (isset($_POST['profiles_id']) && $_POST['profiles_id']) {
$item = new PluginFusioninventoryDeployPackage_Profile();
}
break;
case 'Entity' :
$item = new PluginFusioninventoryDeployPackage_Entity();
break;
}
if (!is_null($item)) {
$item->add($_POST);
// Event::log($_POST["plugin_fusioninventory_deploypackages_id"], "sla", 4, "tools",
// //TRANS: %s is the user login
// sprintf(__('%s adds a target'), $_SESSION["glpiname"]));
}
}
Html::back();
}
Html::header(__('FusionInventory DEPLOY'), $_SERVER["PHP_SELF"], "admin",
"pluginfusioninventorymenu", "deploypackage");
PluginFusioninventoryMenu::displayMenu("mini");
$id = "";
if (isset($_GET["id"])) {
$id = $_GET["id"];
}
$package->display($_GET);
Html::footer();

View File

@@ -0,0 +1,69 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the deploy package import form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Alexandre Delaunay
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkLoginUser();
Session::checkRight('plugin_fusioninventory_package', CREATE);
Html::header(__('FusionInventory DEPLOY'), $_SERVER["PHP_SELF"], "admin",
"pluginfusioninventorymenu", "deploypackage");
$package = new PluginFusioninventoryDeployPackage();
if (isset($_POST['importfile'])) {
$package->importPackage($_POST['importfile']);
Html::back();
}
PluginFusioninventoryMenu::displayMenu("mini");
$package->listPackagesToImport();
Html::footer();

View File

@@ -0,0 +1,60 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the deploy package search list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Alexandre Delaunay
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkLoginUser();
Html::header(__('FusionInventory'), $_SERVER["PHP_SELF"], "admin",
"pluginfusioninventorymenu", "deploypackage");
PluginFusioninventoryMenu::displayMenu("mini");
$package = new PluginFusioninventoryDeployPackage();
$package->showList();
Html::footer();

View File

@@ -0,0 +1,95 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the deploy package self-service form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkLoginUser();
Html::helpHeader(__('FusionInventory'), $_SERVER["PHP_SELF"], "plugins",
"pluginfusioninventorymenu", "deploypackage");
$pfDeployPackage = new PluginFusioninventoryDeployPackage();
if (isset($_POST['prepareinstall'])) {
$computers_id = false;
foreach ($_POST as $key => $data) {
if (strstr($key, 'deploypackages_')) {
$computers_id = str_replace('deploypackages_', '', $key);
foreach ($data as $packages_id) {
$pfDeployPackage->deployToComputer($computers_id, $packages_id, $_SESSION['glpiID']);
}
}
}
//Try to wakeup the agent to perform the deployment task
//If it's a local wakeup, local call to the agent RPC service
switch ($_POST['wakeup_type']) {
case 'local':
echo '<link rel="import" href="http://127.0.0.1:62354/now">';
echo Html::scriptBlock("setTimeout(function(){
window.location='{$_SERVER['HTTP_REFERER']}';
}, 500);");
exit;
break;
case 'remote':
if ($computers_id) {
//Remote call to wakeup the agent, from the server
$agent = new PluginFusioninventoryAgent();
$agent->getAgentWithComputerid($computers_id);
$agent->wakeUp();
}
break;
default:
break;
}
Html::back();
} else {
Html::header(__('FusionInventory'), $_SERVER["PHP_SELF"], "plugins",
"pluginfusioninventorymenu", "deploypackage");
$pfDeployPackage->showPackageForMe($_SESSION['glpiID']);
Html::footer();
}

View File

@@ -0,0 +1,82 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the deploy package form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Walid Nouh
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkLoginUser();
if (!isset($_GET["id"])) {
$_GET["id"] = "";
}
$template = new PluginFusioninventoryDeployUserinteractionTemplate();
//general form
if (isset ($_POST["add"])) {
Session::checkRight('plugin_fusioninventory_userinteractiontemplate', CREATE);
$newID = $template->add($_POST);
Html::redirect($template->getFormURLWithID($newID));
} else if (isset ($_POST["update"])) {
Session::checkRight('plugin_fusioninventory_userinteractiontemplate', UPDATE);
$template->update($_POST);
Html::back();
} else if (isset ($_POST["purge"])) {
Session::checkRight('plugin_fusioninventory_userinteractiontemplate', PURGE);
$template->delete($_POST, 1);
$template->redirectToList();
}
if (isset($_GET['_in_modal']) && $_GET['_in_modal']) {
Html::nullHeader(__('FusionInventory DEPLOY'), $_SERVER["PHP_SELF"]);
} else {
Html::header(__('FusionInventory DEPLOY'), $_SERVER["PHP_SELF"], "admin",
"pluginfusioninventorymenu", "deployuserinteractiontemplate");
PluginFusioninventoryMenu::displayMenu("mini");
}
$template->display($_GET);
if (isset($_GET['_in_modal']) && $_GET['_in_modal']) {
Html::nullFooter();
} else {
Html::footer();
}

View File

@@ -0,0 +1,58 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the deploy group search list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Walid Nouh
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkLoginUser();
Html::header(__('User interaction template', 'fusioninventory'), $_SERVER["PHP_SELF"], "admin",
"pluginfusioninventorymenu", "deployuserinteractiontemplate");
PluginFusioninventoryMenu::displayMenu("mini");
Search::show('PluginFusioninventoryDeployUserinteractionTemplate');
Html::footer();

View File

@@ -0,0 +1,55 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the redirection to the documentation page.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"], "admin",
"pluginfusioninventorymenu", "documentation");
echo "<meta http-equiv='refresh' content='0;URL=http://fusioninventory.org/documentation/'>";
Html::footer();

View File

@@ -0,0 +1,61 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the entity form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
$pfEntity = new PluginFusioninventoryEntity();
if (isset($_POST["add"])) {
$pfEntity->add($_POST);
Html::back();
} else if (isset($_POST["update"])) {
$pfEntity->update($_POST);
Html::back();
} else if (isset($_REQUEST["purge"])) {
$pfEntity->delete($_POST);
Html::back();
}

View File

@@ -0,0 +1,59 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the ignored import device list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"], "admin",
"pluginfusioninventorymenu", "ignoredimportdevice");
//PluginFusioninventoryProfile::checkRight("rules", "r");
PluginFusioninventoryMenu::displayMenu("mini");
Search::show('PluginFusioninventoryIgnoredimportdevice');
Html::footer();

View File

@@ -0,0 +1,84 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the computer black list fields form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'),
$_SERVER["PHP_SELF"],
"admin",
"pluginfusioninventorymenu",
"inventorycomputerblacklist");
Session::checkRight('plugin_fusioninventory_blacklist', READ);
PluginFusioninventoryMenu::displayMenu("mini");
$pfInventoryComputerBlacklist = new PluginFusioninventoryInventoryComputerBlacklist();
if (isset ($_POST["add"])) {
Session::checkRight('plugin_fusioninventory_blacklist', CREATE);
if (!empty($_POST['value'])) {
$pfInventoryComputerBlacklist->add($_POST);
}
Html::back();
} else if (isset ($_POST["update"])) {
Session::checkRight('plugin_fusioninventory_blacklist', UPDATE);
$pfInventoryComputerBlacklist->update($_POST);
Html::back();
} else if (isset ($_POST["delete"])) {
Session::checkRight('plugin_fusioninventory_blacklist', PURGE);
$pfInventoryComputerBlacklist->delete($_POST);
Html::redirect("blacklist.php");
}
if (isset($_GET["id"])) {
$pfInventoryComputerBlacklist->showForm($_GET["id"]);
} else {
$pfInventoryComputerBlacklist->showForm("");
}
Html::footer();

View File

@@ -0,0 +1,62 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the computer blaklist fields search list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'),
$_SERVER["PHP_SELF"],
"admin",
"pluginfusioninventorymenu",
"inventorycomputerblacklist");
Session::checkRight('plugin_fusioninventory_blacklist', READ);
PluginFusioninventoryMenu::displayMenu("mini");
Search::show('PluginFusioninventoryInventoryComputerBlacklist');
Html::footer();

View File

@@ -0,0 +1,108 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the computer import inventry XML form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'),
$_SERVER["PHP_SELF"],
"admin",
"pluginfusioninventorymenu",
"inventorycomputerimportxml");
Session::checkRight('plugin_fusioninventory_importxml', CREATE);
PluginFusioninventoryMenu::displayMenu("mini");
$pfCommunication = new PluginFusioninventoryCommunication();
if (isset($_FILES['importfile']) && $_FILES['importfile']['tmp_name'] != '') {
error_log($_FILES['importfile']['name']);
ini_set("memory_limit", "-1");
ini_set("max_execution_time", "0");
if (preg_match('/\.zip/i', $_FILES['importfile']['name'])) {
$zip = new ZipArchive;
$zip->open($_FILES['importfile']['tmp_name']);
if (!$zip) {
error_log("Zip failure");
Session::addMessageAfterRedirect(
__("Can't read zip file!", 'fusioninventory'),
ERROR
);
} else {
for ($n = 0; $n < $zip->numFiles; $n++) {
$filename = $zip->getNameIndex($n);
$xml = $zip->getFromName($zip->getNameIndex($n));
if (!empty($xml)) {
$_SESSION['glpi_fusionionventory_nolock'] = true;
$pfCommunication->handleOCSCommunication('', $xml);
unset($_SESSION['glpi_fusionionventory_nolock']);
}
}
$zip->close();
}
} else if (preg_match('/\.(ocs|xml)/i', $_FILES['importfile']['name'])) {
$xml = file_get_contents($_FILES['importfile']['tmp_name']);
$_SESSION['glpi_fusionionventory_nolock'] = true;
$pfCommunication->handleOCSCommunication('', $xml, 'glpi');
unset($_SESSION['glpi_fusionionventory_nolock']);
} else {
Session::addMessageAfterRedirect(
__('No file to import!', 'fusioninventory'),
ERROR
);
}
Html::back();
}
$pfInventoryComputerImportXML = new PluginFusioninventoryInventoryComputerImportXML();
$pfInventoryComputerImportXML->showForm();
Html::footer();

View File

@@ -0,0 +1,61 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the rule entity form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'),
$_SERVER["PHP_SELF"],
"admin",
"pluginfusioninventorymenu",
"inventoryruleentity");
Session::checkLoginUser();
PluginFusioninventoryMenu::displayMenu("mini");
$rulecollection = new PluginFusioninventoryInventoryRuleEntityCollection();
include (GLPI_ROOT . "/front/rule.common.form.php");

View File

@@ -0,0 +1,63 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the rule entity search list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkLoginUser();
Html::header(__('FusionInventory', 'fusioninventory'),
$_SERVER["PHP_SELF"],
"admin",
"pluginfusioninventorymenu",
"inventoryruleentity");
PluginFusioninventoryMenu::displayMenu("mini");
RuleCollection::titleBackup();
$rulecollection = new PluginFusioninventoryInventoryRuleEntityCollection();
include (GLPI_ROOT . "/front/rule.common.php");

View File

@@ -0,0 +1,58 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the device import rule form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"],
"admin", "pluginfusioninventorymenu", "inventoryruleimport");
Session::checkLoginUser();
PluginFusioninventoryMenu::displayMenu("mini");
$rulecollection = new PluginFusioninventoryInventoryRuleImportCollection();
include (GLPI_ROOT . "/front/rule.common.form.php");

View File

@@ -0,0 +1,71 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the device import rule list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"],
"admin", "pluginfusioninventorymenu", "inventoryruleimport");
Session::checkLoginUser();
PluginFusioninventoryMenu::displayMenu("mini");
RuleCollection::titleBackup();
$rulecollection = new PluginFusioninventoryInventoryRuleImportCollection();
if (isset($_GET['resetrules'])) {
$pfSetup = new PluginFusioninventorySetup();
$pfSetup->initRules(1);
Html::back();
}
echo "<center><a href='". Plugin::getWebDir('fusioninventory') .
"/front/inventoryruleimport.php?resetrules=1' class='vsubmit'>";
echo __('Reset import rules (define only default rules)', 'fusioninventory');
echo "</a></center><br/>";
include (GLPI_ROOT . "/front/rule.common.php");

View File

@@ -0,0 +1,62 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the computer rule location form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Kevin Roy
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'),
$_SERVER["PHP_SELF"],
"admin",
"pluginfusioninventorymenu",
"inventoryrulelocation");
Session::checkLoginUser();
PluginFusioninventoryMenu::displayMenu("mini");
$rulecollection = new PluginFusioninventoryInventoryRuleLocationCollection();
include (GLPI_ROOT . "/front/rule.common.form.php");

View File

@@ -0,0 +1,64 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the computer rule location list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Kevin Roy
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkLoginUser();
Html::header(__('FusionInventory', 'fusioninventory'),
$_SERVER["PHP_SELF"],
"admin",
"pluginfusioninventorymenu",
"inventoryrulelocation");
PluginFusioninventoryMenu::displayMenu("mini");
RuleCollection::titleBackup();
$rulecollection = new PluginFusioninventoryInventoryRuleLocationCollection();
include (GLPI_ROOT . "/front/rule.common.php");

View File

@@ -0,0 +1,135 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the IP range form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
$iprange = new PluginFusioninventoryIPRange();
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"], "admin",
"pluginfusioninventorymenu", "iprange");
Session::checkRight('plugin_fusioninventory_iprange', READ);
PluginFusioninventoryMenu::displayMenu("mini");
if (isset ($_POST["add"])) {
Session::checkRight('plugin_fusioninventory_iprange', CREATE);
if ($iprange->checkip($_POST)) {
$_POST['ip_start'] = (int)$_POST['ip_start0'].".".(int)$_POST['ip_start1'].".";
$_POST['ip_start'] .= (int)$_POST['ip_start2'].".".(int)$_POST['ip_start3'];
$_POST['ip_end'] = (int)$_POST['ip_end0'].".".(int)$_POST['ip_end1'].".";
$_POST['ip_end'] .= (int)$_POST['ip_end2'].".".(int)$_POST['ip_end3'];
$iprange->add($_POST);
Html::back();
} else {
Html::back();
}
} else if (isset ($_POST["update"])) {
if (isset($_POST['communication'])) {
//task permanent update
$task = new PluginFusioninventoryTask();
$taskjob = new PluginFusioninventoryTaskjob();
$task->getFromDB($_POST['task_id']);
$input_task = [];
$input_task['id'] = $task->fields['id'];
$taskjob->getFromDB($_POST['taskjob_id']);
$input_taskjob = [];
$input_taskjob['id'] = $taskjob->fields['id'];
$input_task["is_active"] = $_POST['is_active'];
$input_task["periodicity_count"] = $_POST['periodicity_count'];
$input_task["periodicity_type"] = $_POST['periodicity_type'];
if (!empty($_POST['action'])) {
$a_actionDB = [];
$a_actionDB[]['PluginFusioninventoryAgent'] = $_POST['action'];
$input_taskjob["action"] = exportArrayToDB($a_actionDB);
} else {
$input_taskjob["action"] = '';
}
$a_definition = [];
$a_definition[]['PluginFusioninventoryIPRange'] = $_POST['iprange'];
$input_taskjob['definition'] = exportArrayToDB($a_definition);
$input_task["communication"] = $_POST['communication'];
$task->update($input_task);
$taskjob->update($input_taskjob);
} else {
Session::checkRight('plugin_fusioninventory_iprange', UPDATE);
if ($iprange->checkip($_POST)) {
$_POST['ip_start'] = (int)$_POST['ip_start0'].".".(int)$_POST['ip_start1'].".";
$_POST['ip_start'] .= (int)$_POST['ip_start2'].".".(int)$_POST['ip_start3'];
$_POST['ip_end'] = (int)$_POST['ip_end0'].".".(int)$_POST['ip_end1'].".";
$_POST['ip_end'] .= (int)$_POST['ip_end2'].".".(int)$_POST['ip_end3'];
$iprange->update($_POST);
}
}
Html::back();
} else if (isset ($_POST["purge"])) {
if (isset($_POST['communication'])) {
$task = new PluginFusioninventoryTask();
$task->delete(['id' => $_POST['task_id']], 1);
$_SERVER['HTTP_REFERER'] = str_replace("&allowcreate=1", "", $_SERVER['HTTP_REFERER']);
Html::back();
} else {
Session::checkRight('plugin_fusioninventory_iprange', PURGE);
$iprange->delete($_POST);
Html::redirect(Toolbox::getItemTypeSearchURL('PluginFusioninventoryIPRange'));
}
}
$id = "";
if (isset($_GET["id"])) {
$id = $_GET["id"];
}
$allowcreate = 0;
if (isset($_GET['allowcreate'])) {
$allowcreate = $_GET['allowcreate'];
}
$iprange->display(['id' => $id]);
Html::footer();

View File

@@ -0,0 +1,59 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the IP range search list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"], "admin",
"pluginfusioninventorymenu", "iprange");
Session::checkRight('plugin_fusioninventory_iprange', READ);
PluginFusioninventoryMenu::displayMenu("mini");
Search::show('PluginFusioninventoryIPRange');
Html::footer();

View File

@@ -0,0 +1,65 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the IP range config security (SNMP
* authentication) form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
$pfIPRange_ConfigSecurity = new PluginFusioninventoryIPRange_ConfigSecurity();
if (isset ($_POST["add"])) {
$a_data = current(getAllDataFromTable('glpi_plugin_fusioninventory_ipranges_configsecurities',
['plugin_fusioninventory_ipranges_id' => $_POST['plugin_fusioninventory_ipranges_id']],
false,
'`rank` DESC'));
$_POST['rank'] = 1;
if (isset($a_data['rank'])) {
$_POST['rank'] = $a_data['rank'] + 1;
}
$pfIPRange_ConfigSecurity->add($_POST);
Html::back();
}

View File

@@ -0,0 +1,70 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the lock form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Vincent Mazzoni
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkLoginUser();
if (isset($_POST["unlock_field_fusioninventory"])) {
$typeright = strtolower($_POST['type']);
if ($typeright == "networkequipment") {
$typeright = "networking";
}
if (Session::haveRight($typeright, UPDATE)) {
if (isset($_POST["lockfield_fusioninventory"])
&& count($_POST["lockfield_fusioninventory"])) {
$tab=PluginFusioninventoryLock::exportChecksToArray($_POST["lockfield_fusioninventory"]);
PluginFusioninventoryLock::setLockArray($_POST['type'], $_POST["id"], $tab);
} else {
PluginFusioninventoryLock::setLockArray($_POST['type'], $_POST["id"], []);
}
}
Html::back();
}
Html::footer();

View File

@@ -0,0 +1,62 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to display the mail page of the plugin.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
if (PluginFusioninventoryMenu::canView()) {
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"], "admin",
"pluginfusioninventorymenu", "menu");
echo Html::manageRefreshPage();
PluginFusioninventoryMenu::displayMenu();
PluginFusioninventoryMenu::board();
} else {
Html::displayRightError();
}
Html::footer();

View File

@@ -0,0 +1,59 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to display the inventory menu form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
if (PluginFusioninventoryMenu::canView()) {
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"], "admin",
"fusioninventory", "menu");
PluginFusioninventoryMenu::displayMenuInventory();
} else {
Html::displayRightError();
}
Html::footer();

View File

@@ -0,0 +1,59 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to display the network inventory menu.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
if (PluginFusioninventoryMenu::canView()) {
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"], "admin",
"fusioninventory", "menu");
PluginFusioninventoryMenu::displayMenuSNMPInventory();
} else {
Html::displayRightError();
}
Html::footer();

View File

@@ -0,0 +1,69 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to display the network port page.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Walid Nouh
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
if (!defined('GLPI_ROOT')) {
include ("../../../inc/includes.php");
}
// Manage for networkport display in networkequipment (glpi or fusion view
if (isset($_POST['selectview'])) {
$_SESSION['plugin_fusioninventory_networkportview'] = $_POST['selectview'];
Html::back();
}
if (isset($_POST["itemtype"])) {
$itemtype = $_POST["itemtype"];
} else if (isset($_GET["itemtype"])) {
$itemtype = $_GET["itemtype"];
} else {
$itemtype = 0;
}
Session::checkRight('networking', READ);
Session::checkRight('internet', READ);
PluginFusioninventoryNetworkPort::showDislayOptions($itemtype);
Html::ajaxFooter();

View File

@@ -0,0 +1,70 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the networ kport type form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkRight('config', UPDATE);
$pfNetworkporttype = new PluginFusioninventoryNetworkporttype();
if (isset($_POST['type_to_add'])) {
foreach ($_POST['type_to_add'] as $id) {
$input = [];
$input['id'] = $id;
$input['import'] = 1;
$pfNetworkporttype->update($input);
}
Html::back();
} else if (isset($_POST['type_to_delete'])) {
foreach ($_POST['type_to_delete'] as $id) {
$input = [];
$input['id'] = $id;
$input['import'] = 0;
$pfNetworkporttype->update($input);
}
Html::back();
}

View File

@@ -0,0 +1,51 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to keep compatibility with very old agent
* communication page.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
include_once(PLUGIN_FUSIONINVENTORY_DIR."/front/communication.php");

View File

@@ -0,0 +1,82 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the rule popup.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkLoginUser();
if (isset($_GET["popup"])) {
$_SESSION["glpipopup"]["name"] = $_GET["popup"];
}
if (isset($_SESSION["glpipopup"]["name"])) {
switch ($_SESSION["glpipopup"]["name"]) {
case "test_rule" :
Html::popHeader(__('Test'), $_SERVER['PHP_SELF']);
include "../../../front/rule.test.php";
break;
case "test_all_rules" :
Html::popHeader(__('Test rules engine'), $_SERVER['PHP_SELF']);
include "../../../front/rulesengine.test.php";
break;
case "show_cache" :
Html::popHeader(__('Cache informations', 'fusioninventory'), $_SERVER['PHP_SELF']);
include "../../../front/rule.cache.php";
break;
case "pluginfusioninventory_networkport_display_options" :
Html::popHeader(__('Network ports display options', 'fusioninventory'), $_SERVER['PHP_SELF']);
include "networkport.display.php";
break;
}
echo "<div class='center'><br><a href='javascript:window.close()'>".__('Back')."</a>";
echo "</div>";
Html::popFooter();
}

View File

@@ -0,0 +1,149 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the printer information form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkRight('plugin_fusioninventory_printer', READ);
if ((isset($_POST['update'])) && (isset($_POST['id']))) {
Session::checkRight('plugin_fusioninventory_printer', UPDATE);
$plugin_fusioninventory_printer = new PluginFusioninventoryPrinter();
$_POST['printers_id'] = $_POST['id'];
unset($_POST['id']);
$query = "SELECT *
FROM `glpi_plugin_fusioninventory_printers`
WHERE `printers_id`='".$_POST['printers_id']."' ";
$result = $DB->query($query);
if ($DB->numrows($result) == "0") {
$DB->insert(
'glpi_plugin_fusioninventory_printers', [
'printers_id' => $_POST['printers_id']
]
);
$query = "SELECT *
FROM `glpi_plugin_fusioninventory_printers`
WHERE `printers_id`='".$_POST['printers_id']."' ";
$result = $DB->query($query);
}
$data = $DB->fetchAssoc($result);
$_POST['id'] = $data['id'];
$plugin_fusioninventory_printer->update($_POST);
} else if ((isset($_POST["update_cartridge"])) && (isset($_POST['id']))) {
Session::checkRight('plugin_fusioninventory_printer', UPDATE);
$cartridge = new PluginFusioninventoryPrinterCartridge();
if ($cartridge->getFromDB($_POST['id'])) {
$cartridge->update($_POST);
}
}
$arg = "";
for ($i=1; $i <= 5; $i++) {
$value = '';
switch ($i) {
case 1:
$value = "datetotalpages";
break;
case 2:
$value = "dateblackpages";
break;
case 3:
$value = "datecolorpages";
break;
case 4:
$value = "daterectoversopages";
break;
case 5:
$value = "datescannedpages";
break;
}
if (isset($_POST[$value])) {
$_SESSION[$value] = $_POST[$value];
}
}
if (isset($_POST['graph_plugin_fusioninventory_printer_period'])) {
$fields = ['graph_begin', 'graph_end', 'graph_timeUnit', 'graph_type'];
foreach ($fields as $field) {
if (isset($_POST[$field])) {
$_SESSION['glpi_plugin_fusioninventory_'.$field] = $_POST[$field];
} else {
unset($_SESSION['glpi_plugin_fusioninventory_'.$field]);
}
}
}
$field = 'graph_printerCompAdd';
if (isset($_POST['graph_plugin_fusioninventory_printer_add'])) {
if (isset($_POST[$field])) {
$_SESSION['glpi_plugin_fusioninventory_'.$field] = $_POST[$field];
}
} else {
unset($_SESSION['glpi_plugin_fusioninventory_'.$field]);
}
$field = 'graph_printerCompRemove';
if (isset($_POST['graph_plugin_fusioninventory_printer_remove'])) {
if (isset($_POST[$field])) {
$_SESSION['glpi_plugin_fusioninventory_'.$field] = $_POST[$field];
}
} else {
unset($_SESSION['glpi_plugin_fusioninventory_'.$field]);
}
Html::back();

View File

@@ -0,0 +1,131 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to display the printer log report page.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
$USEDBREPLICATE=1;
$DBCONNECTION_REQUIRED=0;
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'),
$_SERVER["PHP_SELF"],
"admin",
"pluginfusioninventorymenu",
"printerlogreport");
Session::checkRight('plugin_fusioninventory_reportprinter', READ);
if (isset($_POST['glpi_plugin_fusioninventory_date_start'])) {
$_SESSION['glpi_plugin_fusioninventory_date_start'] =
$_POST['glpi_plugin_fusioninventory_date_start'];
}
if (isset($_POST['glpi_plugin_fusioninventory_date_end'])) {
$_SESSION['glpi_plugin_fusioninventory_date_end'] =
$_POST['glpi_plugin_fusioninventory_date_end'];
}
if (isset($_POST['reset'])) {
unset($_SESSION['glpi_plugin_fusioninventory_date_start']);
unset($_SESSION['glpi_plugin_fusioninventory_date_end']);
}
if ((!isset($_SESSION['glpi_plugin_fusioninventory_date_start']))
OR (empty($_SESSION['glpi_plugin_fusioninventory_date_start']))) {
$_SESSION['glpi_plugin_fusioninventory_date_start'] = "2000-01-01";
}
if (!isset($_SESSION['glpi_plugin_fusioninventory_date_end'])) {
$_SESSION['glpi_plugin_fusioninventory_date_end'] = date("Y-m-d");
}
displaySearchForm();
$_GET['target']="printerlogreport.php";
Search::show('PluginFusioninventoryPrinterLogReport');
/**
* Display special search form
*
* @global array $_SERVER
*/
function displaySearchForm() {
global $_SERVER;
echo "<form action='".$_SERVER["PHP_SELF"]."' method='post'>";
echo "<table class='tab_cadre' cellpadding='5'>";
echo "<tr class='tab_bg_1' align='center'>";
echo "<td>";
echo __('Starting date', 'fusioninventory')." :";
echo "</td>";
echo "<td width='120'>";
Html::showDateField("glpi_plugin_fusioninventory_date_start",
['value' => $_SESSION['glpi_plugin_fusioninventory_date_start']]);
echo "</td>";
echo "<td>";
echo __('Ending date', 'fusioninventory')." :";
echo "</td>";
echo "<td width='120'>";
Html::showDateField("glpi_plugin_fusioninventory_date_end",
['value' => $_SESSION['glpi_plugin_fusioninventory_date_end']]);
echo "</td>";
echo "<td>";
echo "<input type='submit' name='reset' value='reset' class='submit' />";
echo "</td>";
echo "<td>";
echo "<input type='submit' value='". __('Validate') . "' class='submit' />";
echo "</td>";
echo "</tr>";
echo "</table>";
Html::closeForm();
}
Html::footer();

View File

@@ -0,0 +1,143 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the common rule form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Walid Nouh
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
if (!defined('GLPI_ROOT')) {
die("Sorry. You can't access directly to this file");
}
Session::checkLoginUser();
$rule = $rulecollection->getRuleClass();
$rulecollection->checkGlobal('r');
if (!isset($_GET["id"])) {
$_GET["id"] = "";
}
$rulecriteria = new RuleCriteria(get_class($rule));
$ruleaction = new RuleAction(get_class($rule));
if (isset($_POST["delete_criteria"])) {
$rulecollection->checkGlobal('w');
if (count($_POST["item"])) {
foreach ($_POST["item"] as $key => $val) {
$input = [];
$input["id"] = $key;
$rulecriteria->delete($input);
}
}
// Can't do this in RuleCriteria, so do it here
$rule->update(['id' => $_POST['rules_id'],
'date_mod' => $_SESSION['glpi_currenttime']]);
Html::back();
} else if (isset($_POST["delete_action"])) {
$rulecollection->checkGlobal('w');
if (count($_POST["item"])) {
foreach ($_POST["item"] as $key => $val) {
$input = [];
$input["id"] = $key;
$ruleaction->delete($input);
}
}
// Can't do this in RuleAction, so do it here
$rule->update(['id' => $_POST['rules_id'],
'date_mod' => $_SESSION['glpi_currenttime']]);
Html::back();
} else if (isset($_POST["add_criteria"])) {
$rulecollection->checkGlobal('w');
$rulecriteria->add($_POST);
// Can't do this in RuleCriteria, so do it here
$rule->update(['id' => $_POST['rules_id'],
'date_mod' => $_SESSION['glpi_currenttime']]);
Html::back();
} else if (isset($_POST["add_action"])) {
$rulecollection->checkGlobal('w');
$ruleaction->add($_POST);
// Can't do this in RuleCriteria, so do it here
$rule->update(['id' => $_POST['rules_id'],
'date_mod' => $_SESSION['glpi_currenttime']]);
Html::back();
} else if (isset($_POST["update"])) {
$rulecollection->checkGlobal('w');
$rule->update($_POST);
Event::log($_POST['id'], "rules", 4, "setup", $_SESSION["glpiname"]." ".__('Update the item'));
Html::back();
} else if (isset($_POST["add"])) {
$rulecollection->checkGlobal('w');
$newID = $rule->add($_POST);
Event::log($newID, "rules", 4, "setup", $_SESSION["glpiname"]." ".__('Add the item'));
Html::redirect($_SERVER['HTTP_REFERER']."?id=$newID");
} else if (isset($_POST["delete"])) {
$rulecollection->checkGlobal('w');
$rulecollection->deleteRuleOrder($_POST["ranking"]);
$rule->delete($_POST);
Event::log($_POST["id"], "rules", 4, "setup", $_SESSION["glpiname"]." ".__('item\'s deletion'));
Html::redirect(str_replace('.form', '', $_SERVER['PHP_SELF']));
}
Html::header(__('Setup'), $_SERVER['PHP_SELF'], "admin",
$rulecollection->menu_type, $rulecollection->menu_option);
$rule->showForm($_GET["id"]);
Html::footer();

View File

@@ -0,0 +1,218 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the common rule list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Walid Nouh
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
if (!defined('GLPI_ROOT')) {
die("Sorry. You can't access directly to this file");
}
Session::checkLoginUser();
$rule = $rulecollection->getRuleClass();
if (!isset($_GET["id"])) {
$_GET["id"] = "";
}
$rulecollection->checkGlobal('r');
if (isset($_GET["action"])) {
$rulecollection->checkGlobal('w');
$rulecollection->changeRuleOrder($_GET["id"], $_GET["action"]);
Html::back();
} else if (isset($_POST["action"])) {
$rulecollection->checkGlobal('w');
// Use massive action system
switch ($_POST["action"]) {
case "delete" :
if (isset($_POST["item"]) && count($_POST["item"])) {
foreach ($_POST["item"] as $key => $val) {
$rule->getFromDB($key);
$rulecollection->deleteRuleOrder($rule->fields["ranking"]);
$rule->delete(['id' => $key]);
}
Event::log(0, "rules", 4, "setup", $_SESSION["glpiname"]." ".__('item\'s deletion'));
Html::back();
}
break;
case "move_rule" :
if (isset($_POST["item"]) && count($_POST["item"])) {
foreach ($_POST["item"] as $key => $val) {
$rule->getFromDB($key);
$rulecollection->moveRule($key, $_POST['ranking'], $_POST['move_type']);
}
}
break;
case "activate_rule" :
if (isset($_POST["item"])) {
foreach ($_POST["item"] as $key => $val) {
if ($val == 1) {
$input = [];
$input['id'] = $key;
$input['is_active'] = $_POST["activate_rule"];
$rule->update($input);
}
}
}
break;
}
} else if (isset($_POST["replay_rule"]) || isset($_GET["replay_rule"])) {
$rulecollection->checkGlobal('w');
// Current time
$start = explode(" ", microtime());
$start = $start[0]+$start[1];
// Limit computed from current time
$max = get_cfg_var("max_execution_time");
$max = $start + ($max>0 ? $max/2.0 : 30.0);
Html::header(_n('Rule', 'Rules', 2), $_SERVER['PHP_SELF'], "admin", $rulecollection->menu_type,
$rulecollection->menu_option);
if (!(isset($_POST['replay_confirm']) || isset($_GET['offset']))
&& $rulecollection->warningBeforeReplayRulesOnExistingDB($_SERVER['PHP_SELF'])) {
Html::footer();
exit();
}
echo "<table class='tab_cadrehov'>";
echo "<tr><th><div class='relative'><strong>" .$rulecollection->getTitle(). "</strong>";
echo " - " .__('Replay the dictionary rules'). "</th></tr>\n";
echo "<tr><td class='center'>";
Html::createProgressBar(__('Work in progress...'));
echo "</td></tr>\n";
echo "</table>";
$manufacturer = 0;
if (!isset($_GET['offset'])) {
// First run
$offset = $rulecollection->replayRulesOnExistingDB(0, $max, [], $_POST);
$manufacturer = (isset($_POST["manufacturer"]) ? $_POST["manufacturer"] : 0);
} else {
// Next run
$offset = $rulecollection->replayRulesOnExistingDB($_GET['offset'],
$max,
[],
$_GET);
$manufacturer = $_GET["manufacturer"];
// global start for stat
$start = $_GET["start"];
}
if ($offset < 0) {
// Work ended
$end = explode(" ", microtime());
$duree = round($end[0]+$end[1]-$start);
Html::changeProgressBarMessage(__('Task completed.').
" (".Html::timestampToString($duree).")");
echo "<a href='".$_SERVER['PHP_SELF']."'>".__('Back')."</a>";
} else {
// Need more work
Html::redirect($_SERVER['PHP_SELF'].
"?start=$start&replay_rule=1&offset=$offset&manufacturer="."$manufacturer");
}
Html::footer(true);
exit();
}
$fi_path = Plugin::getWebDir('fusioninventory');
Html::header(_n('Rule', 'Rules', 2), $_SERVER['PHP_SELF'], "admin", $rulecollection->menu_type,
$rulecollection->menu_option);
$tabs = [];
if ($rulecollection->showInheritedTab()) {
$tabs[0] = [
'title' => __('Rules applied', 'fusioninventory').' : '.
Dropdown::getDropdownName('glpi_entities',
$_SESSION['glpiactive_entity']),
'url' => $fi_path."/ajax/rules.tabs.php",
'params' => "target=".$_SERVER['PHP_SELF']."&glpi_tab=1&inherited=1&itemtype=".
get_class($rulecollection)];
}
$title = _n('Rule', 'Rules', 2);
if ($rulecollection->isRuleRecursive()) {
$title = __('Local rules', 'fusioninventory').' : '.
Dropdown::getDropdownName('glpi_entities', $_SESSION['glpiactive_entity']);
}
$tabs[1] = ['title' => $title,
'url' => $fi_path."/ajax/rules.tabs.php",
'params' => "target=".$_SERVER['PHP_SELF']."&glpi_tab=0&inherited=0&itemtype=".
get_class($rulecollection)];
if ($rulecollection->showChildrensTab()) {
$tabs[2] = [
'title' => __('Rules applicable in the sub-entities'),
'url' => $fi_path."/ajax/rules.tabs.php",
'params' => "target=".$_SERVER['PHP_SELF'].
"&glpi_tab=2&inherited=0&childrens=1&itemtype=".
get_class($rulecollection)];
}
echo "<div id='tabspanel' class='center-h'></div>";
Ajax::createTabs('tabspanel', 'tabcontent', $tabs, $rulecollection->getRuleClassName());
echo "<div id='tabcontent'>&nbsp;</div>";
echo "<script type='text/javascript'>loadDefaultTab();</script>";
Html::footer();

View File

@@ -0,0 +1,102 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to display the test rule page.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Walid Nouh
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
if (!defined('GLPI_ROOT')) {
include ("../../../inc/includes.php");
}
Session::checkLoginUser();
$sub_type = 0;
if (isset($_POST["sub_type"])) {
$sub_type = $_POST["sub_type"];
} else if (isset($_GET["sub_type"])) {
$sub_type = $_GET["sub_type"];
}
$rules_id = 0;
if (isset($_POST["rules_id"])) {
$rules_id = $_POST["rules_id"];
} else if (isset($_GET["rules_id"])) {
$rules_id = $_GET["rules_id"];
}
$rule = new $sub_type();
$rule->checkGlobal(READ);
$test_rule_output = null;
if (!strpos($_SERVER['PHP_SELF'], "popup")) {
Html::header(__('Setup'), $_SERVER['PHP_SELF'], "config", "display");
}
$rule->showRulePreviewCriteriasForm($_SERVER['PHP_SELF'], $rules_id);
if (isset($_POST["test_rule"])) {
$params = [];
//Unset values that must not be processed by the rule
unset($_POST["test_rule"]);
unset($_POST["rules_id"]);
unset($_POST["sub_type"]);
$rule->getRuleWithCriteriasAndActions($rules_id, 1, 1);
// Need for RuleEngines
foreach ($_POST as $key => $val) {
$_POST[$key] = stripslashes($_POST[$key]);
}
//Add rules specific POST fields to the param array
$params = $rule->addSpecificParamsForPreview($params);
$input = $rule->prepareInputDataForProcess($_POST, $params);
//$rule->regex_results = array();
echo "<br>";
$rule->showRulePreviewResultsForm($_SERVER['PHP_SELF'], $input, $params);
}
if (!strpos($_SERVER['PHP_SELF'], "popup")) {
Html::footer();
}

View File

@@ -0,0 +1,95 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to display the rules engine test.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
if (!defined('GLPI_ROOT')) {
include ("../../../inc/includes.php");
}
$sub_type = 0;
if (isset($_POST["sub_type"])) {
$sub_type = $_POST["sub_type"];
} else if (isset($_GET["sub_type"])) {
$sub_type = $_GET["sub_type"];
}
$sub_type = str_replace('FusionInventory', '', $sub_type);
if (isset($_POST["condition"])) {
$condition = $_POST["condition"];
} else if (isset($_GET["condition"])) {
$condition = $_GET["condition"];
} else {
$condition = 0;
}
$rulecollection = RuleCollection::getClassByType($sub_type);
if ($rulecollection->isRuleRecursive()) {
$rulecollection->setEntity($_SESSION['glpiactive_entity']);
}
$rulecollection->checkGlobal(READ);
if (!strpos($_SERVER['PHP_SELF'], "popup")) {
Html::header(__('Setup'), $_SERVER['PHP_SELF'], "config", "display");
}
// Need for RuleEngines
foreach ($_POST as $key => $val) {
$_POST[$key] = stripslashes($val);
}
$input = $rulecollection->showRulesEnginePreviewCriteriasForm($_SERVER['PHP_SELF'], $_POST, $condition);
if (isset($_POST["test_all_rules"])) {
//Unset values that must not be processed by the rule
unset($_POST["sub_type"]);
unset($_POST["test_all_rules"]);
echo "<br>";
$rulecollection->showRulesEnginePreviewResultsForm($_SERVER['PHP_SELF'], $_POST, $condition);
}
if (!strpos($_SERVER['PHP_SELF'], "popup")) {
Html::footer();
}

View File

@@ -0,0 +1,95 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to securitely send files to user browser.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Vincent Mazzoni
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
if (!defined('GLPI_ROOT')) {
define('GLPI_ROOT', realpath('../../..'));
}
if (!defined("GLPI_PLUGIN_DOC_DIR")) {
define("GLPI_PLUGIN_DOC_DIR", GLPI_ROOT . "/files/_plugins");
}
Session::checkLoginUser();
$docDir = GLPI_PLUGIN_DOC_DIR.'/fusioninventory';
if (isset($_GET['file'])) {
$filename = $_GET['file'];
// Security test : document in $docDir
if (strstr($filename, "../") || strstr($filename, "..\\")) {
echo "Security attack !!!";
Event::log($filename, "sendFile", 1, "security",
$_SESSION["glpiname"]." tries to get a non standard file.");
return;
}
$file = $docDir.'/'.$filename;
if (!file_exists($file)) {
echo "Error file $filename does not exist";
return;
} else {
// Now send the file with header() magic
header("Expires: Mon, 26 Nov 1962 00:00:00 GMT");
header('Pragma: private'); /// IE BUG + SSL
//header('Pragma: no-cache');
header('Cache-control: private, must-revalidate'); /// IE BUG + SSL
header("Content-disposition: filename=\"$filename\"");
// header("Content-type: ".$mime);
$f=fopen($file, "r");
if (!$f) {
echo "Error opening file $filename";
} else {
// Pour que les \x00 ne devienne pas \0
$fsize=filesize($file);
if ($fsize) {
echo fread($f, filesize($file));
}
}
}
}

View File

@@ -0,0 +1,61 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to send the inventory to user browser.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author Vincent Mazzoni
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
//Session::checkRight('config', "w");
$itemtype = $_GET['itemtype'];
$items_id = $_GET['items_id'];
header('Cache-control: private, must-revalidate'); /// IE BUG + SSL
header('Content-disposition: attachment; filename='.$_GET['filename']);
header('Content-type: text/plain');
call_user_func(['PluginFusioninventoryToolbox', 'sendXML'], $items_id, $itemtype);

View File

@@ -0,0 +1,60 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to display the network discovery state.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"],
"admin", "pluginfusioninventorymenu", "statediscovery");
Session::checkRight('plugin_fusioninventory_task', READ);
PluginFusioninventoryMenu::displayMenu("mini");
$pfStateDiscovery = new PluginFusioninventoryStateDiscovery();
$pfStateDiscovery->display();
Html::footer();

View File

@@ -0,0 +1,61 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to display the network inventory state.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"],
"admin", "pluginfusioninventorymenu", "stateinventory");
Session::checkRight('plugin_fusioninventory_task', READ);
PluginFusioninventoryMenu::displayMenu("mini");
$pfStateInventory = new PluginFusioninventoryStateInventory();
$pfStateInventory->display();
Html::footer();

View File

@@ -0,0 +1,59 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the switch (network equipment) extended
* information form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkRight('networking', READ);
Session::checkRight('plugin_fusioninventory_networkequipment', UPDATE);
if ((isset($_POST['update'])) && (isset($_POST['id']))) {
$pfNetworkEquipment = new PluginFusioninventoryNetworkEquipment();
$pfNetworkEquipment->updateNetworkInfo($_POST['id'], $_POST['plugin_fusioninventory_configsecurities_id'], $_POST['sysdescr']);
}
Html::back();

View File

@@ -0,0 +1,69 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the task form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
$pfTask = new PluginFusioninventoryTask();
//Submit the task form parameters
$pfTask->submitForm($_POST);
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"],
"admin", "pluginfusioninventorymenu", "task");
Session::checkRight('plugin_fusioninventory_task', READ);
PluginFusioninventoryMenu::displayMenu("mini");
//PluginFusioninventoryTaskjob::isAllowurlfopen();
//If there is no form to submit, display the form
$pfTask->display($_GET);
Html::footer();

View File

@@ -0,0 +1,67 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the task search list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'),
$_SERVER["PHP_SELF"],
"admin",
"pluginfusioninventorymenu",
"task");
Session::checkRight('plugin_fusioninventory_task', READ);
PluginFusioninventoryMenu::displayMenu("mini");
//PluginFusioninventoryTaskjob::isAllowurlfopen();
$pfTask = new PluginFusioninventoryTask();
$pfTask->showList();
Html::footer();

View File

@@ -0,0 +1,63 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the task job form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
$pfTaskjob = new PluginFusioninventoryTaskjob();
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"], "admin",
"pluginfusioninventorymenu", "taskjob");
Session::checkRight('plugin_fusioninventory_task', READ);
$pfTaskjob->submitForm($_POST);
/**
* This form is only used from a Task therefore we just go back to the page referer. It also can be
* used from within another Item Type.
*/
Html::back();

View File

@@ -0,0 +1,65 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the task job search list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'),
$_SERVER["PHP_SELF"],
"admin",
"pluginfusioninventorymenu",
"taskjob");
Session::checkRight('plugin_fusioninventory_task', READ);
PluginFusioninventoryMenu::displayMenu("mini");
echo "<div class='monitoring-logs'>";
$pfTask = new PluginFusioninventoryTask();
$pfTask->showJobLogs();
echo "</div>";
Html::footer();

View File

@@ -0,0 +1,59 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the task job log list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"],
"admin", "pluginfusioninventorymenu", "taskjoblog");
Session::checkRight('plugin_fusioninventory_task', READ);
PluginFusioninventoryMenu::displayMenu("mini");
Search::show('PluginFusioninventoryTaskjoblog');
Html::footer();

View File

@@ -0,0 +1,93 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the task timeslot form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkRight('plugin_fusioninventory_task', READ);
if (!isset($_GET["id"])) {
$_GET["id"] = "";
}
$pfTimeslot = new PluginFusioninventoryTimeslot();
//Add a new timeslot
if (isset($_POST["add"])) {
$pfTimeslot->check(-1, CREATE, $_POST);
if ($newID = $pfTimeslot->add($_POST)) {
if ($_SESSION['glpibackcreated']) {
Html::redirect($pfTimeslot->getFormURL()."?id=".$newID);
}
}
Html::back();
// delete a timeslot
} else if (isset($_POST["delete"])) {
$pfTimeslot->check($_POST['id'], DELETE);
$ok = $pfTimeslot->delete($_POST);
$pfTimeslot->redirectToList();
} else if (isset($_POST["purge"])) {
$pfTimeslot->check($_POST['id'], PURGE);
$pfTimeslot->delete($_POST, 1);
$pfTimeslot->redirectToList();
//update a timeslot
} else if (isset($_POST["update"])) {
$pfTimeslot->check($_POST['id'], UPDATE);
$pfTimeslot->update($_POST);
Html::back();
} else {//print timeslot information
Html::header(PluginFusioninventoryTimeslot::getTypeName(2),
$_SERVER['PHP_SELF'],
"admin",
"pluginfusioninventorymenu",
"timeslot");
PluginFusioninventoryMenu::displayMenu("mini");
$pfTimeslot->display(['id' => $_GET["id"]]);
Html::footer();
}

View File

@@ -0,0 +1,59 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the task timeslot search list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkRight('plugin_fusioninventory_task', READ);
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"],
"admin", "pluginfusioninventorymenu", "timeslot");
PluginFusioninventoryMenu::displayMenu("mini");
Search::show('PluginFusioninventoryTimeslot');
Html::footer();

View File

@@ -0,0 +1,70 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the task timeslot entries form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Session::checkRight('plugin_fusioninventory_task', READ);
if (!isset($_GET["id"])) {
$_GET["id"] = "";
}
$pfTimeslotEntry = new PluginFusioninventoryTimeslotEntry();
foreach ($_POST as $key=>$value) {
if (strstr($key, 'purge-')) {
$split = explode('-', $key);
$_POST['id'] = $split[1];
$pfTimeslotEntry->check($_POST['id'], PURGE);
$pfTimeslotEntry->delete($_POST, 1);
Html::back();
}
}
$pfTimeslotEntry = new PluginFusioninventoryTimeslotEntry();
$pfTimeslotEntry->addEntry($_POST);
Html::back();

View File

@@ -0,0 +1,121 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the unmanaged device form.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
$pfUnmanaged = new PluginFusioninventoryUnmanaged();
$ptt = new PluginFusioninventoryTask();
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"],
"assets", "pluginfusioninventoryunmanaged");
Session::checkRight('plugin_fusioninventory_unmanaged', READ);
PluginFusioninventoryMenu::displayMenu("mini");
$id = "";
if (isset($_GET["id"])) {
$id = $_GET["id"];
}
if (isset ($_POST["add"])) {
Session::checkRight('plugin_fusioninventory_unmanaged', CREATE);
if (isset($_POST['items_id'])
&& ($_POST['items_id'] != "0") AND ($_POST['items_id'] != "")) {
$_POST['itemtype'] = '1';
}
$pfUnmanaged->add($_POST);
Html::back();
} else if (isset($_POST["delete"])) {
Session::checkRight('plugin_fusioninventory_unmanaged', PURGE);
$pfUnmanaged->check($_POST['id'], DELETE);
$pfUnmanaged->delete($_POST);
$pfUnmanaged->redirectToList();
} else if (isset($_POST["restore"])) {
$pfUnmanaged->check($_POST['id'], DELETE);
if ($pfUnmanaged->restore($_POST)) {
Event::log($_POST["id"], "PluginFusioninventoryUnmanaged", 4, "inventory",
$_SESSION["glpiname"]." ".__('restoration of the item', 'fusioninventory')." ".
$pfUnmanaged->getField('name'));
}
$pfUnmanaged->redirectToList();
} else if (isset($_POST["purge"]) || isset($_GET["purge"])) {
Session::checkRight('plugin_fusioninventory_unmanaged', PURGE);
$pfUnmanaged->check($_POST['id'], PURGE);
$pfUnmanaged->delete($_POST, 1);
$pfUnmanaged->redirectToList();
} else if (isset($_POST["update"])) {
$pfUnmanaged->check($_POST['id'], UPDATE);
$pfUnmanaged->update($_POST);
Html::back();
} else if (isset($_POST["import"])) {
$Import = 0;
$NoImport = 0;
list($Import, $NoImport) = $pfUnmanaged->import($_POST['id'], $Import, $NoImport);
Session::addMessageAfterRedirect(
__('Number of imported devices', 'fusioninventory')." : ".$Import);
Session::addMessageAfterRedirect(
__('Number of devices not imported because type not defined', 'fusioninventory').
" : ".$NoImport);
if ($Import == "0") {
Html::back();
} else {
Html::redirect(Plugin::getWebDir('fusioninventory')."/front/unmanaged.php");
}
}
$pfUnmanaged->display($_GET);
Html::footer();

View File

@@ -0,0 +1,59 @@
<?php
/**
* FusionInventory
*
* Copyright (C) 2010-2016 by the FusionInventory Development Team.
*
* http://www.fusioninventory.org/
* https://github.com/fusioninventory/fusioninventory-for-glpi
* http://forge.fusioninventory.org/
*
* ------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of FusionInventory project.
*
* FusionInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FusionInventory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
*
* ------------------------------------------------------------------------
*
* This file is used to manage the device unmanaged search list.
*
* ------------------------------------------------------------------------
*
* @package FusionInventory
* @author David Durieux
* @copyright Copyright (c) 2010-2016 FusionInventory team
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link http://www.fusioninventory.org/
* @link https://github.com/fusioninventory/fusioninventory-for-glpi
*
*/
include ("../../../inc/includes.php");
Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"],
"assets", "pluginfusioninventoryunmanaged", "unmanaged");
Session::checkRight('plugin_fusioninventory_unmanaged', READ);
$_GET['target'] = "unmanaged.php";
Search::show('PluginFusioninventoryUnmanaged');
Html::footer();