summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 377fea4)
raw | patch | inline | side by side (parent: 377fea4)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 14 Sep 2006 12:37:44 +0000 (12:37 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 14 Sep 2006 12:37:44 +0000 (12:37 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4663 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/include/class_ldap.inc b/include/class_ldap.inc
index 4f0fd2b455084622930ec08c03439e2b292320be..6473bc74e75623ad1a1877177f466e8553d86608 100644 (file)
--- a/include/class_ldap.inc
+++ b/include/class_ldap.inc
}
}
+ $this->log("LDAP operation: time=".get_MicroTimeDiff($start,microtime())." operation=search('".$this->fix($this->basedn)."', '$filter')");
+
return($this->sr);
}else{
$this->error = "Could not connect to LDAP server";
}
}
+ $this->log("LDAP operation: time=".get_MicroTimeDiff($start,microtime())." operation=ls('".$this->fix($basedn)."', '$filter')");
+
return($this->sr);
}else{
$this->error = "Could not connect to LDAP server";
{
if($this->hascon){
if ($this->reconnect) $this->connect();
+ $start = microtime();
$this->clearResult();
$filter = "(objectclass=*)";
$this->sr = @ldap_read($this->cid, $this->fix($dn), $filter,$attrs);
$this->error = @ldap_error($this->cid);
$this->resetResult();
$this->hasres=true;
+ $this->log("LDAP operation: time=".get_MicroTimeDiff($start,microtime())." operation=cat('".$this->fix($dn)."')");
return($this->sr);
}else{
$this->error = "Could not connect to LDAP server";
{
if($this->hascon){
if ($this->reconnect) $this->connect();
+ $start= microtime();
$r = @ldap_delete($this->cid, $this->fix($deletedn));
$this->error = @ldap_error($this->cid);
+ $this->log("LDAP operation: time=".get_MicroTimeDiff($start,microtime())." operation=delete('".$this->fix($delettedn)."')");
return($r ? $r : 0);
}else{
$this->error = "Could not connect to LDAP server";
}
if($this->hascon){
if ($this->reconnect) $this->connect();
+ $start= microtime();
$r = @ldap_modify($this->cid, $this->fix($this->basedn), $attrs);
$this->error = @ldap_error($this->cid);
+ $this->log("LDAP operation: time=".get_MicroTimeDiff($start,microtime())." operation=modify('$this->basedn')");
return($r ? $r : 0);
}else{
$this->error = "Could not connect to LDAP server";
{
if($this->hascon){
if ($this->reconnect) $this->connect();
+ $start= microtime();
$r = @ldap_add($this->cid, $this->fix($this->basedn), $attrs);
$this->error = @ldap_error($this->cid);
+ $this->log("LDAP operation: time=".get_MicroTimeDiff($start,microtime())." operation=add('$this->basedn')");
return($r ? $r : 0);
}else{
$this->error = "Could not connect to LDAP server";
@@ -1139,6 +1151,16 @@ function gen_xls ($dn, $filter= "(objectClass=*)", $attributes= array('*'), $rec
return $objectclasses;
}
+
+ function log($string)
+ {
+ $cfg= $_SESSION['config'];
+ if (isset($cfg->current['LDAPSTATS']) && preg_match('/true/i', $cfg->current['LDAPSTATS'])){
+ syslog (LOG_INFO, $string);
+ }
+ }
+
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/include/class_tabs.inc b/include/class_tabs.inc
index e0e8dbe422b0bf555c7fe25940a04bdf3b5aa0bf..5c3204571425c628e8d6118e679ca81ea6d55fa3 100644 (file)
--- a/include/class_tabs.inc
+++ b/include/class_tabs.inc
var $by_object= array();
var $SubDialog = false;
- function tabs($config, $data, $dn)
+ function tabs($config, $data, $dn, $gui= true)
{
/* Save dn */
$this->dn= $dn;
foreach ($data as $tab){
$this->by_name[$tab['CLASS']]= $tab['NAME'];
- $this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config, $this->dn);
+ if ($gui){
+ $this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config, $this->dn);
+ } else {
+ $this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config, $this->dn, false);
+ }
$this->by_object[$tab['CLASS']]->parent= &$this;
/* Initialize current */
index a4d0279dbd444368a4ab094b919d4a982f394eea..8357a0e4235685016690ac7b6306ffdd443ed25d 100644 (file)
class grouptabs extends tabs
{
- function grouptabs($config, $data, $dn)
+ function grouptabs($config, $data, $dn, $gui= true)
{
- tabs::tabs($config, $data, $dn);
+ tabs::tabs($config, $data, $dn, $gui);
$baseobject= $this->by_object['group'];
foreach ($this->by_object as $name => $obj){
if(isset($obj->parent)){
diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc
index 46c2c299a7404824f3b2c1d8c8df09fad8c8b610..904a11c2467d317af018f187f3dd0fcac2c06d56 100644 (file)
/* Take care about groupMembership values: add to groups */
foreach ($this->groupMembership as $key => $value){
if (!isset($this->savedGroupMembership[$key])){
- $g= new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], $key);
+ $g= new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], $key, false);
$g->by_object['group']->addUser($this->uid);
$g->save();
}