summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2017-11-13 08:14:52 +0100
committerGitHub <noreply@github.com>2017-11-13 08:14:52 +0100
commit8e61ad884738b7fe427c7e9c7451484a8ecfc0ac (patch)
tree368d81e7083b67e086d070c862b870b902a5b874 /apps
parentf376659933ab54b42df1b179293c741a24ac36cc (diff)
parentd536e4e3b8ea608e14d0b0192bcadd216d460b4d (diff)
downloadnextcloud-server-8e61ad884738b7fe427c7e9c7451484a8ecfc0ac.tar.gz
nextcloud-server-8e61ad884738b7fe427c7e9c7451484a8ecfc0ac.zip
Merge pull request #6678 from nextcloud/downstream-ldap-configurable-user-update
LDAP: configurable user update interval
Diffstat (limited to 'apps')
-rw-r--r--apps/user_ldap/lib/User/User.php3
-rw-r--r--apps/user_ldap/tests/User/UserTest.php9
2 files changed, 9 insertions, 3 deletions
diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php
index afd43999c7f..c93d2a77d80 100644
--- a/apps/user_ldap/lib/User/User.php
+++ b/apps/user_ldap/lib/User/User.php
@@ -387,8 +387,7 @@ class User {
$lastChecked = $this->config->getUserValue($this->uid, 'user_ldap',
self::USER_PREFKEY_LASTREFRESH, 0);
- //TODO make interval configurable
- if((time() - intval($lastChecked)) < 86400 ) {
+ if((time() - intval($lastChecked)) < intval($this->config->getAppValue('user_ldap', 'updateAttributesInterval', 86400)) ) {
return false;
}
return true;
diff --git a/apps/user_ldap/tests/User/UserTest.php b/apps/user_ldap/tests/User/UserTest.php
index 5e911159285..27bd7762e39 100644
--- a/apps/user_ldap/tests/User/UserTest.php
+++ b/apps/user_ldap/tests/User/UserTest.php
@@ -871,7 +871,14 @@ class UserTest extends \Test\TestCase {
->with($this->equalTo('alice'), $this->equalTo('user_ldap'),
$this->equalTo(User::USER_PREFKEY_LASTREFRESH),
$this->equalTo(0))
- ->will($this->returnValue(time()));
+ ->will($this->returnValue(time() - 10));
+
+ $config->expects($this->once())
+ ->method('getAppValue')
+ ->with($this->equalTo('user_ldap'),
+ $this->equalTo('updateAttributesInterval'),
+ $this->anything())
+ ->will($this->returnValue(1800));
$config->expects($this->exactly(2))
->method('getUserValue');
$config->expects($this->never())