diff options
-rw-r--r-- | apps/files_sharing/public.php | 3 | ||||
-rw-r--r-- | apps/files_sharing/templates/public.php | 7 | ||||
-rw-r--r-- | core/templates/layout.guest.php | 2 | ||||
-rw-r--r-- | core/templates/layout.user.php | 2 | ||||
-rw-r--r-- | lib/private/defaults.php | 14 | ||||
-rwxr-xr-x | lib/private/util.php | 2 |
6 files changed, 26 insertions, 4 deletions
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index bcf99d01edb..63938201eb2 100644 --- a/apps/files_sharing/public.php +++ b/apps/files_sharing/public.php @@ -1,5 +1,7 @@ <?php // Load other apps for file previews +use OCA\Files_Sharing\Helper; + OC_App::loadApps(); $appConfig = \OC::$server->getAppConfig(); @@ -132,6 +134,7 @@ if (isset($path)) { $tmpl->assign('mimetype', \OC\Files\Filesystem::getMimeType($path)); $tmpl->assign('dirToken', $linkItem['token']); $tmpl->assign('sharingToken', $token); + $tmpl->assign('server2serversharing', Helper::isOutgoingServer2serverShareEnabled()); $tmpl->assign('protected', isset($linkItem['share_with']) ? 'true' : 'false'); $urlLinkIdentifiers= (isset($token)?'&t='.$token:'') diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index 42103296d87..a4b3289d4c6 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -23,13 +23,18 @@ <div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div> <div class="header-right"> <span id="details"> - <span id="save" data-protected="<?php p($_['protected'])?>" data-owner="<?php p($_['displayName'])?>" data-name="<?php p($_['filename'])?>"> + <?php + if ($_['server2serversharing']) { + ?> + <span id="save" data-protected="<?php p($_['protected']) ?>" + data-owner="<?php p($_['displayName']) ?>" data-name="<?php p($_['filename']) ?>"> <button id="save-button"><?php p($l->t('Add to your ownCloud')) ?></button> <form class="save-form hidden" action="#"> <input type="text" id="remote_address" placeholder="example.com/owncloud"/> <button id="save-button-confirm" class="icon-confirm svg"></button> </form> </span> + <?php } ?> <a href="<?php p($_['downloadURL']); ?>" id="download" class="button"> <img class="svg" alt="" src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>"/> <span id="download-text"><?php p($l->t('Download'))?></span> diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index 00950802fec..24706b77b19 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -12,7 +12,7 @@ </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"> - <meta name="apple-itunes-app" content="app-id=543672169"> + <meta name="apple-itunes-app" content="app-id=<?php p($theme->getiTunesAppId()); ?>"> <link rel="shortcut icon" type="image/png" href="<?php print_unescaped(image_path('', 'favicon.png')); ?>" /> <link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path('', 'favicon-touch.png')); ?>" /> <?php foreach($_['cssfiles'] as $cssfile): ?> diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 69a181735ca..51470fb07fa 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -16,7 +16,7 @@ <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"> - <meta name="apple-itunes-app" content="app-id=543672169"> + <meta name="apple-itunes-app" content="app-id=<?php p($theme->getiTunesAppId()); ?>"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="apple-mobile-web-app-title" content="<?php p((!empty($_['application']) && $_['appid']!='files')? $_['application']:'ownCloud'); ?>"> diff --git a/lib/private/defaults.php b/lib/private/defaults.php index 3996cc081ed..cc6c819f03f 100644 --- a/lib/private/defaults.php +++ b/lib/private/defaults.php @@ -19,6 +19,7 @@ class OC_Defaults { private $defaultBaseUrl; private $defaultSyncClientUrl; private $defaultiOSClientUrl; + private $defaultiTunesAppId; private $defaultAndroidClientUrl; private $defaultDocBaseUrl; private $defaultDocVersion; @@ -36,6 +37,7 @@ class OC_Defaults { $this->defaultBaseUrl = 'https://owncloud.org'; $this->defaultSyncClientUrl = 'https://owncloud.org/sync-clients/'; $this->defaultiOSClientUrl = 'https://itunes.apple.com/us/app/owncloud/id543672169?mt=8'; + $this->defaultiTunesAppId = '543672169'; $this->defaultAndroidClientUrl = 'https://play.google.com/store/apps/details?id=com.owncloud.android'; $this->defaultDocBaseUrl = 'http://doc.owncloud.org'; $this->defaultDocVersion = $version[0] . '.0'; // used to generate doc links @@ -95,6 +97,18 @@ class OC_Defaults { } /** + * Returns the AppId for the App Store for the iOS Client + * @return string AppId + */ + public function getiTunesAppId() { + if ($this->themeExist('getiTunesAppId')) { + return $this->theme->getiTunesAppId(); + } else { + return $this->defaultiTunesAppId; + } + } + + /** * Returns the URL to Google Play for the Android Client * @return string URL */ diff --git a/lib/private/util.php b/lib/private/util.php index 8fae5189ca2..bc20b7bcd56 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -1211,7 +1211,7 @@ class OC_Util { * @deprecated Use \OC::$server->getSecureRandom()->getMediumStrengthGenerator()->generate($length); instead */ public static function generateRandomBytes($length = 30) { - return \OC::$server->getSecureRandom()->getMediumStrengthGenerator()->generate($length); + return \OC::$server->getSecureRandom()->getMediumStrengthGenerator()->generate($length, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS); } /** |