Skip to content
Snippets Groups Projects
Commit 1cccb227 authored by Lukas Reschke's avatar Lukas Reschke
Browse files

Merge pull request #16686 from owncloud/show_cloud_id

show federated cloud id in the personal settings
parents 25993768 70f0cf67
No related branches found
No related tags found
No related merge requests found
...@@ -49,6 +49,7 @@ $application->registerMountProviders(); ...@@ -49,6 +49,7 @@ $application->registerMountProviders();
$application->setupPropagation(); $application->setupPropagation();
\OCP\App::registerAdmin('files_sharing', 'settings-admin'); \OCP\App::registerAdmin('files_sharing', 'settings-admin');
\OCP\App::registerPersonal('files_sharing', 'settings-personal');
\OCA\Files_Sharing\Helper::registerHooks(); \OCA\Files_Sharing\Helper::registerHooks();
......
...@@ -306,4 +306,20 @@ class Helper { ...@@ -306,4 +306,20 @@ class Helper {
\OC::$server->getConfig()->setSystemValue('share_folder', $shareFolder); \OC::$server->getConfig()->setSystemValue('share_folder', $shareFolder);
} }
/**
* remove protocol from URL
*
* @param string $url
* @return string
*/
public static function removeProtocolFromUrl($url) {
if (strpos($url, 'https://') === 0) {
return substr($url, strlen('https://'));
} else if (strpos($url, 'http://') === 0) {
return substr($url, strlen('http://'));
}
return $url;
}
} }
<?php
/**
* @author Björn Schießle <schiessle@owncloud.com>
* @author Morris Jobke <hey@morrisjobke.de>
*
* @copyright Copyright (c) 2015, ownCloud, Inc.
* @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/>
*
*/
\OC_Util::checkLoggedIn();
$uid = \OC::$server->getUserSession()->getUser()->getUID();
$server = \OC::$server->getURLGenerator()->getAbsoluteURL('/');
$cloudID = $uid . '@' . rtrim(\OCA\Files_Sharing\Helper::removeProtocolFromUrl($server), '/');
$tmpl = new OCP\Template('files_sharing', 'settings-personal');
$tmpl->assign('cloudId', $cloudID);
return $tmpl->fetchPage();
<?php
/** @var OC_L10N $l */
/** @var array $_ */
?>
<div id="fileSharingSettings" class="section">
<h2><?php p($l->t('Federated Cloud'));?></h2>
<p>
<?php p($l->t('Your Federated Cloud ID: %s', [$_['cloudId']])); ?>
</p>
</div>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment