summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-06-16 17:04:19 +0200
committerGitHub <noreply@github.com>2016-06-16 17:04:19 +0200
commit82beee57e45fd9c9df0f5730e51258240479b956 (patch)
tree71126fbe40ff964c6c115f500559e94765e31027 /lib
parent3917969728177d2978bb93be4d9a1271e2040d5a (diff)
parent3521f974db2cf7bebac66ab4c987bb3c67d5d02f (diff)
downloadnextcloud-server-82beee57e45fd9c9df0f5730e51258240479b956.tar.gz
nextcloud-server-82beee57e45fd9c9df0f5730e51258240479b956.zip
Merge pull request #25132 from owncloud/2fa-load-apps-before-query
load 2FA provider apps before querying classes
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Authentication/TwoFactorAuth/Manager.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/private/Authentication/TwoFactorAuth/Manager.php b/lib/private/Authentication/TwoFactorAuth/Manager.php
index 805735bd1b8..6ca4fd065a6 100644
--- a/lib/private/Authentication/TwoFactorAuth/Manager.php
+++ b/lib/private/Authentication/TwoFactorAuth/Manager.php
@@ -24,6 +24,7 @@ namespace OC\Authentication\TwoFactorAuth;
use Exception;
use OC;
use OC\App\AppManager;
+use OC_App;
use OCP\AppFramework\QueryException;
use OCP\Authentication\TwoFactorAuth\IProvider;
use OCP\IConfig;
@@ -110,6 +111,7 @@ class Manager {
$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) {
@@ -126,6 +128,17 @@ class Manager {
}
/**
+ * Load an app by ID if it has not been loaded yet
+ *
+ * @param string $appId
+ */
+ protected function loadTwoFactorApp($appId) {
+ if (!OC_App::isAppLoaded($appId)) {
+ OC_App::loadApp($appId);
+ }
+ }
+
+ /**
* Verify the given challenge
*
* @param string $providerId