mail/appinfo/application.php

51 строка
1.6 KiB
PHP
Исходник Обычный вид История

2014-07-16 16:36:30 +04:00
<?php
2016-04-13 22:39:04 +03:00
2014-07-16 16:36:30 +04:00
/**
2016-02-07 22:16:35 +03:00
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @author Thomas Müller <thomas.mueller@tmit.eu>
2014-07-16 16:36:30 +04:00
*
* Mail
2016-02-07 22:16:35 +03:00
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
2014-07-16 16:36:30 +04:00
*
*/
namespace OCA\Mail\AppInfo;
2016-04-14 21:37:33 +03:00
use OCP\AppFramework\App;
use OCP\Util;
2014-07-16 16:36:30 +04:00
class Application extends App {
2016-04-13 22:39:04 +03:00
public function __construct(array $urlParams = []) {
2014-07-16 16:36:30 +04:00
parent::__construct('mail', $urlParams);
$container = $this->getContainer();
2016-03-16 23:13:29 +03:00
$transport = $container->getServer()->getConfig()->getSystemValue('app.mail.transport', 'smtp');
$testSmtp = $transport === 'smtp';
2016-03-16 23:13:29 +03:00
$container->registerService('OCP\ISession', function ($c) {
return $c->getServer()->getSession();
});
$user = $container->query("UserId");
$container->registerParameter("appName", "mail");
$container->registerParameter("userFolder", $container->getServer()->getUserFolder($user));
$container->registerParameter("testSmtp", $testSmtp);
2016-08-02 18:15:08 +03:00
$container->registerParameter("referrer", isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null);
2016-04-14 21:37:33 +03:00
$container->registerParameter("hostname", Util::getServerHostName());
2014-07-16 16:36:30 +04:00
}
2014-07-16 16:36:30 +04:00
}