Completed
Push — master ( 7a29a1...33d37f )
by Thomas
01:49
created

SettingsController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 3
1
<?php
2
/**
3
 * @author Semih Serhat Karakaya <[email protected]>
4
 *
5
 * Two-factor Backup Codes
6
 *
7
 * This code is free software: you can redistribute it and/or modify
8
 * it under the terms of the GNU Affero General Public License, version 3,
9
 * as published by the Free Software Foundation.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
 * GNU Affero General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Affero General Public License, version 3,
17
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
18
 *
19
 */
20
21
namespace OCA\Security\Controller;
22
23
use OCA\Security\SecurityConfig;
24
use OCP\AppFramework\Controller;
25
use OCP\IRequest;
26
27
class SettingsController extends Controller {
28
29
	/** @var SecurityConfig */
30
	private $config;
31
32
	/**
33
	 * @param string $appName
34
	 * @param IRequest $request
35
	 * @param SecurityConfig $config
36
	 */
37
	public function __construct($appName, IRequest $request, SecurityConfig $config) {
38
		parent::__construct($appName, $request);
39
		$this->config = $config;
40
	}
41
42
	/**
43
	 * @return array
44
	 */
45
	public function state() {
46
		return $this->config->getAllSecurityConfigs();
47
	}
48
}
49