diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-06-15 10:45:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-15 10:45:55 +0200 |
commit | 3e9353dd699b4ed9a568bfbf30e115da422f7447 (patch) | |
tree | f110d146949b71b70e73ed2dcf6e88f6d9c28202 /apps | |
parent | 02e8021b1a8a97a41dfb66ff70b27a4717bb225c (diff) | |
parent | 465807490d7648e5675f1cdbc5b1d232cda4feee (diff) | |
download | nextcloud-server-3e9353dd699b4ed9a568bfbf30e115da422f7447.tar.gz nextcloud-server-3e9353dd699b4ed9a568bfbf30e115da422f7447.zip |
Merge pull request #25082 from owncloud/fix-sessionless-clients
Fix sessionless clients
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/Connector/Sabre/Auth.php | 3 | ||||
-rw-r--r-- | apps/dav/tests/unit/Connector/Sabre/AuthTest.php | 17 |
2 files changed, 6 insertions, 14 deletions
diff --git a/apps/dav/lib/Connector/Sabre/Auth.php b/apps/dav/lib/Connector/Sabre/Auth.php index 653da10bc3c..51f0acbe2ee 100644 --- a/apps/dav/lib/Connector/Sabre/Auth.php +++ b/apps/dav/lib/Connector/Sabre/Auth.php @@ -115,8 +115,7 @@ class Auth extends AbstractBasic { return true; } else { \OC_Util::setupFS(); //login hooks may need early access to the filesystem - if($this->userSession->logClientIn($username, $password)) { - $this->userSession->createSessionToken($this->request, $this->userSession->getUser()->getUID(), $username, $password); + if($this->userSession->logClientIn($username, $password, $this->request)) { \OC_Util::setupFS($this->userSession->getUser()->getUID()); $this->session->set(self::DAV_AUTHENTICATED, $this->userSession->getUser()->getUID()); $this->session->close(); diff --git a/apps/dav/tests/unit/Connector/Sabre/AuthTest.php b/apps/dav/tests/unit/Connector/Sabre/AuthTest.php index b3ab49a027e..147a0c2b8c5 100644 --- a/apps/dav/tests/unit/Connector/Sabre/AuthTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/AuthTest.php @@ -159,7 +159,7 @@ class AuthTest extends TestCase { $user = $this->getMockBuilder('\OCP\IUser') ->disableOriginalConstructor() ->getMock(); - $user->expects($this->exactly(4)) + $user->expects($this->exactly(3)) ->method('getUID') ->will($this->returnValue('MyTestUser')); $this->userSession @@ -167,7 +167,7 @@ class AuthTest extends TestCase { ->method('isLoggedIn') ->will($this->returnValue(true)); $this->userSession - ->expects($this->exactly(4)) + ->expects($this->exactly(3)) ->method('getUser') ->will($this->returnValue($user)); $this->session @@ -178,12 +178,8 @@ class AuthTest extends TestCase { $this->userSession ->expects($this->once()) ->method('logClientIn') - ->with('MyTestUser', 'MyTestPassword') + ->with('MyTestUser', 'MyTestPassword', $this->request) ->will($this->returnValue(true)); - $this->userSession - ->expects($this->once()) - ->method('createSessionToken') - ->with($this->request, 'MyTestUser', 'MyTestUser', 'MyTestPassword'); $this->session ->expects($this->once()) ->method('set') @@ -626,17 +622,14 @@ class AuthTest extends TestCase { ->method('logClientIn') ->with('username', 'password') ->will($this->returnValue(true)); - $this->userSession - ->expects($this->once()) - ->method('createSessionToken'); $user = $this->getMockBuilder('\OCP\IUser') ->disableOriginalConstructor() ->getMock(); - $user->expects($this->exactly(4)) + $user->expects($this->exactly(3)) ->method('getUID') ->will($this->returnValue('MyTestUser')); $this->userSession - ->expects($this->exactly(4)) + ->expects($this->exactly(3)) ->method('getUser') ->will($this->returnValue($user)); $response = $this->auth->check($server->httpRequest, $server->httpResponse); |