00001 <?PHP
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00040 function
dolibarr_ldap_connect()
00041 {
00042 $ldapconnect = ldap_connect(LDAP_SERVER_HOST);
00043
00044
return $ldapconnect;
00045 }
00046
00054 function
dolibarr_ldap_bind($ds)
00055 {
00056
if (defined(
"LDAP_SERVER_PASS") && LDAP_SERVER_DN && LDAP_SERVER_PASS)
00057 {
00058 $ldapbind = ldap_bind($ds, LDAP_SERVER_DN, LDAP_SERVER_PASS);
00059 }
00060
00061
return $ldapbind;
00062 }
00063
00070 function
dolibarr_ldap_unbind($ds)
00071 {
00072
00073 $ldapunbind = ldap_unbind($ds);
00074
00075
return $ldapunbind;
00076 }
00077
00084 function
dolibarr_ldap_getversion($ds)
00085 {
00086 $version = 0;
00087
00088 ldap_get_option($ds, LDAP_OPT_PROTOCOL_VERSION, $version);
00089
00090
return $version;
00091 }
00092
00101 function
dolibarr_ldap_setversion($ds,$version)
00102 {
00103 $ldapsetversion = ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, $version);
00104
00105
return $ldapsetversion;
00106 }
00107
00114 function
dolibarr_ldap_unacc($str)
00115 {
00116 $stu = ereg_replace(
"é",
"e",$str);
00117 $stu = ereg_replace(
"è",
"e",$stu);
00118 $stu = ereg_replace(
"ê",
"e",$stu);
00119 $stu = ereg_replace(
"à",
"a",$stu);
00120 $stu = ereg_replace(
"ç",
"c",$stu);
00121 $stu = ereg_replace(
"ï",
"i",$stu);
00122 $stu = ereg_replace(
"ä",
"a",$stu);
00123
return $stu;
00124 }
00125
00126 ?>