summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2a82957)
raw | patch | inline | side by side (parent: 2a82957)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 27 Jan 2006 08:57:26 +0000 (08:57 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 27 Jan 2006 08:57:26 +0000 (08:57 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2592 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_ldap.inc | patch | blob | history |
diff --git a/include/class_ldap.inc b/include/class_ldap.inc
index d83e1b7a6bccb7ffe4ba12db376763b0e6b84524..20ff04037656c808190024ed349790aedc04d7b2 100644 (file)
--- a/include/class_ldap.inc
+++ b/include/class_ldap.inc
function search($filter, $attrs= array())
{
-
+ $start = microtime();
+
if($this->hascon){
if ($this->reconnect) $this->connect();
$this->clearResult();
$this->error = @ldap_error($this->cid);
$this->resetResult();
$this->hasres=true;
+
+ /* Time management */
+ $r = split(" ",$start);
+ $ms = $r[0];
+ $s= $r[1];
+
+ $re = split(" ",microtime());
+ $mse = $re[0];
+ $se= $re[1];
+
+ $add = 0;
+ if(($mse -$ms)<0){
+ $se --;
+ $add = 1;
+ }
+ $secs = ($se -$s);
+ $msecs = (int)(($add+($mse -$ms))*1000);
+ $time = $secs +($msecs/1000);
+ if($time > .2){
+ $Sattrs = "";
+ foreach($attrs as $att){
+ $Sattrs .= " ".$att;
+ }
+ print_red(sprintf(_("Ldap search took about %s seconds, used filter '%s' with following attributes '%s '. Please check for performance improvements."),$time,htmlentities($filter),$Sattrs));
+ }
return($this->sr);
}else{
$this->error = "Could not connect to LDAP server";