1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* @author Christoph Wurst <[email protected]> |
5
|
|
|
* @author Thomas Müller <[email protected]> |
6
|
|
|
* |
7
|
|
|
* ownCloud - Mail |
8
|
|
|
* |
9
|
|
|
* This code is free software: you can redistribute it and/or modify |
10
|
|
|
* it under the terms of the GNU Affero General Public License, version 3, |
11
|
|
|
* as published by the Free Software Foundation. |
12
|
|
|
* |
13
|
|
|
* This program is distributed in the hope that it will be useful, |
14
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16
|
|
|
* GNU Affero General Public License for more details. |
17
|
|
|
* |
18
|
|
|
* You should have received a copy of the GNU Affero General Public License, version 3, |
19
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/> |
20
|
|
|
* |
21
|
|
|
*/ |
22
|
|
|
|
23
|
|
|
namespace OCA\Mail\AppInfo; |
24
|
|
|
|
25
|
|
|
use OCP\AppFramework\App; |
26
|
|
|
use OCP\Util; |
27
|
|
|
|
28
|
|
|
class Application extends App { |
29
|
|
|
|
30
|
1 |
|
public function __construct(array $urlParams = []) { |
31
|
1 |
|
parent::__construct('mail', $urlParams); |
32
|
|
|
|
33
|
1 |
|
$container = $this->getContainer(); |
34
|
|
|
|
35
|
1 |
|
$transport = $container->getServer()->getConfig()->getSystemValue('app.mail.transport', 'smtp'); |
36
|
1 |
|
$testSmtp = $transport === 'smtp'; |
37
|
|
|
|
38
|
1 |
|
$container->registerService('OCP\ISession', function ($c) { |
39
|
|
|
return $c->getServer()->getSession(); |
40
|
1 |
|
}); |
41
|
|
|
|
42
|
1 |
|
$user = $container->query("UserId"); |
43
|
1 |
|
$container->registerParameter("appName", "mail"); |
44
|
1 |
|
$container->registerParameter("userFolder", $container->getServer()->getUserFolder($user)); |
45
|
1 |
|
$container->registerParameter("testSmtp", $testSmtp); |
46
|
1 |
|
$container->registerParameter("referrer", isset($_SERVER['HTTP_REFERER']) ? : null); |
47
|
1 |
|
$container->registerParameter("hostname", Util::getServerHostName()); |
48
|
1 |
|
} |
49
|
|
|
|
50
|
|
|
} |
51
|
|
|
|