static function assign($id, $source_type, $source_field, $source_value)
 {
     global $DB;
     $plugin_fusioninventory_snmp = new PluginFusioninventorySNMP();
     if ($source_field == "model") {
         // Get auth
         $snmp_auth = new PluginFusioninventorySnmpauth();
         switch ($source_type) {
             case NETWORKING_TYPE:
                 $FK_snmp_auth_DB = $snmp_auth->GetSNMPAuth($id, NETWORKING_TYPE);
                 $plugin_fusioninventory_snmp->update_network_infos($id, $source_value, $FK_snmp_auth_DB);
                 break;
             case PRINTER_TYPE:
                 $FK_snmp_auth_DB = $snmp_auth->GetSNMPAuth($id, PRINTER_TYPE);
                 $plugin_fusioninventory_snmp->update_printer_infos($id, $source_value, $FK_snmp_auth_DB);
                 break;
         }
     } else {
         if ($source_field == "auth") {
             switch ($source_type) {
                 case NETWORKING_TYPE:
                     // Get model
                     $FK_model_DB = $plugin_fusioninventory_snmp->GetSNMPModel($id, NETWORKING_TYPE);
                     $plugin_fusioninventory_snmp->update_network_infos($id, $FK_model_DB, $source_value);
                     break;
                 case PRINTER_TYPE:
                     // Get model
                     $FK_model_DB = $plugin_fusioninventory_snmp->GetSNMPModel($id, PRINTER_TYPE);
                     $plugin_fusioninventory_snmp->update_printer_infos($id, $FK_model_DB, $source_value);
                     break;
             }
         }
     }
 }
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:
// ----------------------------------------------------------------------
$NEEDED_ITEMS = array("networking");
define('GLPI_ROOT', '../../..');
include GLPI_ROOT . "/inc/includes.php";
checkRight("networking", "r");
PluginFusioninventoryAuth::checkRight("snmp_networking", "r");
$plugin_fusioninventory_snmp = new PluginFusioninventorySNMP();
if (isset($_POST['update']) && isset($_POST['ID'])) {
    PluginFusioninventoryAuth::checkRight("snmp_networking", "w");
    $plugin_fusioninventory_snmp->update_network_infos($_POST['ID'], $_POST['model_infos'], $_POST['FK_snmp_connection']);
} else {
    if (isset($_POST["GetRightModel"]) && isset($_POST['ID'])) {
        $plugin_fusioninventory_model_infos = new PluginFusioninventoryModelInfos();
        $plugin_fusioninventory_model_infos->getrightmodel($_POST['ID'], NETWORKING_TYPE);
    }
}
glpi_header($_SERVER['HTTP_REFERER']);