Changeset 4019 in subversion


Ignore:
Timestamp:
Sep 30, 2010 3:02:52 AM (3 years ago)
Author:
alec
Message:
  • Added password_ldap_lchattr option (#1486927)
Location:
trunk/plugins/password
Files:
4 edited

Legend:

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

    r3954 r4019  
    188188$rcmail_config['password_ldap_force_replace'] = true; 
    189189 
     190// LDAP Password Last Change Date 
     191// Some places use an attribute to store the date of the last password change 
     192// The date is meassured in "days since epoch" (an integer value) 
     193// Whenever the password is changed, the attribute will be updated if set (e.g. shadowLastChange) 
     194$rcmail_config['password_ldap_lchattr'] = ''; 
     195 
    190196 
    191197// DirectAdmin Driver options 
  • trunk/plugins/password/drivers/ldap.php

    r3775 r4019  
    8181        return PASSWORD_CONNECT_ERROR; 
    8282    } 
     83 
     84    // Updating PasswordLastChange Attribute if desired 
     85    if ($lchattr = $rcmail->config->get('password_ldap_lchattr')) { 
     86       $current_day = (int)(time() / 86400); 
     87       if (!$userEntry->replace(array($lchattr => $current_day), $force)) { 
     88           return PASSWORD_CONNECT_ERROR; 
     89       } 
     90    } 
     91 
    8392    if (Net_LDAP2::isError($userEntry->update())) { 
    8493        return PASSWORD_CONNECT_ERROR; 
     
    8695     
    8796    // All done, no error 
    88     return PASSWORD_SUCCESS;     
     97    return PASSWORD_SUCCESS; 
    8998} 
    9099 
     
    270279    return $str; 
    271280} 
    272  
    273 ?> 
  • trunk/plugins/password/drivers/ldap_simple.php

    r3850 r4019  
    11<?php 
     2 
    23/** 
    34 * Simple LDAP Password Driver 
     
    1314{ 
    1415        $rcmail = rcmail::get_instance(); 
    15          
     16 
    1617        /* Connect */ 
    1718        if (!$ds = ldap_connect($rcmail->config->get('password_ldap_host'), $rcmail->config->get('password_ldap_port'))) { 
     
    2526                return PASSWORD_CONNECT_ERROR; 
    2627        } 
    27          
     28 
    2829        /* Start TLS */ 
    2930        if ($rcmail->config->get('password_ldap_starttls')) { 
     
    7374         
    7475        $entree[$rcmail->config->get('password_ldap_pwattr')] = $passwd; 
     76 
     77        /* Updating PasswordLastChange Attribute if desired */ 
     78        if ($lchattr = $rcmail->config->get('password_ldap_lchattr')) { 
     79                $entree[$lchattr] = (int)(time() / 86400) 
     80        } 
     81 
    7582         
    7683        if (!ldap_modify($ds, $user_dn, $entree)) { 
  • trunk/plugins/password/package.xml

    r4016 r4019  
    1616                <active>yes</active> 
    1717        </lead> 
    18         <date>2010-09-29</date> 
    19         <time>19:00:00</time> 
     18        <date>2010-09-30</date> 
     19        <time>09:00:00</time> 
    2020        <version> 
    21                 <release>1.8</release> 
     21                <release>1.9</release> 
    2222                <api>1.6</api> 
    2323        </version> 
     
    2828        <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> 
    2929        <notes> 
    30 - Added possibility to display extended error messages (#1486704) 
    31 - Added extended error messages in Poppassd driver (#1486704) 
     30- Added password_ldap_lchattr option (#1486927) 
    3231    </notes> 
    3332        <contents> 
     
    171170            </notes> 
    172171            </release> 
     172        <release> 
     173                <date>2010-09-29</date> 
     174                <time>19:00:00</time> 
     175                <version> 
     176                        <release>1.8</release> 
     177                        <api>1.6</api> 
     178                </version> 
     179                <stability> 
     180                        <release>stable</release> 
     181                        <api>stable</api> 
     182                </stability> 
     183                <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> 
     184                <notes> 
     185- Added possibility to display extended error messages (#1486704) 
     186- Added extended error messages in Poppassd driver (#1486704) 
     187            </notes> 
     188        </release> 
    173189    </changelog> 
    174190</package> 
Note: See TracChangeset for help on using the changeset viewer.