summaryrefslogtreecommitdiffstats
path: root/apps/sharebymail
diff options
context:
space:
mode:
Diffstat (limited to 'apps/sharebymail')
-rw-r--r--apps/sharebymail/l10n/lt_LT.js3
-rw-r--r--apps/sharebymail/l10n/lt_LT.json3
-rw-r--r--apps/sharebymail/lib/ShareByMailProvider.php11
-rw-r--r--apps/sharebymail/tests/ShareByMailProviderTest.php15
4 files changed, 21 insertions, 11 deletions
diff --git a/apps/sharebymail/l10n/lt_LT.js b/apps/sharebymail/l10n/lt_LT.js
index 3ad427c4fb2..05d79279ea3 100644
--- a/apps/sharebymail/l10n/lt_LT.js
+++ b/apps/sharebymail/l10n/lt_LT.js
@@ -44,6 +44,7 @@ OC.L10N.register(
"Share by mail" : "Bendrinimas el. paštu",
"Share provider which allows you to share files by mail" : "Pasidalinimo teikėjas, kuris leidžia dalintis failais el. paštu",
"Allows users to share a personalized link to a file or folder by putting in an email address." : "Leidžia naudotojams bendrinti asmeninę nuorodą į failą ar aplanką, įvedus el. pašto adresą.",
- "Send password by mail" : "Siųsti slaptažodį el. paštu"
+ "Send password by mail" : "Siųsti slaptažodį el. paštu",
+ "Enforce password protection" : "Priverstinė apsauga slaptažodžiu"
},
"nplurals=4; plural=(n % 10 == 1 && (n % 100 > 19 || n % 100 < 11) ? 0 : (n % 10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < 11) ? 1 : n % 1 != 0 ? 2: 3);");
diff --git a/apps/sharebymail/l10n/lt_LT.json b/apps/sharebymail/l10n/lt_LT.json
index 90abcf53724..cf4f4cde3fb 100644
--- a/apps/sharebymail/l10n/lt_LT.json
+++ b/apps/sharebymail/l10n/lt_LT.json
@@ -42,6 +42,7 @@
"Share by mail" : "Bendrinimas el. paštu",
"Share provider which allows you to share files by mail" : "Pasidalinimo teikėjas, kuris leidžia dalintis failais el. paštu",
"Allows users to share a personalized link to a file or folder by putting in an email address." : "Leidžia naudotojams bendrinti asmeninę nuorodą į failą ar aplanką, įvedus el. pašto adresą.",
- "Send password by mail" : "Siųsti slaptažodį el. paštu"
+ "Send password by mail" : "Siųsti slaptažodį el. paštu",
+ "Enforce password protection" : "Priverstinė apsauga slaptažodžiu"
},"pluralForm" :"nplurals=4; plural=(n % 10 == 1 && (n % 100 > 19 || n % 100 < 11) ? 0 : (n % 10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < 11) ? 1 : n % 1 != 0 ? 2: 3);"
} \ No newline at end of file
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php
index 48c60b168e8..a7b8f541217 100644
--- a/apps/sharebymail/lib/ShareByMailProvider.php
+++ b/apps/sharebymail/lib/ShareByMailProvider.php
@@ -354,7 +354,8 @@ class ShareByMailProvider implements IShareProvider {
$share->getPermissions(),
$share->getToken(),
$share->getPassword(),
- $share->getSendPasswordByTalk()
+ $share->getSendPasswordByTalk(),
+ $share->getHideDownload()
);
try {
@@ -686,9 +687,10 @@ class ShareByMailProvider implements IShareProvider {
* @param string $token
* @param string $password
* @param bool $sendPasswordByTalk
+ * @param bool $hideDownload
* @return int
*/
- protected function addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $uidOwner, $permissions, $token, $password, $sendPasswordByTalk) {
+ protected function addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $uidOwner, $permissions, $token, $password, $sendPasswordByTalk, $hideDownload) {
$qb = $this->dbConnection->getQueryBuilder();
$qb->insert('share')
->setValue('share_type', $qb->createNamedParameter(\OCP\Share::SHARE_TYPE_EMAIL))
@@ -702,7 +704,8 @@ class ShareByMailProvider implements IShareProvider {
->setValue('token', $qb->createNamedParameter($token))
->setValue('password', $qb->createNamedParameter($password))
->setValue('password_by_talk', $qb->createNamedParameter($sendPasswordByTalk, IQueryBuilder::PARAM_BOOL))
- ->setValue('stime', $qb->createNamedParameter(time()));
+ ->setValue('stime', $qb->createNamedParameter(time()))
+ ->setValue('hide_download', $qb->createNamedParameter($hideDownload, IQueryBuilder::PARAM_BOOL));
/*
* Added to fix https://github.com/owncloud/core/issues/22215
@@ -747,6 +750,7 @@ class ShareByMailProvider implements IShareProvider {
->set('password_by_talk', $qb->createNamedParameter($share->getSendPasswordByTalk(), IQueryBuilder::PARAM_BOOL))
->set('expiration', $qb->createNamedParameter($share->getExpirationDate(), IQueryBuilder::PARAM_DATE))
->set('note', $qb->createNamedParameter($share->getNote()))
+ ->set('hide_download', $qb->createNamedParameter($share->getHideDownload(), IQueryBuilder::PARAM_BOOL))
->execute();
if ($originalShare->getNote() !== $share->getNote() && $share->getNote() !== '') {
@@ -1007,6 +1011,7 @@ class ShareByMailProvider implements IShareProvider {
$share->setSharedWith($data['share_with']);
$share->setPassword($data['password']);
$share->setSendPasswordByTalk((bool)$data['password_by_talk']);
+ $share->setHideDownload((bool)$data['hide_download']);
if ($data['uid_initiator'] !== null) {
$share->setShareOwner($data['uid_owner']);
diff --git a/apps/sharebymail/tests/ShareByMailProviderTest.php b/apps/sharebymail/tests/ShareByMailProviderTest.php
index 27805691ecc..07bba57a19c 100644
--- a/apps/sharebymail/tests/ShareByMailProviderTest.php
+++ b/apps/sharebymail/tests/ShareByMailProviderTest.php
@@ -313,7 +313,7 @@ class ShareByMailProviderTest extends TestCase {
);
}
-
+
public function testCreateFailed() {
$this->expectException(\Exception::class);
@@ -356,7 +356,7 @@ class ShareByMailProviderTest extends TestCase {
}
-
+
public function testCreateMailShareFailed() {
$this->expectException(\OC\HintException::class);
@@ -406,6 +406,7 @@ class ShareByMailProviderTest extends TestCase {
$token = 'token';
$password = 'password';
$sendPasswordByTalk = true;
+ $hideDownload = true;
$instance = $this->getInstance();
@@ -421,7 +422,8 @@ class ShareByMailProviderTest extends TestCase {
$permissions,
$token,
$password,
- $sendPasswordByTalk
+ $sendPasswordByTalk,
+ $hideDownload
]
);
@@ -442,6 +444,7 @@ class ShareByMailProviderTest extends TestCase {
$this->assertSame($token, $result[0]['token']);
$this->assertSame($password, $result[0]['password']);
$this->assertSame($sendPasswordByTalk, (bool)$result[0]['password_by_talk']);
+ $this->assertSame($hideDownload, (bool)$result[0]['hide_download']);
}
@@ -580,7 +583,7 @@ class ShareByMailProviderTest extends TestCase {
$this->assertInstanceOf('OCP\Share\IShare', $result);
}
-
+
public function testGetShareByIdFailed() {
$this->expectException(\OCP\Share\Exceptions\ShareNotFound::class);
@@ -665,7 +668,7 @@ class ShareByMailProviderTest extends TestCase {
$this->assertInstanceOf('OCP\Share\IShare', $result);
}
-
+
public function testGetShareByTokenFailed() {
$this->expectException(\OCP\Share\Exceptions\ShareNotFound::class);
@@ -782,7 +785,7 @@ class ShareByMailProviderTest extends TestCase {
$this->assertSame($token, $result['token']);
}
-
+
public function testGetRawShareFailed() {
$this->expectException(\OCP\Share\Exceptions\ShareNotFound::class);