Completed
Pull Request — master (#92)
by Christoph
02:02
created

SmsProvider::getTemplate()   A

Complexity

Conditions 2
Paths 3

Size

Total Lines 19
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 19
c 0
b 0
f 0
rs 9.8333
cc 2
nc 3
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @author Christoph Wurst <[email protected]>
7
 *
8
 * Nextcloud - Two-factor Gateway
9
 *
10
 * This code is free software: you can redistribute it and/or modify
11
 * it under the terms of the GNU Affero General Public License, version 3,
12
 * as published by the Free Software Foundation.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
 * GNU Affero General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU Affero General Public License, version 3,
20
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
21
 *
22
 */
23
24
namespace OCA\TwoFactorGateway\Provider;
25
26
use OCA\TwoFactorGateway\Service\Gateway\IGateway;
27
use OCA\TwoFactorGateway\Service\Gateway\SMS\Gateway;
28
use OCA\TwoFactorGateway\Service\StateStorage;
29
use OCP\IL10N;
30
use OCP\ISession;
31
use OCP\Security\ISecureRandom;
32
33
class SmsProvider extends AProvider {
34
35
	public function __construct(Gateway $smsGateway,
36
								StateStorage $stateStorage,
37
								ISession $session,
38
								ISecureRandom $secureRandom,
39
								IL10N $l10n) {
40
		parent::__construct(
41
			'sms',
42
			$smsGateway,
43
			$stateStorage,
44
			$session,
45
			$secureRandom,
46
			$l10n
47
		);
48
	}
49
50
	/**
51
	 * Get the display name for selecting the 2FA provider
52
	 */
53
	public function getDisplayName(): string {
54
		return $this->l10n->t('Message gateway verification');
55
	}
56
57
	/**
58
	 * Get the description for selecting the 2FA provider
59
	 */
60
	public function getDescription(): string {
61
		return $this->l10n->t('Authenticate via SMS');
62
	}
63
64
}
65