From b447ea67d98043a388f5b12de10092f8bff0e852 Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Thu, 6 Jun 2019 20:27:32 +0200 Subject: [PATCH 1/3] Revert "[stable10] Backport of Convert shareWith to lower case" --- apps/files_sharing/lib/Controller/Share20OcsController.php | 4 ---- .../tests/Controller/Share20OcsControllerTest.php | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/apps/files_sharing/lib/Controller/Share20OcsController.php b/apps/files_sharing/lib/Controller/Share20OcsController.php index a1923cf981c1..5ae97d70df00 100644 --- a/apps/files_sharing/lib/Controller/Share20OcsController.php +++ b/apps/files_sharing/lib/Controller/Share20OcsController.php @@ -386,10 +386,6 @@ public function createShare() { $globalAutoAccept = $this->config->getAppValue('core', 'shareapi_auto_accept_share', 'yes') === 'yes'; if ($shareType === Share::SHARE_TYPE_USER) { - //Lower the case if the share type is user - if (($shareWith !== null) && ($shareWith !== '')) { - $shareWith = \strtolower($shareWith); - } $userAutoAccept = false; if ($globalAutoAccept) { $userAutoAccept = $this->config->getUserValue($shareWith, 'files_sharing', 'auto_accept_share', 'yes') === 'yes'; diff --git a/apps/files_sharing/tests/Controller/Share20OcsControllerTest.php b/apps/files_sharing/tests/Controller/Share20OcsControllerTest.php index 533418670803..667501d7f36d 100644 --- a/apps/files_sharing/tests/Controller/Share20OcsControllerTest.php +++ b/apps/files_sharing/tests/Controller/Share20OcsControllerTest.php @@ -903,7 +903,7 @@ public function testCreateShareUser() { ->with('valid-path') ->willReturn($path); - $this->userManager->method('userExists')->with('validuser')->willReturn(true); + $this->userManager->method('userExists')->with('validUser')->willReturn(true); $path->expects($this->once()) ->method('lock') @@ -921,7 +921,7 @@ public function testCreateShareUser() { ~\OCP\Constants::PERMISSION_CREATE ) && $share->getShareType() === Share::SHARE_TYPE_USER && - $share->getSharedWith() === 'validuser' && + $share->getSharedWith() === 'validUser' && $share->getSharedBy() === 'currentUser'; })) ->will($this->returnArgument(0)); @@ -1587,7 +1587,7 @@ public function testCreateReshareOfFederatedMountNoDeletePermissions() { ->with('valid-path') ->willReturn($path); - $this->userManager->method('userExists')->with('validuser')->willReturn(true); + $this->userManager->method('userExists')->with('validUser')->willReturn(true); $this->shareManager ->expects($this->once()) From 2b362fbaeb464ec85271fd49292656c886c78080 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Fri, 7 Jun 2019 12:06:47 +0545 Subject: [PATCH 2/3] API share_with user response is now case sensitive --- .../features/apiShareManagementBasic/createShare.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/features/apiShareManagementBasic/createShare.feature b/tests/acceptance/features/apiShareManagementBasic/createShare.feature index 874c76a1c030..56d43781795a 100644 --- a/tests/acceptance/features/apiShareManagementBasic/createShare.feature +++ b/tests/acceptance/features/apiShareManagementBasic/createShare.feature @@ -600,7 +600,7 @@ Feature: sharing Then the OCS status code should be "100" And the HTTP status code should be "200" And the fields of the last response should include - | share_with | user1 | + | share_with | USER1 | | file_target | /welcome.txt | | path | /welcome.txt | | permissions | 19 | From d6e723bc3a1f0d60021329cc4103f27ef0adb0e3 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Fri, 7 Jun 2019 12:07:59 +0545 Subject: [PATCH 3/3] Issue 35382 is resolved - webUI sharing to uppercase username works --- .../features/webUISharingInternalUsers/shareWithUsers.feature | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature b/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature index 42abacc7e5b6..02d0de8214b3 100644 --- a/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature +++ b/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature @@ -329,7 +329,6 @@ Feature: Sharing files and folders with internal users When the user opens the share dialog for file "lorem.txt" Then the user should not be able to send the share notification by email using the webUI - @issue-35382 Scenario: user shares a file with another user with uppercase username Given user "user1" has been created with default attributes and skeleton files And these users have been created without skeleton files: @@ -339,5 +338,4 @@ Feature: Sharing files and folders with internal users When the user shares file "lorem.txt" with user "SomeUser" using the webUI And the user re-logs in as "SomeUser" using the webUI And the user browses to the shared-with-you page - Then file "lorem.txt" should not be listed on the webUI -# Then file "lorem.txt" should be listed on the webUI + Then file "lorem.txt" should be listed on the webUI