diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-03-26 11:27:49 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-03-26 11:27:49 +0100 |
commit | d04ad4be26f0f09297748cac23582083c364ea25 (patch) | |
tree | ee49b68b6cfb854a28627874adab6be390ca8346 /lib/private | |
parent | 9bc1f0a67ab3ddbb7dca2d85ea9fc0b7a8365e21 (diff) | |
parent | 9d0ea7fa11ec81bca602b1bd08f1de4e2aa6d58c (diff) | |
download | nextcloud-server-d04ad4be26f0f09297748cac23582083c364ea25.tar.gz nextcloud-server-d04ad4be26f0f09297748cac23582083c364ea25.zip |
Merge pull request #15052 from rullzer/backport-15025
[stable8] Backport of #15025: OCS Respect enforced date
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/share/share.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/share/share.php b/lib/private/share/share.php index 9af567278a1..229dbc5efeb 100644 --- a/lib/private/share/share.php +++ b/lib/private/share/share.php @@ -1097,9 +1097,17 @@ class Share extends \OC\Share\Constants { */ public static function setExpirationDate($itemType, $itemSource, $date, $shareTime = null) { $user = \OC_User::getUser(); + $l = \OC::$server->getL10N('lib'); if ($date == '') { - $date = null; + if (\OCP\Util::isDefaultExpireDateEnforced()) { + $warning = 'Cannot clear expiration date. Shares are required to have an expiration date.'; + $warning_t = $l->t('Cannot clear expiration date. Shares are required to have an expiration date.'); + \OCP\Util::writeLog('OCP\Share', $warning, \OCP\Util::WARN); + throw new \Exception($warning_t); + } else { + $date = null; + } } else { $date = self::validateExpireDate($date, $shareTime, $itemType, $itemSource); } |