Changeset 4929 in subversion


Ignore:
Timestamp:
Jul 17, 2011 1:27:36 PM (2 years ago)
Author:
thomasb
Message:

Also configure alias of new user if specified

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/new_user_identity/new_user_identity.php

    r4927 r4929  
    77 * This plugin requires that a working public_ldap directory be configured. 
    88 * 
    9  * @version 1.01 
     9 * @version 1.02 
    1010 * @author Kris Steinhoff 
    1111 * 
     
    2020 *  // new identity, match the user's login name against this field. 
    2121 *  $rcmail_config['new_user_identity_match'] = 'uid'; 
     22 * 
     23 *  // Use this field (from fieldmap configuration) to fill alias col of 
     24 *  // the new user record. 
     25 *  $rcmail_config['new_user_identity_alias'] = 'alias'; 
    2226 */ 
    2327class new_user_identity extends rcube_plugin 
     
    3438    function lookup_user_name($args) 
    3539    { 
     40        $rcmail = rcmail::get_instance(); 
     41         
    3642        if ($this->init_ldap()) { 
    3743            $results = $this->ldap->search('*', $args['user'], TRUE); 
     
    4046                if (!$args['user_email'] && strpos($results->records[0]['email'], '@')) { 
    4147                    $args['user_email'] = rcube_idn_to_ascii($results->records[0]['email']); 
     48                } 
     49                if (($alias_col = $rcmail->config->get('new_user_identity_alias')) && $results->records[0][$alias_col]) { 
     50                  $args['alias'] = $results->records[0][$alias_col]; 
    4251                } 
    4352            } 
Note: See TracChangeset for help on using the changeset viewer.