]> git.entuzijast.net Git - freeradius-dialup-admin.git/commitdiff
* In bin/snmpfinger also accept @,. in the username
authorkkalev <kkalev>
Mon, 20 Dec 2004 16:58:16 +0000 (16:58 +0000)
committerkkalev <kkalev>
Mon, 20 Dec 2004 16:58:16 +0000 (16:58 +0000)
* If we are stripping realms, then if needed strip them from the data returned by snmpfinger in
  user_finger.php3

Changelog
bin/snmpfinger
htdocs/user_finger.php3

index 0f4c61cb6ece0e98107256323e2e581340febbfc..1a69c139fe906f4494d4a1fe4df96d3eea1d90d6 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -3,6 +3,9 @@ Ver 1.78:
 * Add a configuration directive general_sessionclear_bin
 * Add a session disconnect button in the 'clear open sessions' page
 * Also clear sessions from the sql extra servers in the 'clear open sessions' page
+* In bin/snmpfinger also accept @,. in the username
+* If we are stripping realms, then if needed strip them from the data returned by snmpfinger in
+  user_finger.php3
 Ver 1.75:
 * A LOT of security related fixes. Now dialupadmin should hopefully be secure enough to
   be accessed by normal users (not administrators).
index 68a7cade275116bf8e02ee9f9a5373f023ad415e..65003681bb80054640f1b544853651ed3ffeab0b 100755 (executable)
@@ -34,7 +34,7 @@ elsif ($type eq 'lucent'){
        $walk =`$snmpwalkcmd .iso.org.dod.internet.private.enterprises.529.10.4.1.12`;
 }
 
-while($walk=~/\"([\w\-]+?)\"/g){
+while($walk=~/\"([\@\.\w\-]+?)\"/g){
  $user=lc($1);
  if($out) {
   $out=$out.",'$user'";
index 36242f5b5c11d9fe2fa5ff23074698689dbdf713..8ea29d2ff19851079af399aea10e3c52d831ed60 100644 (file)
@@ -81,8 +81,16 @@ if ($link){
                                $nas_type = 'cisco';
 
                        $users=exec("$config[general_snmpfinger_bin] $name_data $community_data $nas_type");
-                       if (strlen($users))
+                       if (strlen($users)){
                                $extra = "AND username IN ($users)";
+                               if ($config[general_strip_realms] == 'yes'){
+                                       if ($config[general_realm_format] == 'prefix')
+                                               $match = "'[^']+" . $config[general_realm_delimiter];
+                                       else
+                                               $match = $config[general_realm_delimiter] . "[^']+'";
+                                       $extra = preg_replace("/$match/","'",$extra);
+                               }
+                       }
                }
                $search = @da_sql_query($link,$config,
                "SELECT DISTINCT username,acctstarttime,framedipaddress,callingstationid