steffen: server/kolab-webadmin/kolab-webadmin/php/admin/include ldap.class.php, 1.22, 1.23

cvs at intevation.de cvs at intevation.de
Mon May 30 13:53:37 CEST 2005


Author: steffen

Update of /kolabrepository/server/kolab-webadmin/kolab-webadmin/php/admin/include
In directory doto:/tmp/cvs-serv25958/kolab-webadmin/php/admin/include

Modified Files:
	ldap.class.php 
Log Message:
LDAP rename (Issue730)

Index: ldap.class.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/php/admin/include/ldap.class.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- ldap.class.php	10 Mar 2005 21:58:19 -0000	1.22
+++ ldap.class.php	30 May 2005 11:53:35 -0000	1.23
@@ -47,6 +47,12 @@
     $this->search_result = false;
 	// Always connect to master server
     $this->connection=ldap_connect($_SESSION['ldap_master_uri']);
+	if (ldap_set_option($this->connection, LDAP_OPT_PROTOCOL_VERSION, 3)) {
+	  // Good, we really neeed v3!
+	} else {
+	  echo _("Error setting LDAP protocol to v3. Please contact your system administrator");
+	  return false;
+	}
   }
 
   function close() {
@@ -89,6 +95,20 @@
     return $str;
   }
 
+  function dn_escape( $str ) {
+	/*
+	 DN component escaping as described in RFC-2253
+	 */
+	$str = str_replace( '\\', '\\\\', $str );
+	$str = str_replace( ',', '\\,', $str );
+	$str = str_replace( '+', '\\,', $str );
+	$str = str_replace( '<', '\\<', $str );
+	$str = str_replace( '>', '\\>', $str );
+	$str = str_replace( ';', '\\;', $str );
+	if( $str[0] == '#' ) $str = '\\'.$str;
+	// PENDING(steffen): Escape leading/trailing spaces
+	return $str;
+  }
   
   function bind( $dn = false , $pw = '' ) {
     if( !$dn ) {





More information about the commits mailing list