Skip to content

Commit

Permalink
Remove obsolete methods. See release fusioninventory#47
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent MAZZONI committed Apr 30, 2010
1 parent f13a856 commit e1b0bfd
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 459 deletions.
12 changes: 0 additions & 12 deletions inc/auth.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,6 @@ static function initSession() {
}
}

static function changeprofile() {
if(isset($_SESSION["glpi_plugin_fusioninventory_installed"])
&& $_SESSION["glpi_plugin_fusioninventory_installed"]==1) {
$prof=new PluginFusionInventoryProfile;
if($prof->getFromDB($_SESSION['glpiactiveprofile']['ID'])) {
$_SESSION["glpi_plugin_fusioninventory_profile"]=$prof->fields;
} else {
unset($_SESSION["glpi_plugin_fusioninventory_profile"]);
}
}
}

static function haveRight($module,$right) {
// echo $_SESSION["glpiactive_entity"];
$matches=array(
Expand Down
14 changes: 0 additions & 14 deletions inc/db.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,6 @@ static function updateaccess($ID) {

}

static function getIdFromUser($name) {

global $DB;

$query = "SELECT `ID` ".
"FROM `glpi_users` ".
"WHERE `name` = '".$name."';";

if (($result = $DB->query($query))) {
return $DB->result($result,0,"ID");
}
return false;
}

static function getDeviceFieldFromId($type, $ID, $field, $return) {
global $DB;
switch($type) {
Expand Down
23 changes: 0 additions & 23 deletions inc/discovery.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,29 +103,6 @@ function addDevice($Array) {
}
}

/**
* Description
*
* @param
* @param
*
* @return
*
**/
static function update_devices($array, $target) {
global $DB;

foreach ($array as $key=>$value) {
if (strstr($key, "model_infos")) {
$explode = explode ("-", $key);
$query = "UPDATE `glpi_plugin_fusioninventory_discovery`
SET `FK_model_infos`='".$value."',`type`='".$array['type-'.$explode[1]]."'
WHERE `ID`='".$explode[1]."';";
$DB->query($query);
}
}
}

/**
* Function to import discovered device
*
Expand Down
49 changes: 0 additions & 49 deletions inc/display.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,51 +226,6 @@ static function mini_menu() {

}

static function mib_management() {
global $DB,$CFG_GLPI,$LANG;

$query = "SELECT *
FROM `glpi_plugin_fusioninventory_mib`
ORDER BY `FK_model_infos`;";
$result = $DB->query($query);
$number = $DB->numrows($result);

if($number !="0") {
echo "<div align='center'><table class='tab_cadre_fixe'>";
echo "<tr><th colspan='4'>".$LANG['plugin_fusioninventory']["model_info"][5]." :</th></tr>";
echo "<tr><th>".$LANG["common"][16]."</th>";
echo "<th>".$LANG['plugin_fusioninventory']["mib"][1]."</th>";
echo "<th>".$LANG['plugin_fusioninventory']["mib"][2]."</th>";
echo "<th>".$LANG['plugin_fusioninventory']["mib"][3]."</th>";
echo "</tr>";

while ($data=$DB->fetch_array($result)) {
echo "<tr class='tab_bg_1'>";
echo "<td align='center'><a href=''><b>
".Dropdown::getDropdownName("glpi_plugin_fusioninventory_model_infos",$data["FK_model_infos"]).
"</b></a></td>";
echo "<td align='center'>
".Dropdown::getDropdownName("glpi_plugin_fusioninventory_mib_label",$data["FK_mib_oid"])."</td>";
echo "<td align='center'>
".Dropdown::getDropdownName("glpi_plugin_fusioninventory_mib_object",$data["FK_mib_object"]).
"</td>";
echo "<td align='center'>
".Dropdown::getDropdownName("glpi_plugin_fusioninventory_mib_oid",$data["FK_mib_oid"])."</td>";
echo "</tr>";

}
echo "</table></div>";
} else {
echo "<div align='center'><table class='tab_cadre_fixe'>";
echo "<tr><th colspan='3'>".$LANG['plugin_fusioninventory']["model_info"][5].":</th></tr>";
echo "<tr><th>".$LANG["common"][16]."</th>";
echo "<th>".$LANG["login"][6]."</th>";
echo "<th>".$LANG["login"][7]."</th>";
echo "</tr>";
echo "</table></div>";
}
}

static function bar($pourcentage, $message="",$order='') {
if ((!empty($pourcentage)) AND ($pourcentage < 0)) {
$pourcentage = "";
Expand Down Expand Up @@ -352,10 +307,6 @@ static function reenableusemode() {
set_error_handler("userErrorHandler");
}
}

static function emptyDisplay() {

}
}

?>
52 changes: 0 additions & 52 deletions inc/ifmac.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,58 +58,6 @@ static function is_hex($value) {
}
}

/* To convert a string to a MAC address... Return false if not a MAC */
static function stringToIfmac($string) {
if ($string == "") {
return false;
}
// if MAC adress without any separation character : 12 characters
if (strlen($string) == 12) {
$string = str_split($string, 2);
} else {
// to seperate each element of the MAC address in an array
$string = preg_split("/[ :-]/", $string);
for ($i=0 ; $i<count($string) ; $i++) {
// if value like "0" or "x" instead of "00" or "0x", put "0" before
if (strlen($string["$i"]) == 1) {
$string["$i"] = "0".$string["$i"];
// if length not equal to 2, not a correct value => unset
} else if (strlen($string["$i"]) != 2) {
unset($string["$i"]);
}
}
if (count($string) != 6) {
return false;
}
}
// check if mac address not equal to : "00:00:00:00:00:00" and if each value is hexadecimal
$i=0;
$null=0;
while (($i<6) && ( ($is_hex = PluginFusioninventoryIfmac::is_hex($string["$i"])) != false )) {
if ($string["$i"] == "00") {
$null++;
}
$i++;
}
if (($null != 6) && ($is_hex != false)) {
$ifmac = implode (':', $string);
$ifmac = strtoupper($ifmac); // uppercase
return $ifmac;
} else {
return false;
}
}

/* transforms an hexadecimal MAC address to a decimal MAC address, like "%d.%d.%d.%d.%d.%d" */
static function ifmacToDecimal($ifmac) {
$decimal = explode(":", $ifmac);
for($i=0 ; $i<6 ; $i++) {
$decimal["$i"] = hexdec($decimal["$i"]);
}
$decimal = implode(".", $decimal);
return $decimal;
}

static function ifmacwalk_ifmacaddress($mac) {
$MacAddress = str_replace("0x","",$mac);
$MacAddress_tmp = str_split($MacAddress, 2);
Expand Down
Loading

0 comments on commit e1b0bfd

Please sign in to comment.