summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/composer/composer/autoload_classmap.php1
-rw-r--r--lib/composer/composer/autoload_static.php1
-rw-r--r--lib/private/Share20/DefaultShareProvider.php8
-rw-r--r--lib/private/Share20/Share.php17
-rw-r--r--lib/public/Share/IShare.php17
5 files changed, 43 insertions, 1 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php
index c94837ed15c..afac26420eb 100644
--- a/lib/composer/composer/autoload_classmap.php
+++ b/lib/composer/composer/autoload_classmap.php
@@ -670,6 +670,7 @@ return array(
'OC\\Core\\Migrations\\Version14000Date20180712153140' => $baseDir . '/core/Migrations/Version14000Date20180712153140.php',
'OC\\Core\\Migrations\\Version15000Date20180926101451' => $baseDir . '/core/Migrations/Version15000Date20180926101451.php',
'OC\\Core\\Migrations\\Version15000Date20181015062942' => $baseDir . '/core/Migrations/Version15000Date20181015062942.php',
+ 'OC\\Core\\Migrations\\Version15000Date20181029084625' => $baseDir . '/core/Migrations/Version15000Date20181029084625.php',
'OC\\DB\\Adapter' => $baseDir . '/lib/private/DB/Adapter.php',
'OC\\DB\\AdapterMySQL' => $baseDir . '/lib/private/DB/AdapterMySQL.php',
'OC\\DB\\AdapterOCI8' => $baseDir . '/lib/private/DB/AdapterOCI8.php',
diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php
index 80aabae2389..db20d9a1c9a 100644
--- a/lib/composer/composer/autoload_static.php
+++ b/lib/composer/composer/autoload_static.php
@@ -700,6 +700,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OC\\Core\\Migrations\\Version14000Date20180712153140' => __DIR__ . '/../../..' . '/core/Migrations/Version14000Date20180712153140.php',
'OC\\Core\\Migrations\\Version15000Date20180926101451' => __DIR__ . '/../../..' . '/core/Migrations/Version15000Date20180926101451.php',
'OC\\Core\\Migrations\\Version15000Date20181015062942' => __DIR__ . '/../../..' . '/core/Migrations/Version15000Date20181015062942.php',
+ 'OC\\Core\\Migrations\\Version15000Date20181029084625' => __DIR__ . '/../../..' . '/core/Migrations/Version15000Date20181029084625.php',
'OC\\DB\\Adapter' => __DIR__ . '/../../..' . '/lib/private/DB/Adapter.php',
'OC\\DB\\AdapterMySQL' => __DIR__ . '/../../..' . '/lib/private/DB/AdapterMySQL.php',
'OC\\DB\\AdapterOCI8' => __DIR__ . '/../../..' . '/lib/private/DB/AdapterOCI8.php',
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php
index 3dcca0facbc..dc0ecea8807 100644
--- a/lib/private/Share20/DefaultShareProvider.php
+++ b/lib/private/Share20/DefaultShareProvider.php
@@ -146,6 +146,8 @@ class DefaultShareProvider implements IShareProvider {
//Set the GID of the group we share with
$qb->setValue('share_with', $qb->createNamedParameter($share->getSharedWith()));
} else if ($share->getShareType() === \OCP\Share::SHARE_TYPE_LINK) {
+ //set label for public link
+ $qb->setValue('label', $qb->createNamedParameter($share->getLabel()));
//Set the token of the share
$qb->setValue('token', $qb->createNamedParameter($share->getToken()));
@@ -225,6 +227,9 @@ class DefaultShareProvider implements IShareProvider {
*
* @param \OCP\Share\IShare $share
* @return \OCP\Share\IShare The share object
+ * @throws ShareNotFound
+ * @throws \OCP\Files\InvalidPathException
+ * @throws \OCP\Files\NotFoundException
*/
public function update(\OCP\Share\IShare $share) {
@@ -919,7 +924,8 @@ class DefaultShareProvider implements IShareProvider {
->setPermissions((int)$data['permissions'])
->setTarget($data['file_target'])
->setNote($data['note'])
- ->setMailSend((bool)$data['mail_send']);
+ ->setMailSend((bool)$data['mail_send'])
+ ->setLabel($data['label']);
$shareTime = new \DateTime();
$shareTime->setTimestamp((int)$data['stime']);
diff --git a/lib/private/Share20/Share.php b/lib/private/Share20/Share.php
index e218360f87b..f9b548c1adf 100644
--- a/lib/private/Share20/Share.php
+++ b/lib/private/Share20/Share.php
@@ -76,6 +76,8 @@ class Share implements \OCP\Share\IShare {
private $shareTime;
/** @var bool */
private $mailSend;
+ /** @var string */
+ private $label = '';
/** @var IRootFolder */
private $rootFolder;
@@ -337,6 +339,21 @@ class Share implements \OCP\Share\IShare {
/**
* @inheritdoc
*/
+ public function setLabel($label) {
+ $this->label = $label;
+ return $this;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function getLabel() {
+ return $this->label;
+ }
+
+ /**
+ * @inheritdoc
+ */
public function setExpirationDate($expireDate) {
//TODO checks
diff --git a/lib/public/Share/IShare.php b/lib/public/Share/IShare.php
index dcd5fdecbea..7bcecbdc872 100644
--- a/lib/public/Share/IShare.php
+++ b/lib/public/Share/IShare.php
@@ -258,6 +258,23 @@ interface IShare {
public function getExpirationDate();
/**
+ * set a label for a share, some shares, e.g. public links can have a label
+ *
+ * @param string $label
+ * @return \OCP\Share\IShare The modified object
+ * @since 15.0.0
+ */
+ public function setLabel($label);
+
+ /**
+ * get label for the share, some shares, e.g. public links can have a label
+ *
+ * @return string
+ * @since 15.0.0
+ */
+ public function getLabel();
+
+ /**
* Set the sharer of the path.
*
* @param string $sharedBy