thomas: server/kolab-webadmin/kolab-webadmin/php/admin/include ldap.class.php, 1.30, 1.31
cvs at kolab.org
cvs at kolab.org
Wed Nov 21 19:11:39 CET 2007
Author: thomas
Update of /kolabrepository/server/kolab-webadmin/kolab-webadmin/php/admin/include
In directory doto:/tmp/cvs-serv30801/kolab-webadmin/kolab-webadmin/php/admin/include
Modified Files:
ldap.class.php
Log Message:
Fix kolab/issue1711 (extra space after first name when editing users or admins)
Index: ldap.class.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/php/admin/include/ldap.class.php,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- ldap.class.php 13 Jul 2007 06:51:29 -0000 1.30
+++ ldap.class.php 21 Nov 2007 18:11:37 -0000 1.31
@@ -507,6 +507,26 @@
return true;
}
+ /**
+ * Get given (first) name
+ * Just return it if available, otherwise calculate from cn and sn
+ * (assumes that "$cn" is "$gn $sn")
+ *
+ * @param string $cn The common name
+ * @param string $sn The last name
+ * @param string $gn The given name
+ *
+ * @return string The extracted given (first) name
+ */
+ function getGivenName($cn, $sn, $gn = '')
+ {
+ if( $gn == '' ) {
+ return substr($cn, 0, strlen($cn) - strlen($sn) - 1);
+ } else {
+ return $gn;
+ }
+ }
+
var $connection;
var $is_bound;
var $bind_dn;
More information about the commits
mailing list