コード例 #1
0
ファイル: share.php プロジェクト: heldernl/owncloud8-extended
     $recipientList = array_diff($recipientList, array(\OCP\User::getUser()));
     $mailNotification = new OC\Share\MailNotifications();
     $result = $mailNotification->sendInternalShareMail($recipientList, $itemSource, $itemType);
     \OCP\Share::setSendMailStatus($itemType, $itemSource, $shareType, $recipient, true);
     if (empty($result)) {
         OCP\JSON::success();
     } else {
         OCP\JSON::error(array('data' => array('message' => $l->t("Couldn't send mail to following users: %s ", implode(', ', $result)))));
     }
     break;
 case 'informRecipientsDisabled':
     $itemSource = (string) $_POST['itemSource'];
     $shareType = (int) $_POST['shareType'];
     $itemType = (string) $_POST['itemType'];
     $recipient = (string) $_POST['recipient'];
     \OCP\Share::setSendMailStatus($itemType, $itemSource, $shareType, $recipient, false);
     OCP\JSON::success();
     break;
 case 'email':
     // read post variables
     $link = (string) $_POST['link'];
     $file = (string) $_POST['file'];
     $to_address = (string) $_POST['toaddress'];
     $mailNotification = new \OC\Share\MailNotifications();
     $expiration = null;
     if (isset($_POST['expiration']) && $_POST['expiration'] !== '') {
         try {
             $date = new DateTime((string) $_POST['expiration']);
             $expiration = $date->getTimestamp();
         } catch (Exception $e) {
             \OCP\Util::writeLog('sharing', "Couldn't read date: " . $e->getMessage(), \OCP\Util::ERROR);