Fix a few bugs in log_badlogins
authorkkalev <kkalev>
Fri, 8 Nov 2002 07:18:13 +0000 (07:18 +0000)
committerkkalev <kkalev>
Fri, 8 Nov 2002 07:18:13 +0000 (07:18 +0000)
dialup_admin/Changelog
dialup_admin/bin/log_badlogins

index 023c406..5530795 100644 (file)
@@ -4,6 +4,7 @@ Ver 1.61:
   language specific user attributes will be added in the change info and new user pages. Remove comments from
   admin.conf about the change info page not working if this directive is used.
 * When spliting cn in lib/ldap/create_user.php3 limit the split to 2 new elements not 3.
+* Fix a few bugs in log_badlogins
 Ver 1.60:
 * Use require_once when including lib/functions.php3 in lib/sql
 * In the buttons toolbar Edit User should not be clickable.
index a3228b7..99d3fb5 100755 (executable)
@@ -59,7 +59,7 @@ for(;;){
                        $user = $nas = $port = $caller = '-';
                        if (/Login incorrect/){
                                if (/Login incorrect \((.+?)\):/){
-                                       $cause = 'Login-Incorrect ($1)';
+                                       $cause = "Login-Incorrect ($1)";
                                }else{
                                        $cause='Login-Incorrect';
                                }
@@ -67,7 +67,7 @@ for(;;){
                        }
                        elsif (/Invalid user/){
                                if (/Invalid user \((.+?)\):/){
-                                       $cause = 'Invalid-User ($1)';
+                                       $cause = "Invalid-User ($1)";
                                }else{
                                        $cause='Invalid-User';
                                }
@@ -78,7 +78,7 @@ for(;;){
                                $do=1;
                        }
                        elsif (/(Outside allowed timespan \(.+?\)):/){
-                               $cause = '$1';
+                               $cause = "$1";
                                $do=1;
                        }
                        if ($do){
@@ -97,8 +97,8 @@ for(;;){
                                        ($nas,$port,$caller) = (split /\s+/,$2)[1,3,5];
                                }
                                $caller='' if (!defined($caller));
-                               $user =~s/[^\w]//g;
-                               $nas =~s/[^\w]//g;
+                               $user =~s/[^\w\-\.]//g;
+                               $nas =~s/[^\w\.]//g;
                                if ($nas ne 'localhost' && $nas !~ /\.$domain$/){
                                        $nas .= '.$domain';
                                }