diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-06-10 12:12:07 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-06-10 12:12:07 +0200 |
commit | 13017ce9e114d84ba9b4ced240e5648447fdfe45 (patch) | |
tree | 5a4ae7b311319a239d9c6792cefc879b5558d1cc /apps/user_ldap/lib/jobs.php | |
parent | b25ab94a08ab9ba5e322043ac470d5352d456c71 (diff) | |
parent | db06b906e50d7d1b7eca28f51db913af1fbc81f1 (diff) | |
download | nextcloud-server-13017ce9e114d84ba9b4ced240e5648447fdfe45.tar.gz nextcloud-server-13017ce9e114d84ba9b4ced240e5648447fdfe45.zip |
Merge branch 'master' into files_encryption_check_private_key
Conflicts:
settings/ajax/changepassword.php
Diffstat (limited to 'apps/user_ldap/lib/jobs.php')
-rw-r--r-- | apps/user_ldap/lib/jobs.php | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/apps/user_ldap/lib/jobs.php b/apps/user_ldap/lib/jobs.php index 094d11db3d5..60ecc0da33d 100644 --- a/apps/user_ldap/lib/jobs.php +++ b/apps/user_ldap/lib/jobs.php @@ -23,20 +23,22 @@ namespace OCA\user_ldap\lib; -class Jobs { +class Jobs extends \OC\BackgroundJob\TimedJob { static private $groupsFromDB; static private $groupBE; static private $connector; + public function __construct(){ + $this->interval = self::getRefreshInterval(); + } + + public function run($argument){ + Jobs::updateGroups(); + } + static public function updateGroups() { \OCP\Util::writeLog('user_ldap', 'Run background job "updateGroups"', \OCP\Util::DEBUG); - $lastUpdate = \OCP\Config::getAppValue('user_ldap', 'bgjUpdateGroupsLastRun', 0); - if((time() - $lastUpdate) < self::getRefreshInterval()) { - \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – last run too fresh, aborting.', \OCP\Util::DEBUG); - //komm runter Werner die Maurer geben ein aus - return; - } $knownGroups = array_keys(self::getKnownGroups()); $actualGroups = self::getGroupBE()->getGroups(); @@ -45,7 +47,6 @@ class Jobs { \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – groups do not seem to be configured properly, aborting.', \OCP\Util::INFO); - \OCP\Config::setAppValue('user_ldap', 'bgjUpdateGroupsLastRun', time()); return; } @@ -53,8 +54,6 @@ class Jobs { self::handleCreatedGroups(array_diff($actualGroups, $knownGroups)); self::handleRemovedGroups(array_diff($knownGroups, $actualGroups)); - \OCP\Config::setAppValue('user_ldap', 'bgjUpdateGroupsLastRun', time()); - \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – Finished.', \OCP\Util::DEBUG); } |