Subversion Repositories ALCASAR

Rev

Rev 2475 | Rev 2705 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2475 Rev 2532
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: ldap.php 2475 2017-12-30 02:25:12Z tom.houdayer $
2
# $Id: ldap.php 2532 2018-04-30 03:55:35Z tom.houdayer $
3
 
3
 
4
/* written by steweb57, Rexy & Tom HOUDAYER */
4
/* written by steweb57, Rexy & Tom HOUDAYER */
5
/****************************************************************
5
/****************************************************************
6
*			GLOBAL FILE PATHS			*
6
*			GLOBAL FILE PATHS			*
7
*****************************************************************/
7
*****************************************************************/
Line 138... Line 138...
138
			return 0;
138
			return 0;
139
		}
139
		}
140
	}
140
	}
141
 
141
 
142
	// if ok, try to query the directory of users
142
	// if ok, try to query the directory of users
143
	$query = $f_ldap_uid."=*";
143
	$query = $f_ldap_uid.'=*';
144
	$ldap_result = ldap_search($ldapconn, $f_ldap_basedn, $query);
144
	$ldap_result = ldap_search($ldapconn, $f_ldap_basedn, $query);
145
	if (ldap_search($ldapconn, $f_ldap_basedn, $query)) {
145
	if ($ldap_result) {
146
		$ldap_users_count = ldap_count_entries($ldapconn, $ldap_result);
146
		$ldap_users_count = ldap_count_entries($ldapconn, $ldap_result);
147
		return ($ldap_users_count + 2);
147
		return ($ldap_users_count + 2);
148
	} else {
148
	} else {
149
		return 1;
149
		return 1;
150
	}
150
	}