function exportmodels() { global $DB; $pfiie = new PluginFusioninventoryImportExport(); $query_models = "SELECT * FROM glpi_plugin_fusioninventory_model_infos"; if ($result_models = $DB->query($query_models)) { while ($data = $DB->fetch_array($result_models)) { $xml = $pfiie->plugin_fusioninventory_export($data['ID']); file_put_contents(GLPI_PLUGIN_DOC_DIR . "/fusioninventory/models/" . $data['name'] . ".xml", $xml); } } }
(at your option) any later version. GLPI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GLPI; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ------------------------------------------------------------------------ */ // Original Author of file: David DURIEUX // Purpose of file: // ---------------------------------------------------------------------- if (!defined('GLPI_ROOT')) { define('GLPI_ROOT', '../../..'); } $NEEDED_ITEMS = array("fusioninventory"); include GLPI_ROOT . "/inc/includes.php"; //commonHeader($LANG['plugin_fusioninventory']["title"][0],$_SERVER["PHP_SELF"],"plugins","fusioninventory","models"); PluginFusioninventoryAuth::checkRight("snmp_models", "r"); $importexport = new PluginFusioninventoryImportExport(); header("Expires: 0"); header("Cache-control: private"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Description: File Transfer"); header('Content-type: application/xml; charset="utf-8"', true); header("Content-disposition: attachment; filename=export.xml"); echo $importexport->plugin_fusioninventory_export($_GET["model"]);