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