예제 #1
0
 static function createfirstaccess($ID)
 {
     global $DB;
     $plugin_fusioninventory_Profile = new PluginFusioninventoryProfile();
     if (!$plugin_fusioninventory_Profile->GetfromDB($ID)) {
         $Profile = new Profile();
         $Profile->GetfromDB($ID);
         $name = $Profile->fields["name"];
         $query = "INSERT INTO `glpi_plugin_fusioninventory_profiles` (\n                   `ID`, `name`, `interface`, `is_default`, `snmp_networking`, `snmp_printers`,\n                   `snmp_models`, `snmp_authentification`, `rangeip`, `agents`, `remotecontrol`,\n                   `agentsprocesses`, `unknowndevices`, `reports`, `deviceinventory`, `netdiscovery`,\n                   `snmp_query`, `wol`, `configuration` )\n                   VALUES ('{$ID}', '{$name}','fusioninventory','0','w','w',\n                     'w','w','w','w','w',\n                     'r','w','r','w','w',\n                     'w','w','w');";
         $DB->query($query);
     }
 }
예제 #2
0
function plugin_headings_fusioninventory($type, $ID, $withtemplate = 0)
{
    global $CFG_GLPI;
    switch ($type) {
        case PROFILE_TYPE:
            $prof = new PluginFusioninventoryProfile();
            if (!$prof->GetfromDB($ID)) {
                PluginFusioninventory::createaccess($ID);
            }
            $prof->showForm($CFG_GLPI["root_doc"] . "/plugins/fusioninventory/front/profile.php", $ID);
            break;
    }
}