steffen: server/kolab-resource-handlers/kolab-resource-handlers/freebusy freebusy.php, 1.16, 1.17
cvs at intevation.de
cvs at intevation.de
Tue Aug 31 03:33:57 CEST 2004
Author: steffen
Update of /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy
In directory doto:/tmp/cvs-serv9169/kolab-resource-handlers/kolab-resource-handlers/freebusy
Modified Files:
freebusy.php
Log Message:
freebusy works again
Index: freebusy.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy/freebusy.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- freebusy.php 14 Aug 2004 00:52:59 -0000 1.16
+++ freebusy.php 31 Aug 2004 01:33:55 -0000 1.17
@@ -330,6 +330,20 @@
fclose($tmpf);
}
+function ldapConnect() {
+ global $params;
+ global $ldap;
+ if( $ldap ) return $ldap;
+ $ldap = @ldap_connect($params['ldap_uri']);
+ if ($ldap === false) {
+ notFound('No LDAP URI speficied');
+ }
+
+ @ldap_bind($ldap, $params['bind_dn'],$params['bind_pw']);
+ testLDAPError();
+ return $ldap;
+}
+
// ========================================================================== //
// What is the name of our script
@@ -343,6 +357,15 @@
//$user = preg_replace('/\.vfb$/i', '', basename($_SERVER['PATH_INFO']));
$user = preg_replace( "'/'", '', urldecode($_GET['uid']));
+$ldap = ldapConnect();
+$ldapsearch = @ldap_search($ldap, $params['base_dn'], "(uid=$user)");
+testLDAPError();
+$ldapresults = @ldap_get_entries($ldap, $ldapsearch);
+testLDAPError();
+if (array_key_exists('mail', $ldapresults[0])) {
+ $user = $ldapresults[0]['mail'];
+}
+
if (empty($user) || $user == $scriptname) {
notFound('No user specified');
}
@@ -357,13 +380,6 @@
if ($params['multi_location']) {
// Handle multi-location setups
- $ldap = @ldap_connect($params['ldap_uri']);
- if ($ldap === false) {
- notFound('No user specified');
- }
-
- @ldap_bind($ldap, $params['bind_dn'], $params['bind_pw']);
- testLDAPError();
// TODO: read in a 'fb_url' attribute, if one exists, and use that instead
// This will allow users to explicitly override where their free/busy info
More information about the commits
mailing list