mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-13 11:12:22 -05:00
LDAP: fix regression on OSX directory request on iCal start: filter invalid imapUid condition
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1307 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
2bfb33807a
commit
9e779b2826
@ -1091,11 +1091,19 @@ public class LdapConnection extends AbstractConnection {
|
|||||||
ExchangeSession.Condition condition = null;
|
ExchangeSession.Condition condition = null;
|
||||||
|
|
||||||
if (operator == LDAP_FILTER_EQUALITY) {
|
if (operator == LDAP_FILTER_EQUALITY) {
|
||||||
condition = session.isEqualTo(contactAttributeName, value);
|
try {
|
||||||
|
// check imapUid value
|
||||||
|
if ("imapUid".equals(contactAttributeName)) {
|
||||||
|
Integer.parseInt(value);
|
||||||
|
}
|
||||||
|
condition = session.isEqualTo(contactAttributeName, value);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
// ignore condition
|
||||||
|
}
|
||||||
} else if ("*".equals(value)) {
|
} else if ("*".equals(value)) {
|
||||||
condition = session.not(session.isNull(contactAttributeName));
|
condition = session.not(session.isNull(contactAttributeName));
|
||||||
// do not allow substring search on integer field imapUid
|
// do not allow substring search on integer field imapUid
|
||||||
} else if (!"imapUid".equals(contactAttributeName)){
|
} else if (!"imapUid".equals(contactAttributeName)) {
|
||||||
// endsWith not supported by exchange, convert to contains
|
// endsWith not supported by exchange, convert to contains
|
||||||
if (mode == LDAP_SUBSTRING_FINAL || mode == LDAP_SUBSTRING_ANY) {
|
if (mode == LDAP_SUBSTRING_FINAL || mode == LDAP_SUBSTRING_ANY) {
|
||||||
condition = session.contains(contactAttributeName, value);
|
condition = session.contains(contactAttributeName, value);
|
||||||
@ -1387,7 +1395,7 @@ public class LdapConnection extends AbstractConnection {
|
|||||||
*
|
*
|
||||||
* @param condition search filter
|
* @param condition search filter
|
||||||
* @param returningAttributes requested attributes
|
* @param returningAttributes requested attributes
|
||||||
* @param maxCount maximum item count
|
* @param maxCount maximum item count
|
||||||
* @return List of users
|
* @return List of users
|
||||||
* @throws IOException on error
|
* @throws IOException on error
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user