From 764cb72cd5acb29055a063b3a6d6fff8d0e3d707 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Tue, 10 Apr 2012 15:53:10 +0000 Subject: [PATCH] fixes and cleanups git-svn-id: http://www.observium.org/svn/observer/trunk@3018 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/authentication/http-auth.inc.php | 4 ++-- html/includes/authentication/ldap.inc.php | 4 ++-- html/includes/authentication/mysql.inc.php | 2 +- includes/polling/netstats-ip.inc.php | 2 +- includes/polling/netstats-tcp.inc.php | 2 +- includes/polling/netstats-udp.inc.php | 2 +- includes/snmp.inc.php | 3 --- 7 files changed, 8 insertions(+), 11 deletions(-) diff --git a/html/includes/authentication/http-auth.inc.php b/html/includes/authentication/http-auth.inc.php index 141d80c2f..1fda198f4 100644 --- a/html/includes/authentication/http-auth.inc.php +++ b/html/includes/authentication/http-auth.inc.php @@ -27,7 +27,7 @@ function authenticate($username,$password) return 0; } -function passwordscanchange() +function passwordscanchange($username = "") { return 0; } @@ -42,7 +42,7 @@ function auth_usermanagement() return 1; } -function adduser($username, $password, $level, $email = "", $realname = "") +function adduser($username, $password, $level, $email = "", $realname = "", $can_modify_passwd = '1') { return dbInsert(array('username' => $username, 'password' => $password, 'level' => $level, 'email' => $email, 'realname' => $realname), 'users'); } diff --git a/html/includes/authentication/ldap.inc.php b/html/includes/authentication/ldap.inc.php index facb62f30..1783fb8ee 100644 --- a/html/includes/authentication/ldap.inc.php +++ b/html/includes/authentication/ldap.inc.php @@ -47,7 +47,7 @@ function authenticate($username,$password) return 0; } -function passwordscanchange() +function passwordscanchange($username = "") { return 0; } @@ -62,7 +62,7 @@ function auth_usermanagement() return 0; } -function adduser($username, $password, $level, $email = "", $realname = "") +function adduser($username, $password, $level, $email = "", $realname = "", $can_modify_passwd = '1') { # Not supported return 0; diff --git a/html/includes/authentication/mysql.inc.php b/html/includes/authentication/mysql.inc.php index 080823c2f..14df72852 100644 --- a/html/includes/authentication/mysql.inc.php +++ b/html/includes/authentication/mysql.inc.php @@ -24,7 +24,7 @@ function authenticate($username,$password) return 0; } -function passwordscanchange($username="") +function passwordscanchange($username = "") { /* * By default allow the password to be modified, unless the existing diff --git a/includes/polling/netstats-ip.inc.php b/includes/polling/netstats-ip.inc.php index ebe16d18a..42e2d4429 100755 --- a/includes/polling/netstats-ip.inc.php +++ b/includes/polling/netstats-ip.inc.php @@ -23,7 +23,7 @@ if ($device['os'] != "Snom") $snmpstring .= " IP-MIB::".$oid.".0"; } - $data = snmp_get_multi($device, $snmpstring, NULL, "IP-MIB"); + $data = snmp_get_multi($device, $snmpstring, "-OQUs", "IP-MIB"); $rrdupdate = "N"; diff --git a/includes/polling/netstats-tcp.inc.php b/includes/polling/netstats-tcp.inc.php index b1946c2d1..b4fd32f80 100755 --- a/includes/polling/netstats-tcp.inc.php +++ b/includes/polling/netstats-tcp.inc.php @@ -27,7 +27,7 @@ if ($device['os'] != "Snom") $snmpstring .= " tcpHCInSegs.0"; $snmpstring .= " tcpHCOutSegs.0"; - $data = snmp_get_multi($device, $snmpstring, NULL, "TCP-MIB"); + $data = snmp_get_multi($device, $snmpstring, "-OQUs", "TCP-MIB"); $rrdupdate = "N"; diff --git a/includes/polling/netstats-udp.inc.php b/includes/polling/netstats-udp.inc.php index 56e407734..4d1417d04 100755 --- a/includes/polling/netstats-udp.inc.php +++ b/includes/polling/netstats-udp.inc.php @@ -22,7 +22,7 @@ if ($device['os'] != "Snom") $snmpstring .= " UDP-MIB::".$oid.".0"; } - $data = snmp_get_multi($device, $snmpstring, NULL, "UDP-MIB"); + $data = snmp_get_multi($device, $snmpstring, "-OQUs", "UDP-MIB"); $rrdupdate = "N"; diff --git a/includes/snmp.inc.php b/includes/snmp.inc.php index 455c42b61..49cb8e299 100644 --- a/includes/snmp.inc.php +++ b/includes/snmp.inc.php @@ -14,8 +14,6 @@ function snmp_get_multi($device, $oids, $options = "-OQUs", $mib = NULL, $mibdir { global $debug,$config,$runtime_stats,$mibs_loaded; - if (!$options) { $options = "-OQUs"; } - if (is_numeric($device['timeout']) && $device['timeout'] > 0) { $timeout = $device['timeout']; @@ -133,7 +131,6 @@ function snmp_walk($device, $oid, $options = NULL, $mib = NULL, $mibdir = NULL) $device['transport'] = "udp"; } - // php has no bulkwalk functionality, so use binary for this. if ($device['snmpver'] == 'v1' || $config['os'][$device['os']]['nobulk']) { $snmpcommand = $config['snmpwalk'];