<ul class="containerList">
{foreach from=$multifactorMethods item=method}
- <li class="box64">
- <div>
- <span class="icon icon64 fa-{if $method->icon}{$method->icon}{else}lock{/if}"></span>
- </div>
-
- <div class="accountSecurityContainer">
- <div class="containerHeadline accountSecurityInformation">
- <h3>
- {lang}wcf.user.security.multifactor.{$method->objectType}{/lang}
+ {if $method->objectType !== 'com.woltlab.wcf.multifactor.backup' || $enabledMultifactorMethods[$method->objectTypeID]|isset}
+ <li class="box64">
+ <div>
+ <span class="icon icon64 fa-{if $method->icon}{$method->icon}{else}lock{/if}"></span>
+ </div>
+
+ <div class="accountSecurityContainer">
+ <div class="containerHeadline accountSecurityInformation">
+ <h3>
+ {lang}wcf.user.security.multifactor.{$method->objectType}{/lang}
+
+ {if $enabledMultifactorMethods[$method->objectTypeID]|isset}
+ <span class="badge green">
+ {lang}wcf.user.security.multifactor.active{/lang}
+ </span>
+ {/if}
+ </h3>
{if $enabledMultifactorMethods[$method->objectTypeID]|isset}
- <span class="badge green">
- {lang}wcf.user.security.multifactor.active{/lang}
- </span>
+ {@$method->getProcessor()->getStatusText($enabledMultifactorMethods[$method->objectTypeID])}
{/if}
- </h3>
+ </div>
- {if $enabledMultifactorMethods[$method->objectTypeID]|isset}
- {@$method->getProcessor()->getStatusText($enabledMultifactorMethods[$method->objectTypeID])}
- {/if}
- </div>
-
- <div class="accountSecurityButtons">
- <a class="small button" href="{link controller='MultifactorManage' id=$method->objectTypeID}{/link}">
- {lang}wcf.user.security.multifactor.{if $enabledMultifactorMethods[$method->objectTypeID]|isset}manage{else}setup{/if}{/lang}
- </a>
+ <div class="accountSecurityButtons">
+ <a class="small button" href="{link controller='MultifactorManage' id=$method->objectTypeID}{/link}">
+ {lang}wcf.user.security.multifactor.{if $enabledMultifactorMethods[$method->objectTypeID]|isset}manage{else}setup{/if}{/lang}
+ </a>
+ </div>
</div>
- </div>
- </li>
+ </li>
+ {/if}
{/foreach}
</ul>
</section>
use wcf\data\object\type\ObjectTypeCache;
use wcf\form\AbstractFormBuilderForm;
use wcf\system\exception\IllegalLinkException;
+use wcf\system\exception\PermissionDeniedException;
use wcf\system\menu\user\UserMenu;
use wcf\system\request\LinkHandler;
use wcf\system\user\multifactor\IMultifactorMethod;
$this->method = $objectType;
$this->processor = $this->method->getProcessor();
$this->setup = Setup::find($this->method, WCF::getUser());
+
+ // Backup codes may not be managed if they are not yet set up.
+ if ($this->method->objectType === 'com.woltlab.wcf.multifactor.backup' && !$this->setup) {
+ throw new PermissionDeniedException();
+ }
}
/**