Hi,

when I try to use the filter with email address or eduPersonPrincipalName (which usually has an email-like structure) and include a '@' character, I get an error:

"Please enter a valid filter. Only letters, numbers and " _*$.-" are allowed."

Using '/ldapsearch -x "(mail=*@gmail.com)"/' works normally, so I it is a LAM restriction.

So I changed the 'listBuildFilter' in 'lib/lists.inc' a little so I can use the '@' character in filters.



 Best regards, Danilo


--- lam-cvs/lib/lists.inc.orig	2011-11-01 18:14:54.000000000 +0100
+++ lam-cvs/lib/lists.inc	2011-11-11 10:46:56.789451202 +0100
@@ -212,12 +212,12 @@
 				$foundFilter = $_POST["filter" . strtolower($this->attrArray[$i])];
 			}
 			if (isset($foundFilter) && ($foundFilter != '')) {
-				if (preg_match('/^([\p{L}\p{N} _\\*\\$\\.-])+$/iu', $foundFilter)) { // \p{L} matches any Unicode letter
+				if (preg_match('/^([\p{L}\p{N} _\\*\\$\\.\\@-])+$/iu', $foundFilter)) { // \p{L} matches any Unicode letter
 					$filterParam .= "&filter" . $this->attrArray[$i] . '=' . $foundFilter;
 					$LDAPFilterPart .= '(' . $this->attrArray[$i] . '=' . $foundFilter . ')';
 				}
 				else {
-					StatusMessage('ERROR', _('Please enter a valid filter. Only letters, numbers and " _*$.-" are allowed.'), htmlspecialchars($foundFilter));
+					StatusMessage('ERROR', _('Please enter a valid filter. Only letters, numbers and " _*$.@-" are allowed.'), htmlspecialchars($foundFilter));
 				}
 			}
 		}
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Lam-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lam-public

Reply via email to