Completed
Push — master ( 9db189...2d861c )
by Lukas
24s
created

Additional::getPriority()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
/**
3
 * @copyright Copyright (c) 2016 Arthur Schiwon <[email protected]>
4
 *
5
 * @author Arthur Schiwon <[email protected]>
6
 *
7
 * @license GNU AGPL version 3 or any later version
8
 *
9
 * This program is free software: you can redistribute it and/or modify
10
 * it under the terms of the GNU Affero General Public License as
11
 * published by the Free Software Foundation, either version 3 of the
12
 * License, or (at your option) any later version.
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
20
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
 *
22
 */
23
24
namespace OC\Settings\Admin;
25
26
use Doctrine\DBAL\Connection;
27
use Doctrine\DBAL\DBALException;
28
use Doctrine\DBAL\Platforms\SqlitePlatform;
29
use OC\Lock\DBLockingProvider;
30
use OC\Lock\NoopLockingProvider;
31
use OCP\AppFramework\Http\TemplateResponse;
32
use OCP\IConfig;
33
use OCP\IDBConnection;
34
use OCP\IL10N;
35
use OCP\Lock\ILockingProvider;
36
use OCP\Settings\ISettings;
37
38
class Additional implements ISettings {
39
	/** @var IConfig */
40
	private $config;
41
42
	/**
43
	 * @param IConfig $config
44
	 */
45
	public function __construct(IConfig $config) {
46
		$this->config = $config;
47
	}
48
49
	/**
50
	 * @return TemplateResponse
51
	 */
52
	public function getForm() {
53
		$parameters = [
54
			// Mail
55
			'sendmail_is_available' => (bool) \OC_Helper::findBinaryPath('sendmail'),
56
			'mail_domain'           => $this->config->getSystemValue('mail_domain', ''),
57
			'mail_from_address'     => $this->config->getSystemValue('mail_from_address', ''),
58
			'mail_smtpmode'         => $this->config->getSystemValue('mail_smtpmode', ''),
59
			'mail_smtpsecure'       => $this->config->getSystemValue('mail_smtpsecure', ''),
60
			'mail_smtphost'         => $this->config->getSystemValue('mail_smtphost', ''),
61
			'mail_smtpport'         => $this->config->getSystemValue('mail_smtpport', ''),
62
			'mail_smtpauthtype'     => $this->config->getSystemValue('mail_smtpauthtype', ''),
63
			'mail_smtpauth'         => $this->config->getSystemValue('mail_smtpauth', false),
64
			'mail_smtpname'         => $this->config->getSystemValue('mail_smtpname', ''),
65
			'mail_smtppassword'     => $this->config->getSystemValue('mail_smtppassword', ''),
66
		];
67
68
		return new TemplateResponse('settings', 'admin/additional-mail', $parameters, '');
69
	}
70
71
	/**
72
	 * @return string the section ID, e.g. 'sharing'
73
	 */
74
	public function getSection() {
75
		return 'additional';
76
	}
77
78
	/**
79
	 * @return int whether the form should be rather on the top or bottom of
80
	 * the admin section. The forms are arranged in ascending order of the
81
	 * priority values. It is required to return a value between 0 and 100.
82
	 *
83
	 * E.g.: 70
84
	 */
85
	public function getPriority() {
86
		return 0;
87
	}
88
}
89