]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
The list of users to include in the report is processed after every aliasing mechanism
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Sat, 19 Sep 2015 13:49:12 +0000 (15:49 +0200)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Sat, 19 Sep 2015 13:49:12 +0000 (15:49 +0200)
It is more logical to filter the users to include in the report after they
have been aliased to the final name. It makes it possible to identify the
final user irrespective of the name she happens to have when connecting to
the proxy.

userinfo.c

index 45d92a8e006622a208e04fc4248900fe67d8e51d..c502d89033139435368ab10635d5da6131b2e70e 100644 (file)
@@ -400,18 +400,6 @@ enum UserProcessError process_user(const char **UserPtr,const char *IpAddress,bo
                if (strlen(user)>MAX_USER_LEN)
                        return(USERERR_NameTooLong);
 
-               // include_users
-               if (IncludeUsers[0] != '\0') {
-                       char wuser[MAX_USER_LEN+2]=":";
-                       char *str;
-
-                       strcat(wuser,user);
-                       strcat(wuser,":");
-                       str=strstr(IncludeUsers,wuser);
-                       if (!str)
-                               return(USERERR_Excluded);
-               }
-
                if (testvaliduserchar(user))
                        return(USERERR_InvalidChar);
 
@@ -460,6 +448,18 @@ enum UserProcessError process_user(const char **UserPtr,const char *IpAddress,bo
                *IsIp=false;
        }
 
+       // include_users
+       if (IncludeUsers[0] != '\0') {
+               char wuser[MAX_USER_LEN+2]=":";
+               char *str;
+
+               strcat(wuser,user);
+               strcat(wuser,":");
+               str=strstr(IncludeUsers,wuser);
+               if (!str)
+                       return(USERERR_Excluded);
+       }
+
        if (user[0]=='\0' || (user[1]=='\0' && (user[0]=='-' || user[0]==' ' || user[0]==':')))
                return(USERERR_EmptyUser);