nextcloud/apps/federatedfilesharing/settings-personal.php

58 lines
2.2 KiB
PHP
Raw Normal View History

<?php
/**
2016-07-21 17:49:16 +03:00
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
* @author Bjoern Schiessle <bjoern@schiessle.org>
2016-05-26 20:56:05 +03:00
* @author Björn Schießle <bjoern@schiessle.org>
2015-06-25 12:43:55 +03:00
* @author Jan-Christoph Borchardt <hey@jancborchardt.net>
2015-10-05 21:54:56 +03:00
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @license AGPL-3.0
*
* 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/>
*
*/
use OCA\FederatedFileSharing\AppInfo\Application;
use OCA\Theming\Template;
\OC_Util::checkLoggedIn();
$l = \OC::$server->getL10N('federatedfilesharing');
2016-07-13 13:39:20 +03:00
$app = new Application();
$federatedShareProvider = $app->getFederatedShareProvider();
$isIE8 = false;
preg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $matches);
if (count($matches) > 0 && $matches[1] <= 9) {
$isIE8 = true;
}
2015-11-30 15:57:54 +03:00
$cloudID = \OC::$server->getUserSession()->getUser()->getCloudId();
2016-06-20 13:08:23 +03:00
$url = 'https://nextcloud.com/federation#' . $cloudID;
$ownCloudLogoPath = \OC::$server->getURLGenerator()->imagePath('core', 'logo-icon.svg');
$theme = \OC::$server->getThemingDefaults();
$tmpl = new OCP\Template('federatedfilesharing', 'settings-personal');
$tmpl->assign('outgoingServer2serverShareEnabled', $federatedShareProvider->isOutgoingServer2serverShareEnabled());
2016-06-20 13:08:23 +03:00
$tmpl->assign('message_with_URL', $l->t('Share with me through my #Nextcloud Federated Cloud ID, see %s', [$url]));
$tmpl->assign('message_without_URL', $l->t('Share with me through my #Nextcloud Federated Cloud ID', [$cloudID]));
2015-06-17 14:52:18 +03:00
$tmpl->assign('owncloud_logo_path', $ownCloudLogoPath);
$tmpl->assign('reference', $url);
$tmpl->assign('cloudId', $cloudID);
$tmpl->assign('showShareIT', !$isIE8);
$tmpl->assign('color', $theme->getMailHeaderColor());
return $tmpl->fetchPage();