owncloud / owncloud/user_ldap

occ user:sync 'OCA\User_LDAP\User_Proxy' overwrites manual quotas since update to version 0.10.0

Open
#171 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
17
Forks
19
Avg merge
11h 40m
Merged PRs (30d)
2

Description

Hi guys,
since I updated the user_ldap app to version 0.10.0 via market, every time I sync my ldap users via occ user:sync 'OCA\User_LDAP\User_Proxy' the manually set quotas get overwritten to default. This is behavior is only reproducible with version 0.10.0 and does not appear in version 0.9.1. Our LDAP does not deliver any quota values to user_ldap in general.

Steps to reproduce

  • set a quota for a user in owncloud webinterface
  • run php occ user:sync 'OCA\User_LDAP\User_Proxy'
  • check quota of user again, its set to default

Expected behaviour

  • manual quotas should not be touched while theres no value from LDAP Server

Server configuration

Operating system: Ubuntu 16.04
Web server: apache
Database: mysql
PHP version: PHP 7.0.22
ownCloud version: 10.0.4
Where did you install ownCloud from: owncloud repository
List of activated apps:

Enabled:
  - activity: 2.3.6
  - additional_groups: 0.2
  - comments: 0.3.0
  - configreport: 0.1.1
  - dav: 0.3.2
  - federatedfilesharing: 0.3.1
  - federation: 0.1.0
  - files: 1.5.1
  - files_external: 0.7.1
  - files_sharing: 0.10.1
  - files_trashbin: 0.9.1
  - files_versions: 1.3.0
  - files_videoplayer: 0.9.8
  - firstrunwizard: 1.1
  - imprint: 0.2.5
  - market: 0.2.3
  - notifications: 0.3.2
  - provisioning_api: 0.5.0
  - systemtags: 0.3.0
  - updatenotification: 0.2.1
  - user_ldap: 0.10.0
  - user_sql: 2.3
Disabled:
  - encryption
  - external
  - security
  - templateeditor
  - theme-example
  - user_external

Are you using external storage, if yes which one: no
Are you using encryption: no
Are you using an external user-backend, if yes which one: LDAP, user_sql (self modificated plugin for authentication against a 3rd user source)

LDAP configuration (delete this part if not used)

| ldap_quota_attr                   ||
| ldap_quota_def                    ||

Bad workaround

For temporary solution I found this workaround:

diff --git a/lib/User_Proxy.php b/lib/User_Proxy.php
index b42fe65..574f48e 100644
--- a/lib/User_Proxy.php
+++ b/lib/User_Proxy.php
@@ -34,7 +34,7 @@ use OCP\User\IProvidesExtendedSearchBackend;
 use OCP\User\IProvidesQuotaBackend;
 use OCP\UserInterface;

-class User_Proxy extends Proxy implements IUserBackend, UserInterface, IProvidesQuotaBackend, IProvidesExtendedSearchBackend, IProvidesEMailBackend {
+class User_Proxy extends Proxy implements IUserBackend, UserInterface, IProvidesExtendedSearchBackend, IProvidesEMailBackend {

        /**
         * @var User_LDAP[]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lib/User_Proxy.php and reproduce the issue with php occ user:sync 'OCA\User_LDAP\User_Proxy' after setting a manual quota. Inspect how the quota backend is exposed during synchronization when ldap_quota_attr and ldap_quota_def are empty; done means the manual quota remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authentication, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.