From: hickert Date: Mon, 21 May 2007 10:26:04 +0000 (+0000) Subject: Added logging to addressbook X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=882b7c5a4ef992ec22437367bb38209d8985985d;p=gosa.git Added logging to addressbook git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6418 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/addons/addressbook/class_addressbook.inc b/plugins/addons/addressbook/class_addressbook.inc index 19a3f0ecb..b9f5c72c1 100644 --- a/plugins/addons/addressbook/class_addressbook.inc +++ b/plugins/addons/addressbook/class_addressbook.inc @@ -43,6 +43,7 @@ class addressbook extends plugin var $telephoneNumber = ""; var $facsimileTelephoneNumber = ""; var $pager = ""; + var $view_logged = FALSE; /* attribute list for save action */ var $attributes= array("sn", "givenName", "mail", "title", @@ -78,7 +79,7 @@ class addressbook extends plugin "object_type" => "*"); register_global("phonefilter", $phonefilter); } - + $this->ui = get_userinfo(); } @@ -200,6 +201,7 @@ class addressbook extends plugin /* Delete request is permitted, perform LDAP action */ $ldap= $this->config->get_ldap_link(); $ldap->rmdir ($this->dn); + @log::log("remove","addressbook/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); show_ldap_error($ldap->get_error(), sprintf(_("Removing of addressbook entry '%s' failed."),$this->dn)); gosa_log ("Address book object'".$this->dn."' has been removed"); @@ -329,6 +331,11 @@ class addressbook extends plugin $_SESSION['saved_start']= $_GET['start']; } $this->dn = base64_decode($_GET['show']); + $this->view_logged =FALSE; + if(!$this->view_logged){ + $this->view_logged = TRUE; + @log::log("view","addressbook/".get_class($this),$this->dn); + } $_SESSION['show_info']= base64_decode($_GET['show']); } @@ -716,6 +723,7 @@ class addressbook extends plugin { /* Load base attributes */ plugin::plugin ($this->config, $this->dn); + $this->view_logged = FALSE; $this->storage_base= preg_replace('/^[^,]+,/', '', preg_replace('/'.$this->abobjectclass.',/', '', $this->dn)); } @@ -753,6 +761,12 @@ class addressbook extends plugin if (show_ldap_error($ldap->get_error(), sprintf(_("Removing of addressbook entry '%s' failed."),$this->dn))){ return (1); } + + if($mode == "add"){ + @log::log("create","addressbook/".get_class($this),$this->dn, array_keys($this->attrs),$ldap->get_error()); + }else{ + @log::log("modify","addressbook/".get_class($this),$this->dn, array_keys($this->attrs),$ldap->get_error()); + } }