function ldap_expirationtime2unix ($time, $ldapconnection, $user_dn) {
        $result = false;
        switch ($this->config->user_type) {
            case 'edir':
                $yr=substr($time, 0, 4);
                $mo=substr($time, 4, 2);
                $dt=substr($time, 6, 2);
                $hr=substr($time, 8, 2);
                $min=substr($time, 10, 2);
                $sec=substr($time, 12, 2);
                $result = mktime($hr, $min, $sec, $mo, $dt, $yr);
                break;
            case 'rfc2307':
            case 'rfc2307bis':
                $result = $time * DAYSECS; // The shadowExpire contains the number of DAYS between 01/01/1970 and the actual expiration date
                break;
            case 'ad':
                $result = $this->ldap_get_ad_pwdexpire($time, $ldapconnection, $user_dn);
                break;
            default:
                print_error('auth_ldap_usertypeundefined', 'auth_ldap');
        }
        return $result;
    }
function ldap_expirationtime2unix ($time, $ldapconnection, $user_dn) {
        $result = false;
        switch ($this->config->user_type) {
            case 'edir':
                $yr=substr($time, 0, 4);
                $mo=substr($time, 4, 2);
                $dt=substr($time, 6, 2);
                $hr=substr($time, 8, 2);
                $min=substr($time, 10, 2);
                $sec=substr($time, 12, 2);
                $result = mktime($hr, $min, $sec, $mo, $dt, $yr);
                break;
            case 'rfc2307':
            case 'rfc2307bis':
                $result = $time * DAYSECS; // The shadowExpire contains the number of DAYS between 01/01/1970 and the actual expiration date
                break;
            case 'ad':
                $result = $this->ldap_get_ad_pwdexpire($time, $ldapconnection, $user_dn);
                break;
            default:
                print_error('auth_ldap_usertypeundefined', 'auth_ldap');
        }
        return $result;
    }
function ldap_expirationtime2unix ( $ time , $ ldapconnection , $ user_dn ) { $ result = false ; switch ( $ this -> config -> user_type ) { case 'edir' : $ yr = substr ( $ time , 0 , 4 ) ; $ mo = substr ( $ time , 4 , 2 ) ; $ dt = substr ( $ time , 6 , 2 ) ; $ hr = substr ( $ time , 8 , 2 ) ; $ min = substr ( $ time , 10 , 2 ) ; $ sec = substr ( $ time , 12 , 2 ) ; $ result = mktime ( $ hr , $ min , $ sec , $ mo , $ dt , $ yr ) ; break ; case 'rfc2307' : case 'rfc2307bis' : $ result = $ time * DAYSECS ; // The shadowExpire contains the number of DAYS between 01/01/1970 and the actual expiration date break ; case 'ad' : $ result = $ this -> ldap_get_ad_pwdexpire ( $ time , $ ldapconnection , $ user_dn ) ; break ; default : print_error ( 'auth_ldap_usertypeundefined' , 'auth_ldap' ) ; } return $ result ; }
Take expirationtime and return it as unix timestamp in seconds

Takes expiration timestamp as read from LDAP and returns it as unix timestamp in seconds
Depends on $this->config->user_type variable

@param mixed time   Time stamp read from LDAP as it is.
@param string $ldapconnection Only needed for Active Directory.
@param string $user_dn User distinguished name for the user we are checking password expiration (only needed for Active Directory).
@return timestamp
Take expirationtime and return it as unix timestamp in seconds