Merge pull request #6678 from nextcloud/downstream-ldap-configurable-user-update
LDAP: configurable user update interval
This commit is contained in:
commit
8e61ad8847
|
@ -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;
|
||||
|
|
|
@ -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())
|
||||
|
|
Loading…
Reference in New Issue