aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-03-28 17:35:20 +0100
committerVincent Petry <pvince81@owncloud.com>2014-03-28 17:35:20 +0100
commit0ae9ed4244d73f59077a70df0dbc800bd977e717 (patch)
tree3d30e2a179cb12925083ccb6e5ee0ba6f149b497
parent841069e8cbd2c40cd223a31f914e9ac4b9278890 (diff)
parente4069e155386fbb8391b76ba7684512dc57897aa (diff)
downloadnextcloud-server-0ae9ed4244d73f59077a70df0dbc800bd977e717.tar.gz
nextcloud-server-0ae9ed4244d73f59077a70df0dbc800bd977e717.zip
Merge pull request #7934 from owncloud/addEventToExpirationDate
Emit event after setting a new expiration for a share
-rw-r--r--lib/private/share/share.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index a385328edc1..8238797600e 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -747,7 +747,8 @@ class Share extends \OC\Share\Constants {
* @return \OCP\Share_Backend
*/
public static function setExpirationDate($itemType, $itemSource, $date) {
- $items = self::getItems($itemType, $itemSource, null, null, \OC_User::getUser(), self::FORMAT_NONE, null, -1, false);
+ $user = \OC_User::getUser();
+ $items = self::getItems($itemType, $itemSource, null, null, $user, self::FORMAT_NONE, null, -1, false);
if (!empty($items)) {
if ($date == '') {
$date = null;
@@ -759,6 +760,12 @@ class Share extends \OC\Share\Constants {
foreach ($items as $item) {
$query->bindValue(2, (int) $item['id']);
$query->execute();
+ \OC_Hook::emit('OCP\Share', 'post_set_expiration_date', array(
+ 'itemType' => $itemType,
+ 'itemSource' => $itemSource,
+ 'date' => $date,
+ 'uidOwner' => $user
+ ));
}
return true;
}