summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-10-23 07:46:49 -0700
committerGitHub <noreply@github.com>2017-10-23 07:46:49 -0700
commitad66244bdf073458f7a12147e1f62625c5fc0643 (patch)
treeffce3c74f5a1600e69cb744c9924f17b7df3d091
parentaaad2ab6b08875d95f71c95aa014f675a7ac18c4 (diff)
parent791fa6905f6f2b2991c65c366461f761653efcc5 (diff)
downloadnextcloud-server-ad66244bdf073458f7a12147e1f62625c5fc0643.tar.gz
nextcloud-server-ad66244bdf073458f7a12147e1f62625c5fc0643.zip
Merge pull request #6910 from nextcloud/backport-6677-s12
[stable12] don't reset quota
-rw-r--r--apps/user_ldap/lib/Connection.php4
-rw-r--r--apps/user_ldap/lib/User/User.php1
-rw-r--r--apps/user_ldap/tests/User/UserTest.php25
3 files changed, 12 insertions, 18 deletions
diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php
index 10fbea7174b..5b5991e4995 100644
--- a/apps/user_ldap/lib/Connection.php
+++ b/apps/user_ldap/lib/Connection.php
@@ -436,8 +436,8 @@ class Connection extends LDAPUtility {
|| ($agent !== '' && $pwd === '')
) {
\OCP\Util::writeLog('user_ldap',
- $errorStr.'either no password is given for the'.
- 'user agent or a password is given, but not an'.
+ $errorStr.'either no password is given for the '.
+ 'user agent or a password is given, but not an '.
'LDAP agent.',
\OCP\Util::WARN);
$configurationOK = false;
diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php
index 5017f35ed0a..a46b0053b40 100644
--- a/apps/user_ldap/lib/User/User.php
+++ b/apps/user_ldap/lib/User/User.php
@@ -529,7 +529,6 @@ class User {
$targetUser->setQuota($quota);
} else {
$this->log->log('not suitable default quota found for user ' . $this->uid . ': [' . $defaultQuota . ']', \OCP\Util::WARN);
- $targetUser->setQuota('default');
}
} else {
$this->log->log('trying to set a quota for user ' . $this->uid . ' but the user is missing', \OCP\Util::ERROR);
diff --git a/apps/user_ldap/tests/User/UserTest.php b/apps/user_ldap/tests/User/UserTest.php
index 5563eeef9cf..27409489a9b 100644
--- a/apps/user_ldap/tests/User/UserTest.php
+++ b/apps/user_ldap/tests/User/UserTest.php
@@ -453,9 +453,8 @@ class UserTest extends \Test\TestCase {
->will($this->returnValue(false));
$user = $this->createMock('\OCP\IUser');
- $user->expects($this->once())
- ->method('setQuota')
- ->with('default');
+ $user->expects($this->never())
+ ->method('setQuota');
$userMgr->expects($this->once())
->method('get')
@@ -495,9 +494,8 @@ class UserTest extends \Test\TestCase {
->method('__get');
$user = $this->createMock('\OCP\IUser');
- $user->expects($this->once())
- ->method('setQuota')
- ->with('default');
+ $user->expects($this->never())
+ ->method('setQuota');
$userMgr->expects($this->once())
->method('get')
@@ -633,9 +631,8 @@ class UserTest extends \Test\TestCase {
->will($this->returnValue(false));
$user = $this->createMock('\OCP\IUser');
- $user->expects($this->once())
- ->method('setQuota')
- ->with('default');
+ $user->expects($this->never())
+ ->method('setQuota');
$userMgr->expects($this->once())
->method('get')
@@ -681,9 +678,8 @@ class UserTest extends \Test\TestCase {
->will($this->returnValue(array('23 flush')));
$user = $this->createMock('\OCP\IUser');
- $user->expects($this->once())
- ->method('setQuota')
- ->with('default');
+ $user->expects($this->never())
+ ->method('setQuota');
$userMgr->expects($this->once())
->method('get')
@@ -726,9 +722,8 @@ class UserTest extends \Test\TestCase {
->method('readAttribute');
$user = $this->createMock('\OCP\IUser');
- $user->expects($this->once())
- ->method('setQuota')
- ->with('default');
+ $user->expects($this->never())
+ ->method('setQuota');
$userMgr->expects($this->once())
->method('get')