Changeset 7b86508 in github


Ignore:
Timestamp:
Aug 24, 2009 3:18:47 PM (4 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
6134717
Parents:
f436020
Message:
  • Password/LDAP: support %name, %domain in userdn (#1486055)
Location:
plugins/password
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/password/config.inc.php.dist

    r793e248 r7b86508  
    8888 
    8989// LDAP user DN mask 
    90 // The user's DN is mandatory and as we only have his login, we need to re-create his DN using a mask 
    91 // '%login' will be replace by the current roundcube user's login 
     90// The user's DN is mandatory and as we only have his login, 
     91// we need to re-create his DN using a mask 
     92// '%login' will be replaced by the current roundcube user's login 
     93// '%name' will be replaced by the current roundcube user's name part 
     94// '%domain' will be replaced by the current roundcube user's domain part 
    9295// Exemple: 'uid=%login,ou=people,dc=exemple,dc=com' 
    9396$rcmail_config['password_ldap_userDN_mask'] = 'uid=%login,ou=people,dc=exemple,dc=com'; 
  • plugins/password/drivers/ldap.php

    r793e248 r7b86508  
    2222    // Building user DN 
    2323    $userDN = str_replace('%login', $_SESSION['username'], $rcmail->config->get('password_ldap_userDN_mask')); 
     24     
     25    $parts = explode('@', $_SESSION['username']); 
     26    if (count($parts) == 2) 
     27    { 
     28        $userDN = str_replace('%name', $parts[0], $userDN); 
     29        $userDN = str_replace('%domain', $parts[1], $userDN); 
     30    } 
     31 
    2432    if (empty($userDN)) {return PASSWORD_CONNECT_ERROR;} 
    2533     
Note: See TracChangeset for help on using the changeset viewer.