Changeset 27285
- Timestamp:
- Feb 9, 2014, 5:53:56 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Ldap_Login/class.ldap.php
r27036 r27285 1 1 <?php 2 global $conf; 2 3 class Ldap { 3 4 4 var $cnx; 5 5 var $config; … … 41 41 } 42 42 43 function load_config()43 public function load_default_config() 44 44 { 45 // init to defaults46 45 $this->config['host'] = 'localhost'; 47 46 $this->config['basedn'] = 'ou=people,dc=example,dc=com'; // racine ! … … 55 54 $this->config['advertise_admin_new_ldapuser'] = False; 56 55 $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) 62 62 { 63 $c = unserialize($x); 64 // do some more tests here 65 $this->config = $c; 63 $this->config = unserialize($conf_file); 66 64 } 67 65 } … … 85 83 86 84 public function ldap_conn(){ 87 88 if ($this->config['use_ssl'] == 1){ 85 if ($this->config['ld_use_ssl'] == 1){ 89 86 if (empty($this->config['port'])){ 90 87 $this->config['uri'] = 'ldaps://'.$this->config['host'];
Note: See TracChangeset
for help on using the changeset viewer.