Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-10-16 14:08:14 +0300
committerThomas Müller <thomas.mueller@tmit.eu>2015-10-16 14:08:14 +0300
commit923e6ca1bf1c26481ced77ded4cf04ad969c13ac (patch)
treedb35760faa5c4730874344615875424b7acc0dbf
parent64fb704c4ea2490418a389a661dc5b8341667f78 (diff)
parente1d2ab83ccb5a6e671f024ebdd3dc329e82bb18e (diff)
Merge pull request #19809 from owncloud/show-serverside-share-link-expiration-stable8.1
Update expiration date on link sharing
-rw-r--r--core/ajax/share.php8
-rw-r--r--core/js/share.js7
2 files changed, 12 insertions, 3 deletions
diff --git a/core/ajax/share.php b/core/ajax/share.php
index 4546217def3..c1eaa8ec260 100644
--- a/core/ajax/share.php
+++ b/core/ajax/share.php
@@ -62,11 +62,13 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
(!empty($_POST['expirationDate']) ? new \DateTime((string)$_POST['expirationDate']) : null)
);
+ $response = [];
if (is_string($token)) {
- OC_JSON::success(array('data' => array('token' => $token)));
- } else {
- OC_JSON::success();
+ $item = OCP\Share::getShareByToken($token, false);
+ $response['data'] = array('token' => $token,
+ 'expiration' => $item['expiration']);
}
+ OC_JSON::success($response);
} catch (\OC\HintException $exception) {
OC_JSON::error(array('data' => array('message' => $exception->getHint())));
} catch (Exception $exception) {
diff --git a/core/js/share.js b/core/js/share.js
index af654e6dedc..79fcf61c215 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -1062,6 +1062,9 @@ $(document).ready(function() {
$button.removeClass('hidden');
$button.prop('disabled', false);
OC.Share.showLink(data.token, null, itemSource);
+ if (data.expiration) {
+ OC.Share.showExpirationDate(data.expiration);
+ }
$('#dropdown').trigger(new $.Event('sharesChanged', {shares: OC.Share.currentShares}));
OC.Share.updateIcon(itemType, itemSource);
});
@@ -1202,6 +1205,10 @@ $(document).ready(function() {
OC.Share.showLink(data.token, "password set", itemSource);
OC.Share.updateIcon(itemType, itemSource);
}
+
+ if (data.expiration) {
+ OC.Share.showExpirationDate(data.expiration);
+ }
$('#dropdown').trigger(new $.Event('sharesChanged', {shares: OC.Share.currentShares}));
}, function(result) {
$loading.addClass('hidden');