owncloud / calendar

Calendar app for ownCloud
GNU Affero General Public License v3.0
121 stars 43 forks source link

When sharing a calendar, LDAP users show up as UUIDs #379

Open minneyar opened 8 years ago

minneyar commented 8 years ago

Steps to reproduce

  1. Use LDAP for user authentication.
  2. Go to the Calendar app in OwnCloud.
  3. Click the button to share a calendar with other users
  4. Begin typing a user name in the field.
  5. Observe that instead of users names, UUIDs appear.

Internally, OwnCloud creates UUIDs for LDAP users that it uses as their username. There is a separate display name that is used whenever the user's name should be displayed in the GUI. It seems that LDAP users are being displayed as their UUID instead of display name.

Expected behaviour

User's display names should be displayed in the auto-complete list when sharing a calendar.

Actual behaviour

User's internal UUIDs appear in the list. After sharing a calendar with a user, their UUID appears in the list of peoples whom the calendar has been shared with.

Server configuration

Operating system: Ubuntu Linux 14.04 Web server: Apache 2.4.7 Database: MySQL 5.6.28 PHP version: 5.5.9 ownCloud version: 9.0.0 Calendar version: 1.0.0 Updated from an older ownCloud or fresh install: Updated Signing status (ownCloud 9.0 and above):

(no results; redirects to main page)

List of activated apps:

Enabled:
  - activity: 2.2.1
  - calendar: 1.0
  - comments: 0.2
  - contacts: 1.1.0.0
  - dav: 0.1.5
  - federatedfilesharing: 0.1.0
  - federation: 0.0.4
  - files: 1.4.4
  - files_pdfviewer: 0.8
  - files_sharing: 0.9.1
  - files_texteditor: 2.1
  - files_trashbin: 0.8.0
  - files_versions: 1.2.0
  - files_videoplayer: 0.9.8
  - firstrunwizard: 1.1
  - gallery: 14.5.0
  - notifications: 0.2.3
  - provisioning_api: 0.4.1
  - systemtags: 0.2
  - templateeditor: 0.1
  - updatenotification: 0.1.0
  - user_ldap: 0.8.0
Disabled:
  - calendar.old
  - encryption
  - external
  - files_external
  - user_external

The content of config/config.php:

{
    "system": {
        "instanceid": "ocd18810cada",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "\/var\/lib\/owncloud\/data",
        "dbtype": "pgsql",
        "version": "9.0.0.19",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "forcessl": true,
        "ldapIgnoreNamingRules": false,
        "theme": "",
        "maintenance": false,
        "trusted_domains": [
            "removed"
        ],
        "share_folder": "\/Shared",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "log_type": "syslog",
        "logfile": "",
        "loglevel": 1,
        "mail_smtpmode": "smtp",
        "mail_from_address": "owncloud",
        "mail_domain": "removed",
        "mail_smtphost": "127.0.0.1",
        "overwrite.cli.url": "\/owncloud",
        "mail_smtpport": "587",
        "updatechecker": false,
        "trashbin_retention_obligation": "auto",
        "singleuser": false,
        "appstore.experimental.enabled": true,
        "memcache.local": "\\OC\\Memcache\\APCu"
    }
}

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

LDAP configuration (delete this part if not used)

+-------------------------------+---------------------------------------------------------------------------------------------------------------------------+
| Configuration                 |                                                                                                                           |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------+
| hasMemberOfFilterSupport      | 1                                                                                                                         |
| hasPagedResultSupport         |                                                                                                                           |
| homeFolderNamingRule          |                                                                                                                           |
| lastJpegPhotoLookup           | 0                                                                                                                         |
| ldapAgentName                 | cn=ldapuser,dc=example,dc=com                                                                                          |
| ldapAgentPassword             | ***                                                                                                                       |
| ldapAttributesForGroupSearch  |                                                                                                                           |
| ldapAttributesForUserSearch   |                                                                                                                           |
| ldapBackupHost                |                                                                                                                           |
| ldapBackupPort                |                                                                                                                           |
| ldapBase                      | dc=example,dc=com                                                                                                       |
| ldapBaseGroups                | dc=example,dc=com                                                                                                       |
| ldapBaseUsers                 | dc=example,dc=com                                                                                                       |
| ldapCacheTTL                  | 600                                                                                                                       |
| ldapConfigurationActive       | 1                                                                                                                         |
| ldapDynamicGroupMemberURL     |                                                                                                                           |
| ldapEmailAttribute            | mail                                                                                                                      |
| ldapExperiencedAdmin          | 0                                                                                                                         |
| ldapExpertUUIDGroupAttr       |                                                                                                                           |
| ldapExpertUUIDUserAttr        |                                                                                                                           |
| ldapExpertUsernameAttr        |                                                                                                                           |
| ldapGroupDisplayName          | cn                                                                                                                        |
| ldapGroupFilter               | (&(|(objectclass=posixGroup)))                                                                                            |
| ldapGroupFilterGroups         |                                                                                                                           |
| ldapGroupFilterMode           | 0                                                                                                                         |
| ldapGroupFilterObjectclass    | posixGroup                                                                                                                |
| ldapGroupMemberAssocAttr      | uniqueMember                                                                                                              |
| ldapHost                      | 127.0.0.1                                                                                                                 |
| ldapIgnoreNamingRules         |                                                                                                                           |
| ldapLoginFilter               | (&(&(|(objectclass=inetOrgPerson)))(|(uid=%uid)(|(mailPrimaryAddress=%uid)(mail=%uid))(|(cn=%uid)(mail=%uid)(uid=%uid)))) |
| ldapLoginFilterAttributes     | cn;mail;uid                                                                                                               |
| ldapLoginFilterEmail          | 1                                                                                                                         |
| ldapLoginFilterMode           | 0                                                                                                                         |
| ldapLoginFilterUsername       | 1                                                                                                                         |
| ldapNestedGroups              | 0                                                                                                                         |
| ldapOverrideMainServer        |                                                                                                                           |
| ldapPagingSize                | 500                                                                                                                       |
| ldapPort                      | 389                                                                                                                       |
| ldapQuotaAttribute            |                                                                                                                           |
| ldapQuotaDefault              |                                                                                                                           |
| ldapTLS                       | 0                                                                                                                         |
| ldapUserDisplayName           | displayname                                                                                                               |
| ldapUserDisplayName2          |                                                                                                                           |
| ldapUserFilter                | (&(|(objectclass=inetOrgPerson)))                                                                                         |
| ldapUserFilterGroups          |                                                                                                                           |
| ldapUserFilterMode            | 0                                                                                                                         |
| ldapUserFilterObjectclass     | inetOrgPerson                                                                                                             |
| ldapUuidGroupAttribute        | auto                                                                                                                      |
| ldapUuidUserAttribute         | auto                                                                                                                      |
| turnOffCertCheck              | 0                                                                                                                         |
| useMemberOfToDetectMembership | 1                                                                                                                         |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------+

Client configuration

Browser: Chrome 49 Operating system: Linux Mint 17.3 CalDAV-clients: n/a

Logs

Web server error log

127.0.0.1 - - [29/Mar/2016:14:56:49 -0500] "GET /owncloud/ocs/v1.php/apps/files_sharing/api/v1/sharees?format=json&search=j&perPage=200&itemType=principals HTTP/1.1" 200 1322 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36"

ownCloud log (data/owncloud.log)

Mar 29 14:55:05 hostname slapd[3926]: <= bdb_substring_candidates: (displayName) not indexed
Mar 29 14:55:05 hostname slapd[3926]: <= bdb_substring_candidates: (cn) not indexed
georgehrke commented 8 years ago

cc @tomneedham

ksteinb commented 8 years ago

I did try to output shareWithDisplayName instead of shareWith in the app.js file but to no help, its probably set to owncloud_name.

It looks like there are more changes needed, the apps probably needs to use OCP\IUsermanager

Sincerly, Klaus

devuan2 commented 8 years ago

I've been testing with this patch. It's not complete fix, but a start.

--- cur/apps/calendar/js/public/app.js  2016-07-06 12:45:16.669998144 -0500
+++ new/apps/calendar/js/public/app.js  2016-07-06 12:55:30.397998144 -0500
@@ -621,7 +621,7 @@
                // Combine users and groups
                users = users.map(function(item){
                    return {
-                       display: item.value.shareWith,
+                       display: item.label,
                        type: OC.Share.SHARE_TYPE_USER,
                        identifier: item.value.shareWith
                    };