Code Monkey home page Code Monkey logo

ldap_contacts_backend's Introduction

LDAP Contacts Backend

LDAP backend for Nextcloud Contacts

image

Adds a virtual address book and enables importing contacts to a user's individual address book.

You and your users will be able to search through the LDAP contacts via the global contacts menu. An import action allows to copy the contact over to the best fitting existing addressbook. A redirect takes you the contacts app with the newly created card open.

Note: The Contacts app for Nextcloud should also be installed.

Configuring

In order to configure an LDAP backend, run:

./occ ldap_contacts:add --interactive <ADDRESS_BOOK_NAME>

Where <ADDRESSBOOK_NAME> is a name you like to identify the virtual addressbook with. The interactive mode leads you through the configuration, but you can also use the --help flag to see all the options.

Commands

./occ ldap_contacts:add

Add an LDAP contacts backend configuration

./occ ldap_contacts:edit

Edit an LDAP contacts backend configuration

./occ ldap_contacts:list

Lists all LDAP contacts backend configurations

./occ ldap_contacts:delete

Delete an LDAP contacts backend configuration

Example configuration

occ ldap_contacts:add test \
  --host=localhost \
  --port=389 \
  --trans_enc=tls \
  --bindDN='cn=admin,dc=...' \
  --bindPwd=****** \
  --filter='(objectClass=inetOrgPerson)' \
  --base='ou=users,dc=...' \
  --attrs=cn \
  --attrs=mail \
  --attrs=telephoneNumber \
  --mapping=EMAIL:mail \
  --mapping=FN:cn \
  --mapping=TEL:telephoneNumber

Additional documentation

Hints about what should go in some of the fields can be found by looking at the User authentication with LDAP documentation since many of the fields are similar.

ldap_contacts_backend's People

Contributors

blizzz avatar christophwurst avatar come-nc avatar github-actions[bot] avatar joshtrichards avatar juliushaertl avatar nextcloud-bot avatar nextcloud-command avatar nickvergessen avatar pvince81 avatar skjnldsv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ldap_contacts_backend's Issues

LDAP Contacts Backend - copy to address book

Hi,
when I search for a user in the LDAP it is displayed in the search window. If I tap the “Copy to address book” icon, an internal server error appears:
Interner Serverfehler Der Server konnte die Anfrage nicht fertig stellen. Sollte dies erneut auftreten, sende bitte die nachfolgenden technischen Einzelheiten an Deinen Server-Administrator. Weitere Details können im Server-Protokoll gefunden werden. Technische Details Entfernte Adresse: 192.168.30.67
I see the following information in the nextcloud.log:
"2021-09-30T09:34:52+00:00","remoteAddr":"192.168.30.67","user":"Administrator","app":"files_sharing","method":"GET","url":"/index.php/apps/ldap_contacts_backend/import/0/dWlkPWZ5bm4uaGFyYmljaCxvdT11c2VycyxkYz1oYXJuZXQsZGM9ZGU=?requesttoken=I/XMJxaTRAJ4ZJcBhT0VHeHL0twz3hTgeOq0kxBiumA%3D:UaW7YGDrF1QzPvgqsEdRVoqNmu9VqHrRCdnZ20cg%2BSo%3D","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0","version":"22.1.1.2"} {"reqId":"YgpYM23ECF3WEyW2N6r4","level":3,"time":"2021-09-30T09:34:52+00:00","remoteAddr":"192.168.30.67","user":"Administrator","app":"index","method":"GET","url":"/index.php/apps/ldap_contacts_backend/import/0/dWlkPWZ5bm4uaGFyYmljaCxvdT11c2VycyxkYz1oYXJuZXQsZGM9ZGU=?requesttoken=I/XMJxaTRAJ4ZJcBhT0VHeHL0twz3hTgeOq0kxBiumA%3D:UaW7YGDrF1QzPvgqsEdRVoqNmu9VqHrRCdnZ20cg%2BSo%3D","message":"Could not complete search with dn \"uid=fynn.harbich,ou=users,dc=example,dc=com\", query \"\" and filters \"*\". LDAP error was [2] Protocol error.","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0","version":"22.1.1.2","exception":{"Exception":"Symfony\\Component\\Ldap\\Exception\\LdapException","Message":"Could not complete search with dn \"uid=fynn.harbich,ou=users,dc=example,dc=com\", query \"\" and filters \"*\". LDAP error was [2] Protocol error.","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/apps/ldap_contacts_backend/lib/Service/LdapQuerent.php","line":56,"function":"execute","class":"Symfony\\Component\\Ldap\\Adapter\\ExtLdap\\Query","type":"->","args":[]},{"file":"/var/www/html/nextcloud/apps/ldap_contacts_backend/lib/Service/LdapCardBackend.php","line":56,"function":"fetchOne","class":"OCA\\LDAPContactsBackend\\Service\\LdapQuerent","type":"->","args":["uid=fynn.harbich,ou=users,dc=example,dc=com"]},{"file":"/var/www/html/nextcloud/apps/ldap_contacts_backend/lib/Service/AddressBook.php","line":59,"function":"getCard","class":"OCA\\LDAPContactsBackend\\Service\\LdapCardBackend","type":"->","args":["dWlkPWZ5bm4uaGFyYmljaCxvdT11c2VycyxkYz1oYXJuZXQsZGM9ZGU="]},{"file":"/var/www/html/nextcloud/apps/ldap_contacts_backend/lib/Controller/ContactsController.php","line":89,"function":"getChild","class":"OCA\\LDAPContactsBackend\\Service\\AddressBook","type":"->","args":["dWlkPWZ5bm4uaGFyYmljaCxvdT11c2VycyxkYz1oYXJuZXQsZGM9ZGU="]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"import","class":"OCA\\LDAPContactsBackend\\Controller\\ContactsController","type":"->","args":[0,"dWlkPWZ5bm4uaGFyYmljaCxvdT11c2VycyxkYz1oYXJuZXQsZGM9ZGU="]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\LDAPContactsBackend\\Controller\\ContactsController"},"import"]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\LDAPContactsBackend\\Controller\\ContactsController"},"import"]},{"file":"/var/www/html/nextcloud/lib/private/Route/Router.php","line":301,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\LDAPContactsBackend\\Controller\\ContactsController","import",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"sourceId":"0","contactId":"dWlkPWZ5bm4uaGFyYmljaCxvdT11c2VycyxkYz1oYXJuZXQsZGM9ZGU=","_route":"ldap_contacts_backend.contacts.import"}]},{"file":"/var/www/html/nextcloud/lib/base.php","line":1000,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/ldap_contacts_backend/import/0/dWlkPWZ5bm4uaGFyYmljaCxvdT11c2VycyxkYz1oYXJuZXQsZGM9ZGU="]},{"file":"/var/www/html/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/nextcloud/apps/ldap_contacts_backend/vendor/symfony/ldap/Adapter/ExtLdap/Query.php","Line":126,"CustomMessage":"--"}}
Here is my ldap_contacts list:
root@dsme01:/var/www/html/nextcloud# sudo -u www-data php occ ldap_contacts:list id: 0 addressBookDisplayName: Harbich host: ldap.intern.example.com port: 636 agentDn: CN=admin,DC=example,DC=com agentPassword: ############# bases: DC=example,DC=com searchAttributes: UID attributeMapping: tEnc: ssl filter:
Do you have a tip for me?
Greetings from Stefan Harbich

nextcloud ldap vcard import error

good morning i have successfully established a connection with ldap.
fresh nextcloud 21 instance
parameter:
sudo -u www-data php occ ldap_contacts:add test \ --host=localhost \ --port=389 \ --trans_enc=tls \ --bindDN='cn=admin,dc=...' \ --bindPwd=****** \ --filter='(objectClass=inetOrgPerson)' \ --base='ou=users,dc=...' \ --attrs=cn \ --attrs=mail \ --attrs=telephoneNumber \ --mapping=EMAIL:mail \ --mapping=FN:cn \ --mapping=TEL:telephoneNumber

now I get the following error in nextcloud by searching contacts:

Error: Undefined index: PHOTO at /var/www/nextcloud/apps/ldap_contacts_backend/lib/Service/ContactsAddressBook.php#97 /var/www/nextcloud/apps/ldap_contacts_backend/lib/Service/ContactsAddressBook.php - line 97: OC\Log\ErrorHandler::onError() /var/www/nextcloud/lib/private/ContactsManager.php - line 52: OCA\LDAPContactsBackend\Service\ContactsAddressBook->search() /var/www/nextcloud/lib/private/Contacts/ContactsMenu/ContactsStore.php - line 87: OC\ContactsManager->search() /var/www/nextcloud/lib/private/Contacts/ContactsMenu/Manager.php - line 71: OC\Contacts\ContactsMenu\ContactsStore->getContacts() /var/www/nextcloud/core/Controller/ContactsMenuController.php - line 61: OC\Contacts\ContactsMenu\Manager->getEntries() /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 218: OC\Core\Controller\ContactsMenuController->index() /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 127: OC\AppFramework\Http\Dispatcher->executeController() /var/www/nextcloud/lib/private/AppFramework/App.php - line 157: OC\AppFramework\Http\Dispatcher->dispatch() /var/www/nextcloud/lib/private/Route/Router.php - line 302: OC\AppFramework\App::main() /var/www/nextcloud/lib/base.php - line 993: OC\Route\Router->match() /var/www/nextcloud/index.php - line 37: OC::handleRequest()

error in nextcloud when trying to add the contact
Error: Illegal string offset 'value' at /var/www/nextcloud/apps/dav/lib/CardDAV/AddressBookImpl.php#157 /var/www/nextcloud/apps/dav/lib/CardDAV/AddressBookImpl.php - line 157: OC\Log\ErrorHandler::onError() /var/www/nextcloud/apps/ldap_contacts_backend/lib/Controller/ContactsController.php - line 156: OCA\DAV\CardDAV\AddressBookImpl->createOrUpdate() /var/www/nextcloud/apps/ldap_contacts_backend/lib/Controller/ContactsController.php - line 105: OCA\LDAPContactsBackend\Controller\ContactsController->createCard() /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 218: OCA\LDAPContactsBackend\Controller\ContactsController->import() /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 127: OC\AppFramework\Http\Dispatcher->executeController() /var/www/nextcloud/lib/private/AppFramework/App.php - line 157: OC\AppFramework\Http\Dispatcher->dispatch() /var/www/nextcloud/lib/private/Route/Router.php - line 302: OC\AppFramework\App::main() /var/www/nextcloud/lib/base.php - line 993: OC\Route\Router->match() /var/www/nextcloud/index.php - line 37: OC::handleRequest()

Mapping for types and other fields

Is it possible to map multiple telephone number to work,home,mobile,fax numbers
also for IM in nextcloud Instant messaging IRC,XMPP,....
or other fields

Cannot configure LDAP, allowed memory size exhausted

Hello,

in Nextcloud version 22, trying to execute:

sudo -u www-data php occ ldap_contacts:add --interactive SomeText

exits with the following fatal error:

Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 446464 bytes) in /var/www/html/3rdparty/composer/autoload_real.php on line 37

Any possible solutions?

I tried to make the memory_limit in /usr/local/etc/php/php.ini-production and development higher, but that did not help.

no feedback of cli comand

i run the cli command and entered all needed information but then no "success" nor a "failure" message is shown.

in the nextcloud gui there is also no button behind the users to add it to an own addressbook

Copy to Addressbook not working

i can see the ldap search and it works with the Admin account but when i do it with an other user then appers a website with "The user must be a Administrator "

image

What can i do? any ideas?

Can't configure LDAP backend

I can't configure any LDAP backend on Nextcloud 20.0.2:

sudo -u www-data /usr/bin/php occ ldap_contacts:add --interactive $TEST
Address book display name: TEST
An unhandled exception has been thrown:
TypeError: Argument 3 passed to OCA\LDAPContactsBackend\Service\ConnectionImporter::extractTlsMode() must be of the type string, int given, called in /var/www/html/apps/ldap_contacts_backend/lib/Service/ConnectionImporter.php on line 71 and defined in /var/www/html/apps/ldap_contacts_backend/lib/Service/ConnectionImporter.php:84
Stack trace:
#0 /var/www/html/apps/ldap_contacts_backend/lib/Service/ConnectionImporter.php(71): OCA\LDAPContactsBackend\Service\ConnectionImporter->extractTlsMode()
#1 /var/www/html/apps/ldap_contacts_backend/lib/Command/Add.php(322): OCA\LDAPContactsBackend\Service\ConnectionImporter->getAvailableConnections()
#2 /var/www/html/apps/ldap_contacts_backend/lib/Command/Add.php(158): OCA\LDAPContactsBackend\Command\Add->askImport()
#3 /var/www/html/3rdparty/symfony/console/Command/Command.php(240): OCA\LDAPContactsBackend\Command\Add->interact()
#4 /var/www/html/core/Command/Base.php(169): Symfony\Component\Console\Command\Command->run()
#5 /var/www/html/3rdparty/symfony/console/Application.php(1000): OC\Core\Command\Base->run()
#6 /var/www/html/3rdparty/symfony/console/Application.php(271): Symfony\Component\Console\Application->doRunCommand()
#7 /var/www/html/3rdparty/symfony/console/Application.php(147): Symfony\Component\Console\Application->doRun()
#8 /var/www/html/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
#9 /var/www/html/console.php(100): OC\Console\Application->run()
#10 /var/www/html/occ(11): require_once('/var/www/html/c...')

Add support for ldapi:// connections

I have run the add-command and chosen to re-use the existing connection used for my user directory. This is the output

$ sudo -u www-data /usr/bin/php occ ldap_contacts:list
id: 0
addressBookDisplayName: *****
host: /run/ldapi
port: 0

The import function incorrectly interprets the $host variable as well as the $port variable.

Ability to edit in extension settings var "DEFAULT_MAPPING"

Hello, you make a very cool extension that helps automate adding contacts in my organization. But I noticed a small number of ldap attributes in the original stake. Could you add the ability to edit this variable DEFAULT_MAPPING, and add support for different ldap schemes, because the attributes in the directory and openldap assets may differ in the default scheme
Or just add birthdays please)

Filter Error Symfony\Component\Ldap\Exception\LdapException: Could not complete search with dn "OU=Contacts,OU=Contacts,DC=xxx,DC=xxx", query "(&(&(objectClass=contact))(|(=*)))" and filters "*". LDAP error was [-7] Bad search filter.

Hey, having some problem with setting this up on our Owncloud solution.
getting this error when specifying a filter or if leaving it blank. I have tried using the interactive menu, adding the filter= option and leaving it blank to run as default and all return the same value. its as if the filter= option and the interactive menu arent applying the filter i provide and the default one has an error causing it to fail. Below is an extract from the logs:

`Symfony\Component\Ldap\Exception\LdapException: Could not complete search with dn "OU=Contacts,DC=xxx,DC=xxx", query "(&(&(objectClass=contact))(|(=)))" and filters "". LDAP error was [-7] Bad search filter.

/var/www/nextcloud/apps/ldap_contacts_backend/lib/Service/LdapQuerent.php - line 75:

Symfony\Component\Ldap\Adapter\ExtLdap\Query->execute()

/var/www/nextcloud/apps/ldap_contacts_backend/lib/Service/LdapQuerent.php - line 93:

OCA\LDAPContactsBackend\Service\LdapQuerent->fetchAll()

/var/www/nextcloud/apps/ldap_contacts_backend/lib/Service/LdapCardBackend.php - line 63:

OCA\LDAPContactsBackend\Service\LdapQuerent->find()

/var/www/nextcloud/apps/ldap_contacts_backend/lib/Service/ContactsAddressBook.php - line 84:

OCA\LDAPContactsBackend\Service\LdapCardBackend->searchCards()

/var/www/nextcloud/lib/private/ContactsManager.php - line 52:

OCA\LDAPContactsBackend\Service\ContactsAddressBook->search()

/var/www/nextcloud/lib/private/Contacts/ContactsMenu/ContactsStore.php - line 87:

OC\ContactsManager->search()

/var/www/nextcloud/lib/private/Contacts/ContactsMenu/Manager.php - line 70:

OC\Contacts\ContactsMenu\ContactsStore->getContacts()

/var/www/nextcloud/core/Controller/ContactsMenuController.php - line 61:

OC\Contacts\ContactsMenu\Manager->getEntries()

/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 169:

OC\Core\Controller\ContactsMenuController->index()

/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 100:

OC\AppFramework\Http\Dispatcher->executeController()

/var/www/nextcloud/lib/private/AppFramework/App.php - line 152:

OC\AppFramework\Http\Dispatcher->dispatch()

/var/www/nextcloud/lib/private/Route/Router.php - line 308:

OC\AppFramework\App::main()

/var/www/nextcloud/lib/base.php - line 1008:

OC\Route\Router->match()

/var/www/nextcloud/index.php - line 37:

OC::handleRequest()`

Loading LDAP contacts fail (due to conversion?)

I cannot make it work on Nextcloud 23.0.2 and LDAP Contacts Backend 1.2.0

As far as I know, I configured the backend's addressbook correctly.
However, loading contacts from LDAP fails, and it fails so hard that it brings down global contact search in its entirety.

I never did php, but last time I managed to insert some printing to the affected code path, and I am pretty sure the configured search returns entries. Problem seems to be around LdapEntryToVcard Here is the sanitized log.

Feb 18 11:36:34 mail.example.com nextcloud[22355]: {"reqId":"64xjcQrCsrwtaqAncJzw","level":3,"time":"2022-02-18T10:36:34+00:00","remoteAddr":"86.59.192.114","user":"userName","app":"index","method":"POST","url":"/contactsmenu/contacts","message":"{\"Exception\":\"RuntimeException\",\"Message\":\"Invalid record or configuration for vcard\",\"Code\":0,\"Trace\":[{\"file\":\"nextcloud_full_path/apps/ldap_contacts_backend/lib/Service/LdapCardBackend.php\",\"line\":83,\"function\":\"convert\",\"class\":\"OCA\\\\LDAPContactsBackend\\\\Service\\\\LdapEntryToVcard\",\"type\":\"::\"},{\"file\":\"nextcloud_full_path/apps/ldap_contacts_backend/lib/Service/LdapCardBackend.php\",\"line\":64,\"function\":\"entryToCard\",\"class\":\"OCA\\\\LDAPContactsBackend\\\\Service\\\\LdapCardBackend\",\"type\":\"->\"},{\"file\":\"nextcloud_full_path/apps/ldap_contacts_backend/lib/Service/ContactsAddressBook.php\",\"line\":84,\"function\":\"searchCards\",\"class\":\"OCA\\\\LDAPContactsBackend\\\\Service\\\\LdapCardBackend\",\"type\":\"->\"},{\"file\":\"nextcloud_full_path/lib/private/ContactsManager.php\",\"line\":73,\"function\":\"search\",\"class\":\"OCA\\\\LDAPContactsBackend\\\\Service\\\\ContactsAddressBook\",\"type\":\"->\"},{\"file\":\"nextcloud_full_path/lib/private/Contacts/ContactsMenu/ContactsStore.php\",\"line\":111,\"function\":\"search\",\"class\":\"OC\\\\ContactsManager\",\"type\":\"->\"},{\"file\":\"nextcloud_full_path/lib/private/Contacts/ContactsMenu/Manager.php\",\"line\":70,\"function\":\"getContacts\",\"class\":\"OC\\\\Contacts\\\\ContactsMenu\\\\ContactsStore\",\"type\":\"->\"},{\"file\":\"nextcloud_full_path/core/Controller/ContactsMenuController.php\",\"line\":60,\"function\":\"getEntries\",\"class\":\"OC\\\\Contacts\\\\ContactsMenu\\\\Manager\",\"type\":\"->\"},{\"file\":\"nextcloud_full_path/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":217,\"function\":\"index\",\"class\":\"OC\\\\Core\\\\Controller\\\\ContactsMenuController\",\"type\":\"->\"},{\"file\":\"nextcloud_full_path/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":126,\"function\":\"executeController\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\"},{\"file\":\"nextcloud_full_path/lib/private/AppFramework/App.php\",\"line\":157,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\"},{\"file\":\"nextcloud_full_path/lib/private/Route/Router.php\",\"line\":302,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\"},{\"file\":\"nextcloud_full_path/lib/base.php\",\"line\":1006,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\"},{\"file\":\"nextcloud_full_path/index.php\",\"line\":36,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\"}],\"File\":\"nextcloud_full_path/apps/ldap_contacts_backend/lib/Service/LdapEntryToVcard.php\",\"Line\":65,\"CustomMessage\":\"--\"}","userAgent"...}

How to configure in Nextcloud AIO

I am using the docker version of Nextcloud called AIO (All In One) and the commands specified in the documentation are not compabible with this setup.

Any help making it work in NC AIO is much appreciated.

Copy to address book not working - configuration issue?

Hello,

I am trying to configure this plugin with my Nextcloud 28 instance. The authentication is handled by Keycloak via OpenID Connect Login plugin. Keycloak federates the user database from my Active Directory server, and the LDAP user backend plugin should be connected directly to my Active Directory server, bypassing Keycloak.

I installed the plugin and configured it as follows (the LDAP server is running locally):

id: 0
addressBookDisplayName: mycompany
host: localhost
port: 389
agentDn: CN=CloudContacts,OU=MyCompany-Services,DC=int,DC=example,DC=com
agentPassword: mySecretPass
bases:
  OU=MyCompany-Users,DC=int,DC=example,DC=com
searchAttributes:
  cn
  mail
  telephoneNumber
attributeMapping:
  EMAIL: mail
  FN: cn
  TEL: telephoneNumber
tEnc: none
filter:

Now, I can see my LDAP users in the contacts' menu in the top right corner of my Nextcloud user interface. Unfortunately, when I click the "Copy to address book" option, I get the Internal server error page and in the Nextcloud log system, I can see the following error:

LdapException Could not complete search with dn "CN=My Person,OU=test,OU=MyCompany-Users,DC=int,DC=example,DC=com",
query "" and filters "*". LDAP error was [-1] Can't contact LDAP server.

1. /var/www/html/nextcloud/apps/ldap_contacts_backend/lib/Service/LdapQuerent.php line 55
   Symfony\Component\Ldap\Adapter\ExtLdap\Query->execute()
2. /var/www/html/nextcloud/apps/ldap_contacts_backend/lib/Service/LdapCardBackend.php line 55
   OCA\LDAPContactsBackend\Service\LdapQuerent->fetchOne()
3. /var/www/html/nextcloud/apps/ldap_contacts_backend/lib/Service/AddressBook.php line 58
   OCA\LDAPContactsBackend\Service\LdapCardBackend->getCard() 
4. /var/www/html/nextcloud/apps/ldap_contacts_backend/lib/Controller/ContactsController.php line 83
   OCA\LDAPContactsBackend\Service\AddressBook->getChild()
5. /var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 230
   OCA\LDAPContactsBackend\Controller\ContactsController->import()
6. /var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 137
   OC\AppFramework\Http\Dispatcher->executeController()
7. /var/www/html/nextcloud/lib/private/AppFramework/App.php line 184
   OC\AppFramework\Http\Dispatcher->dispatch()
8. /var/www/html/nextcloud/lib/private/Route/Router.php line 315
   OC\AppFramework\App::main()
9. /var/www/html/nextcloud/lib/base.php line 1069
   OC\Route\Router->match()
10. /var/www/html/nextcloud/index.php line 39
   OC::handleRequest()

Please guys, could you help me to fix this issue?

Scope of initial version

  • LDAP connectivity settings
    • add one or more LDAP connections
    • optionally import from LDAP backend
    • per each specify base, filter, attribute mappings
    • and the addressbook display name
  • A virtual addressbook
    • like the system addressbook, but browsable in the contacts app (so, perhaps might be a read-only user addressbook for this) (not desired). Read only nevertheless.
    • advantage: it feeds both contacts menu as well as auto-complete
    • implement as a DAV plugin
  • A contacts menu data provider
    • offers an import actions if the contacts is only in the LDAP addressbook
    • ⚠ importing it a user addressbook makes is writeable, but it will be overwritten on updates with the sync (see further). But perhaps we can make it smart and merge only what has changed.
  • Data handling
    • since contacts app loads all contacts, a live access to LDAP is not reasonable (appearance in contacts app not desired)
    • a regular background job will sync (and update) all records from LDAP
    • a sync button on the settings page can schedule a sync for the next run (e.g. also for initial sync)
    • in order to prevent information loss through carrdav clients, imported contacts are being mapped to the LDAP record (or its addressbook id) for future updates. (not desired)
    • When a contact cannot be found on LDAP anymore, it is removed from the virtual addressbook as well as the mapping. Connected imported contacts are left in the user addressbooks. (not desired)

EDIT: data handling turned out to be not necessary, as the search performance against LDAP is good

VCARD4.0 format

Hello,
I implement that plugin. Not very easy but very cool tool !

I face a difficulty.
In case of simple VCARD field like MAIL no issue.
In case of more complex field such as TEL or ADR, I don't see how I can't stick to VCARD format using coma as separator...

for ADR:
Using Dolibarr, my LDAP is filled up for address with multiple fields

  • street
  • postalcode
  • L (city)

So that, it would be logical for me to have a mapping looking like:
ADR;TYPE=WORK:;;street;L;;postalcode;

Is there a workaround for that issue ?

For TEL,
it is slightly different.
You set up an aproach like "TEL:telephonenumber,mobile"
This does not help to fill TYPE.
It would be interesting to have
TEL;TYPE=CELL:mobile <-- this is working
but
TEL;TYPE=WORK,VOICE:telephonenumber <-- this is not working probably because of coma between work and voice (not 100% sure)

Would it be possible to tweak a bit your code to solve that 2 issues ?
Many thanks
francoisPE

LDAP connectivity settings

for the first package of #1

Mockups

Settings overview

Collapsed overview (to be placed below the currently existing LDAP settings):

settings overview

Not very spectacular. It is a list of collapsed, configured LDAP connections that should be used a contacts backend, plus the option to add one.


Full view of a backend configuration

Connection full view

The connection details would be collapsed by default. The thought behind them is: if an existing LDAP configuration is being used, look up the settings from there. If something else is necessary, like a different service user for permissions, this can be unlocked or unbound and we copy the stuff over that we need. The button and info text will not be shown. These fields are also necessary when we have a connection entirely separate from a user backend one.

The rest is as above.


New connection picker model

Add LDAP backend

Lists the available configurations from the user backend and an option for a new connection. Straight forward.

Add attribute mapping for first name and last name

Hi @blizzz,
As far as I've seen in the two tickets (I didn't check the code), you're only mapping the display name. I propose you should also map fist name and last name seperately. This allows you to distinguish more precisely in he following cases:

  • Three names, for example:
    • Two first names, e.g. John Jacob Astor
    • Two last names, e.g. Felix Schulze Müller (yes, I know a person named like this and his two last names are seperated by a space)
    • Titles, e.g. Dr. John Doe
    • Nobility, e.g. Otto Graf von Bismarck

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.