Ignore:
Timestamp:
Feb 9, 2014, 5:53:56 PM (10 years ago)
Author:
22decembre
Message:

added function load_default_config
use_ssl -> ld_use_ssl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Ldap_Login/class.ldap.php

    r27036 r27285  
    11<?php
     2global $conf;
    23class Ldap {
    3 
    44        var $cnx;
    55        var $config;
     
    4141        }
    4242       
    43         function load_config()
     43        public function load_default_config()
    4444        {
    45                 // init to defaults
    4645                $this->config['host'] = 'localhost';
    4746                $this->config['basedn'] = 'ou=people,dc=example,dc=com'; // racine !
     
    5554                $this->config['advertise_admin_new_ldapuser'] = False;
    5655                $this->config['send_password_by_mail_ldap'] = False;
    57                
    58                 echo $this->config['send_password_by_mail_ldap'];
    59                 // fetch the actual config
    60                 $x = @file_get_contents( LDAP_LOGIN_PATH.'data.dat' );
    61                 if ($x!==false)
     56        }
     57       
     58        function load_config() {
     59                // first we load the base config
     60                $conf_file = @file_get_contents( LDAP_LOGIN_PATH.'data.dat' );
     61                if ($conf_file!==false)
    6262                {
    63                         $c = unserialize($x);
    64                         // do some more tests here
    65                         $this->config = $c;
     63                        $this->config = unserialize($conf_file);
    6664                }
    6765        }
     
    8583
    8684        public function ldap_conn(){
    87 
    88                 if ($this->config['use_ssl'] == 1){
     85                if ($this->config['ld_use_ssl'] == 1){
    8986                        if (empty($this->config['port'])){
    9087                                $this->config['uri'] = 'ldaps://'.$this->config['host'];
Note: See TracChangeset for help on using the changeset viewer.