summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
authorRoger Szabo <roger.szabo@web.de>2017-04-06 16:57:07 +0800
committerRoger Szabo <roger.szabo@web.de>2017-04-06 16:57:07 +0800
commitf49ff74943f486e85c658a7daa56ee52e971e2e8 (patch)
treecfa53c1ccab99e52fc19310fc7477500775fef59 /apps/user_ldap
parent33c8bf18575dd618f4df33a0da64f627910aa4b4 (diff)
downloadnextcloud-server-f49ff74943f486e85c658a7daa56ee52e971e2e8.tar.gz
nextcloud-server-f49ff74943f486e85c658a7daa56ee52e971e2e8.zip
blizzz comments 03.04.2017 with caching
Signed-off-by: Roger Szabo <roger.szabo@web.de>
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/lib/User/User.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php
index a3ba7c8c85c..cdffaf97446 100644
--- a/apps/user_ldap/lib/User/User.php
+++ b/apps/user_ldap/lib/User/User.php
@@ -625,8 +625,13 @@ class User {
$pwdChangedTime = array_key_exists('pwdchangedtime', $result[0]) ? $result[0]['pwdchangedtime'] : null;
//retrieve relevant password policy attributes
- $result = $this->access->search('objectclass=*', $ppolicyDN, ['cn','pwdgraceauthnlimit', 'pwdmaxage', 'pwdexpirewarning']);
-
+ $cacheKey = 'ppolicyAttributes' . $ppolicyDN;
+ $result = $this->connection->getFromCache($cacheKey);
+ if(is_null($result)) {
+ $result = $this->access->search('objectclass=*', $ppolicyDN, ['cn','pwdgraceauthnlimit', 'pwdmaxage', 'pwdexpirewarning']);
+ $this->connection->writeToCache($cacheKey, $result);
+ }
+
$pwdGraceAuthNLimit = array_key_exists('pwdgraceauthnlimit', $result[0]) ? $result[0]['pwdgraceauthnlimit'] : null;
$pwdMaxAge = array_key_exists('pwdmaxage', $result[0]) ? $result[0]['pwdmaxage'] : null;
$pwdExpireWarning = array_key_exists('pwdexpirewarning', $result[0]) ? $result[0]['pwdexpirewarning'] : null;