summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php1
-rw-r--r--apps/files_sharing/lib/Migration.php18
2 files changed, 19 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index 78eef6c26bb..80ba7534da0 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -190,6 +190,7 @@ class ShareAPIController extends OCSController {
$result['token'] = $share->getToken();
} else if ($share->getShareType() === \OCP\Share::SHARE_TYPE_EMAIL) {
$result['share_with'] = $share->getSharedWith();
+ $result['password'] = $share->getPassword();
$result['share_with_displayname'] = $this->getDisplayNameFromAddressBook($share->getSharedWith(), 'EMAIL');
$result['token'] = $share->getToken();
} else if ($share->getShareType() === \OCP\Share::SHARE_TYPE_CIRCLE) {
diff --git a/apps/files_sharing/lib/Migration.php b/apps/files_sharing/lib/Migration.php
index 605a11fd22c..49e275cbe6e 100644
--- a/apps/files_sharing/lib/Migration.php
+++ b/apps/files_sharing/lib/Migration.php
@@ -123,6 +123,24 @@ class Migration {
$this->config->deleteAppValue('core', 'shareapi_allow_public_notification');
}
+ public function addPasswordColumn() {
+ $query = $this->connection->getQueryBuilder();
+ $query
+ ->update('share')
+ ->set('password', 'share_with')
+ ->where($query->expr()->eq('share_type', $query->createNamedParameter(\OCP\Share::SHARE_TYPE_LINK)))
+ ->andWhere($query->expr()->isNotNull('share_with'));
+ $query->execute();
+
+ $clearQuery = $this->connection->getQueryBuilder();
+ $clearQuery
+ ->update('share')->set('share_with', $clearQuery->createNamedParameter(null))
+ ->where($clearQuery->expr()->eq('share_type', $clearQuery->createNamedParameter(\OCP\Share::SHARE_TYPE_LINK)));
+
+ $clearQuery->execute();
+
+ }
+
/**
* find the owner of a re-shared file/folder
*