diff --git a/cp/app/Controllers/Auth/AuthController.php b/cp/app/Controllers/Auth/AuthController.php index 558dfdd..e6fcd87 100644 --- a/cp/app/Controllers/Auth/AuthController.php +++ b/cp/app/Controllers/Auth/AuthController.php @@ -32,9 +32,10 @@ class AuthController extends Controller * @throws \DI\NotFoundException */ public function createLogin(Request $request, Response $response){ - return view($response,'auth/login.twig'); + $isWebAuthnEnabled = envi('WEB_AUTHN_ENABLED') === 'true'; + return view($response, 'auth/login.twig', ['isWebaEnabled' => $isWebaEnabled]); } - + /** * Show 2FA verification form. * diff --git a/cp/app/Controllers/ReportsController.php b/cp/app/Controllers/ReportsController.php index 4b97271..a5f7c77 100644 --- a/cp/app/Controllers/ReportsController.php +++ b/cp/app/Controllers/ReportsController.php @@ -39,7 +39,9 @@ class ReportsController extends Controller 'registrar' => $registrar['name'], 'currency' => $currency, 'number' => $domainCount[0]['count'] ?? 0, - 'share' => number_format(($domainCount[0]['count'] ?? 0) / $numT * 100, 2), + 'share' => $numT > 0 + ? number_format(($domainCount[0]['count'] ?? 0) / $numT * 100, 2) + : '0.00', 'earnings' => $earnings[0]['amt'] ?? 0 ]; } diff --git a/cp/resources/views/auth/login.twig b/cp/resources/views/auth/login.twig index c02a3d9..f1137dc 100644 --- a/cp/resources/views/auth/login.twig +++ b/cp/resources/views/auth/login.twig @@ -44,6 +44,7 @@ + {% if isWebaEnabled %}