changed from isset to !empty

This commit is contained in:
Neil Lathwood
2016-10-03 18:23:59 +01:00
parent 032bfe0745
commit 59da343f7d

View File

@ -560,7 +560,7 @@ function snmp_gen_auth(&$device)
if ($device['authlevel'] === 'noAuthNoPriv') {
// We have to provide a username anyway (see Net-SNMP doc)
$username = isset($device['authname']) ? $device['authname'] : 'root';
$username = !empty($device['authname']) ? $device['authname'] : 'root';
$cmd .= " -u '".$username."'";
} elseif ($device['authlevel'] === 'authNoPriv') {
$cmd .= " -a '".$device['authalgo']."'";