Author Topic: Patch to get name and e-mail from LDAP (at login time)  (Read 8359 times)

Offline neto

  • Newbie
  • *
  • Posts: 1
Patch to get name and e-mail from LDAP (at login time)
« on: September 21, 2006, 07:29:14 PM »
Hi,

I belive this patch can help other people with RoundCube and LDAP. At the logon time, RoundCube query an ldap server, getting name and e-mail from user (In my case, the users logon with an unique code). The information got from LDAP is saved in mysql database (identities table).

How to install:
1. Copy the file main.inc.patch (attach in this post - remove .txt extension) to directory program/include of roundcube;
2. execute: patch < main.inc.patch
3. In the config/main.inc.php file, insert:
Code: [Select]
$rcmail_config['virtuser_ldap'] = array('hosts' => 'your.ldap.server',
'port'     => 389,
'base_dn'    => 'ou=users,dc=domain,dc=com',
'name_field'  => 'cn',
'mail_field'  => 'mail',
'scope'     => 'sub');
4. Run tests. Rember, only new users (with no identities record) will be with correct name and e-mail.

There is a ticket (#1310442) requesting something like this...(I belive).

Enjoy!
Neto.


Offline corrigan

  • Newbie
  • *
  • Posts: 5
Re: Patch to get name and e-mail from LDAP (at login time)
« Reply #1 on: March 18, 2008, 01:29:20 PM »
Any chance this could be updated for 0.1? I was able to get it working in RC2 but so far 0.1 is stumping me. I'm pretty sure this code now belongs in the rcube_user.inc file, but I can't make it work. Our mail server lets people log in with either their unix login or their email address (first.last). We want to make sure that their First.Last is used as their from address, and so far it seems like my two options are to get this patch working, or to have a cron that queries ldap daily and builds a new virtuser file. I'd prefer not going the virtuser file method.

Offline CloneVince

  • Newbie
  • *
  • Posts: 1
Re: Patch to get name and e-mail from LDAP (at login time)
« Reply #2 on: April 10, 2008, 03:40:22 AM »
yep, plz update for 0.1.1 :)

Offline corrigan

  • Newbie
  • *
  • Posts: 5
Re: Patch to get name and e-mail from LDAP (at login time)
« Reply #3 on: April 17, 2008, 01:36:08 PM »
It would be great if this were just rolled into the product, so that we don't have to patch each time a new version comes out.

Offline olivier158

  • Newbie
  • *
  • Posts: 1
Patch to get name and e-mail from LDAP (at login time)
« Reply #4 on: May 15, 2008, 08:04:26 AM »
Hello,

i'm discovering roundcube.. to replace squirrel. Everything work fine but i need this patch lol.. when i try to patch it (latest version of roundcube), i didn't work, i've got this in the .rej :
****
***************
*** 565,570 ****
          $user_email = $sql_arr[0];
        }
 
      // also create new identity records
      $DB->query("INSERT INTO ".get_table_name('identities')."
                  (user_id, del, standard, name, email)
--- 565,604 ----
          $user_email = $sql_arr[0];
        }
 
+     // get name and e-mail from ldap
+     if (!empty($CONFIG['virtuser_ldap']))
+       {
****

Has somebody an idea ? :o)

thanks a lot !!!

Offline philjones2000

  • Newbie
  • *
  • Posts: 3
Patch to get name and e-mail from LDAP (at login time)
« Reply #5 on: August 04, 2008, 06:56:28 AM »
Is there any news regarding this?