static function uninstall()
 {
     global $DB;
     CronTask::Unregister('fusioninventory');
     PluginFusioninventoryProfile::uninstallProfile();
     $pfSetup = new PluginFusioninventorySetup();
     $user = new User();
     if (class_exists('PluginFusioninventoryConfig')) {
         $fusioninventory_config = new PluginFusioninventoryConfig();
         $users_id = $fusioninventory_config->getValue('users_id');
         $user->delete(array('id' => $users_id), 1);
     }
     if (file_exists(GLPI_PLUGIN_DOC_DIR . '/fusioninventory')) {
         $pfSetup->rrmdir(GLPI_PLUGIN_DOC_DIR . '/fusioninventory');
     }
     $query = "SHOW TABLES;";
     $result = $DB->query($query);
     while ($data = $DB->fetch_array($result)) {
         if (strstr($data[0], "glpi_plugin_fusioninventory_") or strstr($data[0], "glpi_plugin_fusinvsnmp_") or strstr($data[0], "glpi_plugin_fusinvinventory_") or strstr($data[0], "glpi_dropdown_plugin_fusioninventory") or strstr($data[0], "glpi_plugin_tracker") or strstr($data[0], "glpi_dropdown_plugin_tracker")) {
             $query_delete = "DROP TABLE `" . $data[0] . "`;";
             $DB->query($query_delete) or die($DB->error());
         }
     }
     $query = "DELETE FROM `glpi_displaypreferences`\n               WHERE `itemtype` LIKE 'PluginFusioninventory%';";
     $DB->query($query) or die($DB->error());
     // Delete rules
     $Rule = new Rule();
     $Rule->deleteByCriteria(array('sub_type' => 'PluginFusioninventoryInventoryRuleImport'));
     //Remove informations related to profiles from the session (to clean menu and breadcrumb)
     PluginFusioninventoryProfile::removeRightsFromSession();
     return TRUE;
 }