Skip to content

Commit

Permalink
Merge pull request #6910 from nextcloud/backport-6677-s12
Browse files Browse the repository at this point in the history
[stable12]  don't reset quota
  • Loading branch information
MorrisJobke authored Oct 23, 2017
2 parents aaad2ab + 791fa69 commit ad66244
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
4 changes: 2 additions & 2 deletions apps/user_ldap/lib/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ private function doCriticalValidation() {
|| ($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;
Expand Down
1 change: 0 additions & 1 deletion apps/user_ldap/lib/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ public function updateQuota($valueFromLDAP = null) {
$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);
Expand Down
25 changes: 10 additions & 15 deletions apps/user_ldap/tests/User/UserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,8 @@ public function testUpdateQuotaNoneProvided() {
->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')
Expand Down Expand Up @@ -495,9 +494,8 @@ public function testUpdateQuotaNoneConfigured() {
->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')
Expand Down Expand Up @@ -633,9 +631,8 @@ public function testUpdateWrongDefaultQuotaProvided() {
->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')
Expand Down Expand Up @@ -681,9 +678,8 @@ public function testUpdateWrongQuotaAndDefaultAllProvided() {
->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')
Expand Down Expand Up @@ -726,9 +722,8 @@ public function testUpdateWrongDefaultQuotaNotProvided() {
->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')
Expand Down

0 comments on commit ad66244

Please sign in to comment.