Skip to content

Commit

Permalink
Rename glpi_dropdown_plugin_fusioninventory_snmp_auth_auth_protocol t…
Browse files Browse the repository at this point in the history
…able to glpi_plugin_fusioninventory_snmpprotocolauths, add PluginFusioninventorySnmpprotocolauth class in inc/snmpprotocolauth.class.php file and related files. See release fusioninventory#47
  • Loading branch information
Vincent MAZZONI committed Apr 28, 2010
1 parent 3696260 commit 3221930
Show file tree
Hide file tree
Showing 7 changed files with 193 additions and 8 deletions.
45 changes: 45 additions & 0 deletions ajax/snmpprotocolauth.tabs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php
/*
* @version $Id:$
-------------------------------------------------------------------------
GLPI - Gestionnaire Libre de Parc Informatique
Copyright (C) 2003-2010 by the INDEPNET Development Team.
http://indepnet.net/ http://glpi-project.org
-------------------------------------------------------------------------
LICENSE
This file is part of GLPI.
GLPI is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(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: Vincent MAZZONI
// Purpose of file:
// ----------------------------------------------------------------------


define('GLPI_ROOT', '../../..');
include (GLPI_ROOT . "/inc/includes.php");

Plugin::load('fusioninventory',true);

$dropdown = new PluginFusioninventorySnmpprotocolauth();
include (GLPI_ROOT . "/ajax/dropdown.common.tabs.php");

?>
44 changes: 44 additions & 0 deletions front/snmpprotocolauth.form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/*
* @version $Id:$
-------------------------------------------------------------------------
GLPI - Gestionnaire Libre de Parc Informatique
Copyright (C) 2003-2010 by the INDEPNET Development Team.
http://indepnet.net/ http://glpi-project.org
-------------------------------------------------------------------------
LICENSE
This file is part of GLPI.
GLPI is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(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: Vincent MAZZONI
// Purpose of file:
// ----------------------------------------------------------------------


define('GLPI_ROOT', '../../..');
include (GLPI_ROOT . "/inc/includes.php");

Plugin::load('fusioninventory',true);

$dropdown = new PluginFusioninventorySnmpprotocolauth();
include (GLPI_ROOT . "/front/dropdown.common.form.php");
?>
44 changes: 44 additions & 0 deletions front/snmpprotocolauth.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/*
* @version $Id:$
-------------------------------------------------------------------------
GLPI - Gestionnaire Libre de Parc Informatique
Copyright (C) 2003-2010 by the INDEPNET Development Team.
http://indepnet.net/ http://glpi-project.org
-------------------------------------------------------------------------
LICENSE
This file is part of GLPI.
GLPI is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(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: Vincent MAZZONI
// Purpose of file:
// ----------------------------------------------------------------------


define('GLPI_ROOT', '../../..');
include (GLPI_ROOT . "/inc/includes.php");

Plugin::load('fusioninventory',true);

$dropdown = new PluginFusioninventorySnmpprotocolauth();
include (GLPI_ROOT . "/front/dropdown.common.php");
?>
2 changes: 1 addition & 1 deletion hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function plugin_fusioninventory_getSearchOption() {
$sopt[PLUGIN_FUSIONINVENTORY_SNMP_AUTH][5]['linkfield'] = 'sec_name';
$sopt[PLUGIN_FUSIONINVENTORY_SNMP_AUTH][5]['name'] = $LANG['plugin_fusioninventory']["snmpauth"][2];

$sopt[PLUGIN_FUSIONINVENTORY_SNMP_AUTH][7]['table'] = 'glpi_dropdown_plugin_fusioninventory_snmp_auth_auth_protocol';
$sopt[PLUGIN_FUSIONINVENTORY_SNMP_AUTH][7]['table'] = 'glpi_plugin_fusioninventory_snmpprotocolauths';
$sopt[PLUGIN_FUSIONINVENTORY_SNMP_AUTH][7]['field'] = 'name';
$sopt[PLUGIN_FUSIONINVENTORY_SNMP_AUTH][7]['linkfield'] = 'auth_protocol';
$sopt[PLUGIN_FUSIONINVENTORY_SNMP_AUTH][7]['name'] = $LANG['plugin_fusioninventory']["snmpauth"][4];
Expand Down
2 changes: 1 addition & 1 deletion inc/communication.classes.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ function addAuth($p_sxml_node, $p_id) {
$sxml_authentication->addAttribute('AUTHPROTOCOL', '');
} else {
$sxml_authentication->addAttribute('AUTHPROTOCOL',
Dropdown::getDropdownName('glpi_dropdown_plugin_fusioninventory_snmp_auth_auth_protocol',
Dropdown::getDropdownName('glpi_plugin_fusioninventory_snmpprotocolauths',
$ptsnmpa->fields['auth_protocol']));
}
$sxml_authentication->addAttribute('AUTHPASSPHRASE', $ptsnmpa->fields['auth_passphrase']);
Expand Down
12 changes: 6 additions & 6 deletions inc/snmpauth.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function showForm($target, $ID = '') {
echo "<tr class='tab_bg_1'>";
echo "<td align='center'>" . $LANG['plugin_fusioninventory']["snmpauth"][4] . "</td>";
echo "<td align='center'>";
dropdownValue("glpi_dropdown_plugin_fusioninventory_snmp_auth_auth_protocol", "auth_protocol",
dropdownValue("glpi_plugin_fusioninventory_snmpprotocolauths", "auth_protocol",
$this->fields["auth_protocol"], 0);
echo "</td>";
echo "</tr>";
Expand Down Expand Up @@ -210,7 +210,7 @@ function plugin_fusioninventory_snmp_connections($array=0) {

case 7:
$auth_protocol[$i] = Dropdown::getDropdownName(
"glpi_dropdown_plugin_fusioninventory_snmp_auth_auth_protocol",$item);
"glpi_plugin_fusioninventory_snmpprotocolauths",$item);
if ($auth_protocol[$i] == "&nbsp;") {
$auth_protocol[$i] = "";
}
Expand Down Expand Up @@ -508,11 +508,11 @@ function GetInfos($ID_Device,$xml_auth_rep,$type) {
case 7:
if (($recup == "1") AND ($ID_Device != "all")) {
$snmp_auth["auth_protocol"] = Dropdown::getDropdownName(
"glpi_dropdown_plugin_fusioninventory_snmp_auth_auth_protocol",$item);
"glpi_plugin_fusioninventory_snmpprotocolauths",$item);
}
if ($ID_Device == "all") {
$snmp_auth[($i+2)]["auth_protocol"] = Dropdown::getDropdownName(
"glpi_dropdown_plugin_fusioninventory_snmp_auth_auth_protocol",$item);
"glpi_plugin_fusioninventory_snmpprotocolauths",$item);
}
break;

Expand Down Expand Up @@ -574,7 +574,7 @@ function GetInfos($ID_Device,$xml_auth_rep,$type) {
$snmp_auth["community"] = $DB->result($result,0,"community");
$snmp_auth["sec_name"] = $DB->result($result,0,"sec_name");
$snmp_auth["auth_protocol"] = Dropdown::getDropdownName(
"glpi_dropdown_plugin_fusioninventory_snmp_auth_auth_protocol",$DB->result($result,0,
"glpi_plugin_fusioninventory_snmpprotocolauths",$DB->result($result,0,
"auth_protocol"));
$snmp_auth["auth_passphrase"] = $DB->result($result,0,"auth_passphrase");
$snmp_auth["priv_protocol"] = Dropdown::getDropdownName(
Expand Down Expand Up @@ -602,7 +602,7 @@ function GetInfos($ID_Device,$xml_auth_rep,$type) {
$snmp_auth[$i]["community"] = $data["community"];
$snmp_auth[$i]["sec_name"] = $data["sec_name"];
$snmp_auth[$i]["auth_protocol"] = Dropdown::getDropdownName(
"glpi_dropdown_plugin_fusioninventory_snmp_auth_auth_protocol",$data["auth_protocol"]);
"glpi_plugin_fusioninventory_snmpprotocolauths",$data["auth_protocol"]);
$snmp_auth[$i]["auth_passphrase"] = $data["auth_passphrase"];
$snmp_auth[$i]["priv_protocol"] = Dropdown::getDropdownName(
"glpi_dropdown_plugin_fusioninventory_snmp_auth_priv_protocol",$data["priv_protocol"]);
Expand Down
52 changes: 52 additions & 0 deletions inc/snmpprotocolauth.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php
/*
* @version $Id$
----------------------------------------------------------------------
GLPI - Gestionnaire Libre de Parc Informatique
Copynetwork (C) 2003-2010 by the INDEPNET Development Team.
http://indepnet.net/ http://glpi-project.org/
----------------------------------------------------------------------
LICENSE
This file is part of GLPI.
GLPI is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(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:
// ----------------------------------------------------------------------

if (!defined('GLPI_ROOT')) {
die("Sorry. You can't access directly to this file");
}

class PluginFusioninventorySnmpprotocolauth extends CommonDropdown {
// From CommonDBTM
public $table = 'glpi_plugin_fusioninventory_snmpprotocolauths';
public $type = 'PluginFusioninventorySnmpprotocolauth';

static function getTypeName() {
global $LANG;

return "Plugin Fusioninventory Snmp protocol auth";
}
}

?>

0 comments on commit 3221930

Please sign in to comment.