summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-11-28 10:23:30 +0100
committerGitHub <noreply@github.com>2016-11-28 10:23:30 +0100
commit1887fd32f1f2b265d603882849ae0605ebc62502 (patch)
treed9077732ff46a15524cc6cb96b0cf22b82cb8e1b
parentad610ae77239af5a1ddd33a8de9da312502eec4e (diff)
parent2f36920ddf019c5fcd38420acf9e570d4c1ac267 (diff)
downloadnextcloud-server-1887fd32f1f2b265d603882849ae0605ebc62502.tar.gz
nextcloud-server-1887fd32f1f2b265d603882849ae0605ebc62502.zip
Merge pull request #2361 from nextcloud/2fa-backup-codes-undefined-index
fix undefined index error when the backup codes provider is not active
-rw-r--r--lib/private/Authentication/TwoFactorAuth/Manager.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/Authentication/TwoFactorAuth/Manager.php b/lib/private/Authentication/TwoFactorAuth/Manager.php
index d84ba4aee7e..48792aa685b 100644
--- a/lib/private/Authentication/TwoFactorAuth/Manager.php
+++ b/lib/private/Authentication/TwoFactorAuth/Manager.php
@@ -106,6 +106,9 @@ class Manager {
*/
public function getBackupProvider(IUser $user) {
$providers = $this->getProviders($user, true);
+ if (!isset($providers[self::BACKUP_CODES_PROVIDER_ID])) {
+ return null;
+ }
return $providers[self::BACKUP_CODES_PROVIDER_ID];
}