diff options
author | Joas Schilling <coding@schilljs.com> | 2016-07-23 15:49:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-23 15:49:28 +0200 |
commit | dddd43f5be25e7043f17b2d5f8481f6246fb6a09 (patch) | |
tree | dc4c927787c5a2fe9ff64c55e4c262835ab3defe | |
parent | e36decc12b9bb6dfcf0a8d6acb2c34d2f82a2e04 (diff) | |
parent | 681ac9f19ff023da917da5a6f34cb1dadfb6dfb1 (diff) | |
download | nextcloud-server-dddd43f5be25e7043f17b2d5f8481f6246fb6a09.tar.gz nextcloud-server-dddd43f5be25e7043f17b2d5f8481f6246fb6a09.zip |
Merge pull request #534 from nextcloud/twofactor-isset
Check if an app provide two-factor-auth providers before we try to use them
-rw-r--r-- | lib/private/Authentication/TwoFactorAuth/Manager.php | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/private/Authentication/TwoFactorAuth/Manager.php b/lib/private/Authentication/TwoFactorAuth/Manager.php index bca75263a71..66bcafbce71 100644 --- a/lib/private/Authentication/TwoFactorAuth/Manager.php +++ b/lib/private/Authentication/TwoFactorAuth/Manager.php @@ -109,15 +109,17 @@ class Manager { foreach ($allApps as $appId) { $info = $this->appManager->getAppInfo($appId); - $providerClasses = $info['two-factor-providers']; - foreach ($providerClasses as $class) { - try { - $this->loadTwoFactorApp($appId); - $provider = OC::$server->query($class); - $providers[$provider->getId()] = $provider; - } catch (QueryException $exc) { - // Provider class can not be resolved - throw new Exception("Could not load two-factor auth provider $class"); + if (isset($info['two-factor-providers'])) { + $providerClasses = $info['two-factor-providers']; + foreach ($providerClasses as $class) { + try { + $this->loadTwoFactorApp($appId); + $provider = OC::$server->query($class); + $providers[$provider->getId()] = $provider; + } catch (QueryException $exc) { + // Provider class can not be resolved + throw new Exception("Could not load two-factor auth provider $class"); + } } } } |