Author Topic: LDAP Patch ... Login, Identities and change password  (Read 8344 times)

Offline Darkside

  • Newbie
  • *
  • Posts: 1
LDAP Patch ... Login, Identities and change password
« on: July 31, 2007, 05:54:19 AM »
Hello@all!!

First: My english is very bad :( (my mother tongue is german ... i never learned english). Sorry for the broken english text.

I manage my Users in a LDAP Tree. The User have a unique ID and several email-addresses. My User can authenticate on IMAP via UID or all email-adresses.

I have roundcube modify to query login-user in a LDAP Tree and read the Identities (email-addresses) from LDAP Entry.
This patch based on SVN Snapshot 651 from 2007/07/03.

My Patch in detail:
  • query login information:
    roundcube create a mysql entry based on login-name. My Patch make a query the configured LDAP Server with this login-name and read the uid and change the roundcube username to this uid. Then create roundcube the mysql Entry.
  • identities:
    roundcube create by first login a identity entry in the Database. With the Patch not any more. By compose the eMail read the Patch all email-addresses from the LDAP entry and mixed with possible identities from the SQL-Database.
    At listing of identities the Patch presents a mix of LDAP email-addresses and the configured identities. The User can setting a Name, Organization etc. to all LDAP email-addresses. The information saved into the SQL-Database.

  • password change:
    have the user writable acces to the password field in the ldap tree, then the user can change the password with this patch. I have modified the Patch from this topic: http://roundcubeforum.net/forum/index.php?topic=42.0
by the way: i am a hobby coder ... not a profi.

The Patch can download here: http://download.schmidtie.de/roundcube/roundcube_ldap_1.0.diff

In the config/main.inc.php must set the follow entry:
Code: [Select]
$rcmail_config['ldap_user'] = array(
  'hosts'     => array('<ldapserver>'),
  'port'     => 389,             // optional ... default: 389
  'protocol'   => 3,              // optional ... (i have patched a bugfix? in rcube_ldap.inc row 88)
  'base_dn'    => '<basedn>',
  'bind_dn'    => '<binddn>',        // optional
  'bind_pass'   => '<bindpwd>',       // optional
  'userid_field' => '<fieldname of uid>',  // must!
  'email_field'  => '<fieldname with mail-addresses>', // must!
  'pwd_fields'  => array(
    '<fieldname of password>' => '<encryption method>'); // must ... one entry or a array with more as one password fields (my user-entry have a encypted and a clear password field)
  'scope'     => 'sub',            // search mode: sub|base|list
  'filter'    => '<ldap filter string>',    // the var '%u' changed to the username
  'fuzzy_search' => true);          // for the original ldap class from roundcube :)

encryption methods: (dependent from PHP config)
  • crypt
  • ext_des
  • md5_crypt
  • blowfish
  • md5
  • sha
  • ssha
  • smd5

OK, thats all. I hope my text is a bit understandable :)

Andreas

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,566
    • http://SKaero.com/
Re: LDAP Patch ... Login, Identities and change password
« Reply #1 on: July 31, 2007, 05:42:16 PM »
Thanks I am shear this will come in handy for people will similar problems. ;)

Offline Naatan

  • Newbie
  • *
  • Posts: 1
Re: LDAP Patch ... Login, Identities and change password
« Reply #2 on: August 31, 2007, 09:13:43 AM »
I was searching for a plugin that does just this, only we use Active Directory at my work, and I didn't manage to get it working, which is weird since the address book does work, I just get a white page when I go to roundcube. I'll try patching RC1 later (using SVN version now).

I sincerely hope this feature will be added to roundcube natively.

Offline dresdn

  • Newbie
  • *
  • Posts: 1
Re: LDAP Patch ... Login, Identities and change password
« Reply #3 on: September 14, 2007, 01:38:23 PM »
Darkside:

Thanks for the patch! I had a lot of problems getting it to work out of the gate, so I took some time and cleaned it up. To be honest, Darkside's patch shouldn't work at all as it's missing the random_salt() method from phpLDAPAdmin, so I added that. ;)

This patch works with 1.0-rc1. Just follow the steps from Darkside about putting information in the config/main.inc.php, and you'll be good to go. If you have problems, just change the $rcmail_config['debug_level'] to 4 and give it a whirl (I had a typo in my LDAP username >:( )

Anyways, enjoy and let me know if there are any problems with it!

-Dresdn

Offline srenon

  • Newbie
  • *
  • Posts: 1
Re: LDAP Patch ... Login, Identities and change password
« Reply #4 on: December 11, 2007, 12:22:01 PM »
Did someone have a similar patch for RC2?

Thanks

Offline lacri

  • Full Member
  • ***
  • Posts: 179
    • http://www.php-lexikon.de
LDAP Patch ... Login, Identities and change password
« Reply #5 on: January 14, 2009, 07:31:03 AM »
hi all
sorry for my bad english

i need this features for RC 2 stable

plz help