Debian Codegraph @

lib/tools/webauthn.inc

raw
1 <?php
2
3 namespace LAM\TOOLS\WEBAUTHN;
4
5 use LAM\LIB\TWO_FACTOR\TwoFactorProviderService;
6 use LAMTool;
7
8 /*
9
10 This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
11 Copyright (C) 2020 - 2021 Roland Gruber
12
13 This program is free software; you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation; either version 2 of the License, or
16 (at your option) any later version.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
27 */
28
29 /**
30 * Webauthn device management.
31 *
32 * @author Roland Gruber
33 * @package tools
34 */
35
36 /**
37 * Webauthn device management.
38 *
39 * @package tools
40 */
41 class toolWebauthn extends LAMTool {
42
43 /**
44 * {@inheritDoc}
45 */
46 public function getName(): string {
47 return _('WebAuthn devices');
48 }
49
50 /**
51 * {@inheritDoc}
52 */
53 public function getDescription(): string {
54 return _("Here you can manage your webauthn devices.");
55 }
56
57 /**
58 * {@inheritDoc}
59 */
60 public function getLink(): string {
61 return "tools/webauthn.php";
62 }
63
64 /**
65 * {@inheritDoc}
66 */
67 public function getRequiresWriteAccess(): bool {
68 return false;
69 }
70
71 /**
72 * {@inheritDoc}
73 */
74 public function getRequiresPasswordChangeRights(): bool {
75 return false;
76 }
77
78 /**
79 * {@inheritDoc}
80 */
81 public function getImageLink(): string {
82 return 'webauthn.svg';
83 }
84
85 /**
86 * {@inheritDoc}
87 */
88 public function getPosition(): int {
89 return 800;
90 }
91
92 /**
93 * {@inheritDoc}
94 */
95 public function isVisible(): bool {
96 return ($_SESSION['config']->getTwoFactorAuthentication() === TwoFactorProviderService::TWO_FACTOR_WEBAUTHN);
97 }
98
99 }