mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor: snmp cleanup (#4683)
This commit is contained in:
committed by
Neil Lathwood
parent
d9c0614b30
commit
07e8e9f2be
@@ -1461,6 +1461,30 @@ function starts_with($haystack, $needles, $case_insensitive = false)
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search backwards for the $needle, returning $count found occurrence
|
||||
*
|
||||
* @param string $haystack
|
||||
* @param string $needle
|
||||
* @param int $count
|
||||
* @return bool|int
|
||||
*/
|
||||
function strrpos_count($haystack, $needle, $count = 1)
|
||||
{
|
||||
if ($count <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$len = strlen($haystack);
|
||||
$pos = $len;
|
||||
|
||||
for ($i = 0; $i < $count && $pos; $i++) {
|
||||
$pos = strrpos($haystack, $needle, $pos - $len - 1);
|
||||
}
|
||||
|
||||
return $pos;
|
||||
}
|
||||
|
||||
function get_auth_ad_user_filter($username)
|
||||
{
|
||||
global $config;
|
||||
|
||||
Reference in New Issue
Block a user