"fix for using GroupDAV with LDAP as addressbook backend"

This commit is contained in:
Ralf Becker 2009-08-07 07:15:37 +00:00
parent 20fad24579
commit 1ba343a837

View File

@ -40,7 +40,7 @@ class addressbook_groupdav extends groupdav_handler
*Profiling *Profiling
*/ */
var $starttime; var $starttime;
/** /**
* What attribute is used to construct the path, default id, can be uid too * What attribute is used to construct the path, default id, can be uid too
*/ */
@ -58,7 +58,7 @@ class addressbook_groupdav extends groupdav_handler
parent::__construct($app,$debug,$base_uri); parent::__construct($app,$debug,$base_uri);
$this->bo = new addressbook_bo(); $this->bo = new addressbook_bo();
//$this->starttime = microtime(true); //$this->starttime = microtime(true);
} }
/** /**
@ -84,7 +84,7 @@ class addressbook_groupdav extends groupdav_handler
*/ */
function propfind($path,$options,&$files,$user,$id='') function propfind($path,$options,&$files,$user,$id='')
{ {
$this->starttime = microtime(true); $this->starttime = microtime(true);
$filter = array(); $filter = array();
// show addressbook of a single user? // show addressbook of a single user?
if ($user && $path != '/addressbook/') $filter['contact_owner'] = $user; if ($user && $path != '/addressbook/') $filter['contact_owner'] = $user;
@ -120,7 +120,7 @@ class addressbook_groupdav extends groupdav_handler
//$icount= 0; //$icount= 0;
foreach($contacts as $contact) foreach($contacts as $contact)
{ {
//$st = microtime(true); //$st = microtime(true);
$props = array( $props = array(
HTTP_WebDAV_Server::mkprop('getetag',$this->get_etag($contact)), HTTP_WebDAV_Server::mkprop('getetag',$this->get_etag($contact)),
@ -146,15 +146,15 @@ class addressbook_groupdav extends groupdav_handler
'path' => self::get_path($contact), 'path' => self::get_path($contact),
'props' => $props, 'props' => $props,
); );
//$end = microtime(true) - $st; //$end = microtime(true) - $st;
//$icount++; //$icount++;
//error_log("function propfind foreach : $end : $icount"); //error_log("function propfind foreach : $end : $icount");
} }
} }
$endtime = microtime(true) - $this->starttime; $endtime = microtime(true) - $this->starttime;
error_log(__FILE__ ."->". __METHOD__ ." elapsed time : $endtime"); error_log(__FILE__ ."->". __METHOD__ ." elapsed time : $endtime");
return true; return true;
} }
@ -344,7 +344,7 @@ class addressbook_groupdav extends groupdav_handler
*/ */
function read($id) function read($id)
{ {
return $this->bo->read(is_numeric($id) ? $id : array('uid' => $id)); return $this->bo->read(self::PATH_ATTRIBUTE == 'id' ? $id : array('uid' => $id));
} }
/** /**