diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2013-08-30 17:20:10 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2013-08-30 17:20:10 +0200 |
commit | 4bbefdf608fdf930fa6fd1f783d6f58267752394 (patch) | |
tree | ad25e4c1cbc47ba5a624caf5ebe4714717ba084e /core/ajax | |
parent | e7959f4fd23ff3354db7b876db2c3e595044bc4c (diff) | |
download | nextcloud-server-4bbefdf608fdf930fa6fd1f783d6f58267752394.tar.gz nextcloud-server-4bbefdf608fdf930fa6fd1f783d6f58267752394.zip |
add expiration date if it is already set
Diffstat (limited to 'core/ajax')
-rw-r--r-- | core/ajax/share.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/ajax/share.php b/core/ajax/share.php index 0cf4b246f98..8b5191e6550 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -114,7 +114,11 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo if ($email !== '') { $displayName = \OCP\User::getDisplayName($recipient); $items = \OCP\Share::getItemSharedWithUser($itemType, $itemSource, $recipient); - $filename = $items[0]['file_target']; + $filename = trim($items[0]['file_target'], '/'); + $expiration = null; + if (isset($items[0]['expiration'])) { + $expiration = $items[0]['expiration']; + } if ($itemType === 'folder') { $foldername = "/Shared/" . $filename; @@ -125,7 +129,7 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo } $url = \OCP\Util::linkToAbsolute('files', 'index.php', array("dir" => $foldername)); - $text = $defaults->getShareNotificationText(\OCP\User::getDisplayName(), $filename, $itemType, $url); + $text = $defaults->getShareNotificationText(\OCP\User::getDisplayName(), $filename, $itemType, $url, $expiration); try { OCP\Util::sendMail( |