(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: MAZZONI Vincent
// Purpose of file:
// ----------------------------------------------------------------------
define('GLPI_ROOT', '../../..');
include GLPI_ROOT . "/inc/includes.php";
//todo
//PluginFusioninventoryAuth::checkRight("snmp_networking","r");
if (isset($_POST["unlock_field_fusioninventory"])) {
    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"], array());
    }
    glpi_header($_SERVER['HTTP_REFERER']);
}
$locks = new PluginFusioninventoryLock();
$locks->showForm($_SERVER["PHP_SELF"], $_POST['type'], $ID);
commonFooter();
示例#2
0
function plugin_fusioninventory_MassiveActionsDisplay($type, $action)
{
    global $LANG, $CFG_GLPI, $DB;
    switch ($type) {
        case NETWORKING_TYPE:
            switch ($action) {
                case "plugin_fusioninventory_get_model":
                    if (PluginFusioninventory::haveRight("snmp_models", "w")) {
                        echo "<input type=\"submit\" name=\"massiveaction\" class=\"submit\" value=\"" . $LANG["buttons"][2] . "\" >";
                    }
                    break;
                case "plugin_fusioninventory_assign_model":
                    if (PluginFusioninventory::haveRight("snmp_models", "w")) {
                        $query_models = "SELECT *\n                                   FROM `glpi_plugin_fusioninventory_model_infos`\n                                   WHERE `device_type`!='2'\n                                         AND `device_type`!='0';";
                        $result_models = $DB->query($query_models);
                        $exclude_models = array();
                        while ($data_models = $DB->fetch_array($result_models)) {
                            $exclude_models[] = $data_models['ID'];
                        }
                        Dropdown::show("PluginFusioninventoryModelInfos", array('name' => "snmp_model", 'value' => "name", 'comments' => false, 'used' => $exclude_models));
                        echo "<input type=\"submit\" name=\"massiveaction\" class=\"submit\" value=\"" . $LANG["buttons"][2] . "\" >";
                    }
                    break;
                case "plugin_fusioninventory_assign_auth":
                    if (PluginFusioninventory::haveRight("snmp_authentification", "w")) {
                        PluginFusioninventorySNMP::auth_dropdown();
                        echo "<input type=\"submit\" name=\"massiveaction\" class=\"submit\" value=\"" . $LANG["buttons"][2] . "\" >";
                    }
                    break;
                case "plugin_fusioninventory_manage_locks":
                    $pfil = new PluginFusioninventoryLock();
                    $pfil->showForm($_SERVER["PHP_SELF"], NETWORKING_TYPE, '');
                    break;
            }
            break;
        case PRINTER_TYPE:
            switch ($action) {
                case "plugin_fusioninventory_get_model":
                    if (PluginFusioninventory::haveRight("snmp_models", "w")) {
                        echo "<input type=\"submit\" name=\"massiveaction\" class=\"submit\" value=\"" . $LANG["buttons"][2] . "\" >";
                    }
                    break;
                case "plugin_fusioninventory_assign_model":
                    if (PluginFusioninventory::haveRight("snmp_models", "w")) {
                        $query_models = "SELECT *\n                                   FROM `glpi_plugin_fusioninventory_model_infos`\n                                   WHERE `device_type`!='3'\n                                         AND `device_type`!='0';";
                        $result_models = $DB->query($query_models);
                        $exclude_models = array();
                        while ($data_models = $DB->fetch_array($result_models)) {
                            $exclude_models[] = $data_models['ID'];
                        }
                        Dropdown::show("PluginFusioninventoryModelInfos", array('name' => "snmp_model", 'value' => "name", 'comments' => false, 'used' => $exclude_models));
                        echo "<input type=\"submit\" name=\"massiveaction\" class=\"submit\" value=\"" . $LANG["buttons"][2] . "\" >";
                    }
                    break;
                case "plugin_fusioninventory_assign_auth":
                    if (PluginFusioninventory::haveRight("snmp_authentification", "w")) {
                        PluginFusioninventorySNMP::auth_dropdown();
                        echo "<input type=\"submit\" name=\"massiveaction\" class=\"submit\" value=\"" . $LANG["buttons"][2] . "\" >";
                    }
                    break;
                case "plugin_fusioninventory_manage_locks":
                    $pfil = new PluginFusioninventoryLock();
                    $pfil->showForm($_SERVER["PHP_SELF"], NETWORKING_TYPE, '');
                    break;
            }
            break;
        case PLUGIN_FUSIONINVENTORY_MAC_UNKNOWN:
            switch ($action) {
                case "plugin_fusioninventory_discovery_import":
                    if (PluginFusioninventory::haveRight("unknowndevices", "w")) {
                        echo "<input type=\"submit\" name=\"massiveaction\" class=\"submit\" value=\"" . $LANG["buttons"][2] . "\" >";
                    }
                    break;
            }
            break;
    }
    return "";
}