Moved DN cache to SOGoCache

This commit is contained in:
Ludovic Marcotte
2014-02-04 21:03:11 -05:00
parent 9885211a5b
commit 3950e9d4c3
5 changed files with 39 additions and 19 deletions
+22 -5
View File
@@ -1,9 +1,6 @@
/* SOGoCache.m - this file is part of SOGo
*
* Copyright (C) 2008-2013 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Ludovic Marcotte <lmarcotte@inverse.ca>
* Copyright (C) 2008-2014 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -34,6 +31,9 @@
* <uid>+defaults value = NSDictionary instance > user's defaults
* <uid>+settings value = NSDictionary instance > user's settings
* <uid>+attributes value = NSMutableDictionary instance > user's LDAP attributes
* <uid>+failedlogins value =
* <uid>+messagesubmissions value =
* <uid>+dn value = NSString instance > cached user's DN
* <object path>+acl value = NSDictionary instance > ACLs on an object at specified path
* <groupname>+<domain> value = NSString instance (array components separated by ",") or group member logins for a specific group in domain
* cas-id:< > value =
@@ -435,7 +435,9 @@ static memcached_st *handle = NULL;
}
//
//
// Try to hit the local cache. If it misses, it'll
// then try memcached. If it hits memcached, it'll
// populate the local cache.
//
- (NSString *) _valuesOfType: (NSString *) theType
forKey: (NSString *) theKey
@@ -604,6 +606,21 @@ static memcached_st *handle = NULL;
return d;
}
//
// DN caching
//
- (NSString *) distinguishedNameForLogin: (NSString *) theLogin
{
return [self _valuesOfType: @"dn" forKey: theLogin];
}
- (void) setDistinguishedName: (NSString *) theDN
forLogin: (NSString *) theLogin
{
[self _cacheValues: theDN
ofType: @"dn"
forKey: theLogin];
}
//
// CAS session support