summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: da5e87b)
raw | patch | inline | side by side (parent: da5e87b)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 23 May 2007 06:18:38 +0000 (06:18 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 23 May 2007 06:18:38 +0000 (06:18 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6438 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/include/class_acl.inc b/include/class_acl.inc
index 99adff3fc05ddffe0743a1e93b897eebe06de24d..23db48299827c7fe3728761250d65be0ab92fc14 100644 (file)
--- a/include/class_acl.inc
+++ b/include/class_acl.inc
$this->cleanup();
$ldap->modify ($this->attrs);
- @log::log("modify","acls/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ if(count($this->attrs)){
+ @log::log("modify","acls/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }
show_ldap_error($ldap->get_error(), sprintf(_("Saving ACLs with dn '%s' failed."),$this->dn));
diff --git a/include/class_log.inc b/include/class_log.inc
index 3b8a56c1aac24837cccb12a355c0b8126338769d..e41beba15e73fdb40f13d53a28ff3cda420d3641 100644 (file)
--- a/include/class_log.inc
+++ b/include/class_log.inc
/* Create data object */
$entry = array();
$entry['timestamp'] = time();
- $entry['user'] = $ui->dn;
+ $entry['user'] = @$ui->dn;
$entry['action'] = $action;
$entry['objecttype']= $objecttype;
$entry['object'] = $object;
$entry['changes'] = $changes;
$entry['result'] = $result;
+
+ if(!isset($this->config->current['LOGGING']) && empty($entry['user'])){
+ $entry['user'] = "unknown";
+ }
/* Check if all given values are valid */
$msgs = @log::check($entry);
if(count($msgs)){
foreach($msgs as $msg){
trigger_error("Logging failed, reason was: ".$msg);
- print_red("Logging failed, reason was: ".$msg);
+ print_red("Logging failed, reason was: ".$msg);
}
+
}else{
- /* Start logging for configured methods */
- if(isset($this->config->current['LOGGING']) && preg_match("/(^|,)syslog(,|$)/i",$this->config->current['LOGGING'])){
+ if(!isset($this->config->current['LOGGING'])){
@log::log_into_syslog($entry);
- }
- if(isset($this->config->current['LOGGING']) && preg_match("/(^|,)mysql(,|$)/i",$this->config->current['LOGGING'])){
- @log::log_into_db($entry);
+ }else{
+
+ /* Start logging for configured methods */
+ if(isset($this->config->current['LOGGING']) && preg_match("/(^|,)syslog(,|$)/i",$this->config->current['LOGGING'])){
+ @log::log_into_syslog($entry);
+ }
+ if(isset($this->config->current['LOGGING']) && preg_match("/(^|,)mysql(,|$)/i",$this->config->current['LOGGING'])){
+ @log::log_into_db($entry);
+ }
}
}
}
function check($entry = array())
{
$msgs = array();
- if(!isset($entry['user']) || empty($entry['user'])){
- $msgs[] = "Currently active user is empty.";
- }
+ # if(!isset($entry['user']) || empty($entry['user'])){
+ # $msgs[] = "Currently active user is empty.";
+ # }
- if(!isset($entry['action']) || !in_array($entry['action'],array("modify","create","remove","copy","snapshot","view"))){
+ if(!isset($entry['action']) || !in_array($entry['action'],array("modify","create","remove","copy","snapshot","view","security"))){
$msgs[] = "Invalid option specified '".$entry['action']."'";
}
index 6cbec1b4eddc6cf2a5559cf6b04e21b406a3c27c..3714609db1da2e2993ddf747795a4180bc39806d 100644 (file)
--- a/include/class_plugin.inc
+++ b/include/class_plugin.inc
*/
function execute()
{
- gosa_log("ACL ".get_class($this)." - ".$this->acl_category." - ".$this->acl_base);
+ @log::log("view","acl/".get_class($this),$this->dn,array(),"ACL ".get_class($this)." - ".$this->acl_category." - ".$this->acl_base);
/* This one is empty currently. Fabian - please fill in the docu code */
$_SESSION['current_class_for_help'] = get_class($this);
/* Update userinfo if necessary */
if($_SESSION['ui']->dn == $old_dn){
$_SESSION['ui']->dn = $new_dn;
- gosa_log(_("Updated current user dn from '".$old_dn."' to '".$new_dn."'"));
+ @log::log("view","acl/".get_class($this),$this->dn,array(),"Updated current user dn from '".$old_dn."' to '".$new_dn."'");
}
/* Object was moved, ensure that all acls will be moved too */
diff --git a/include/php_setup.inc b/include/php_setup.inc
index e83379c9826cdd039a758e2d177d6658e75e8a22..7d6c73870158054dabcaa2c8772ccc467ccb341d 100644 (file)
--- a/include/php_setup.inc
+++ b/include/php_setup.inc
if((isset($config->data['MAIN']['DISPLAYERRORS']))&&(!preg_match("/^true$/i",$config->data['MAIN']['DISPLAYERRORS']))){
/* Write to syslog */
- gosa_log ("PHP error: $errstr ($errfile, line $errline)");
+ @log::log("view","error","",array(),"PHP error: $errstr ($errfile, line $errline)");
return;
}
}
index ef45e77329ada9fa29c630a298ee5fa11a9eeaff..33c730945c693f604b812a5428435461f326e40c 100644 (file)
if($script['EDITED']){
$data = $this->scripts[$key]['SCRIPT'];
if(!$this->sieve_handle->sieve_sendscript($script['NAME'], addcslashes ($data,"\\"))){
- gosa_log("Failed to save sieve script named '".$script['NAME']."': ".to_string($this->sieve_handle->error_raw));
+ @log::log("modify","users/mailAccount".get_class($this),$script['NAME'],"Failed to save sieve script named '".$script['NAME']."': ".to_string($this->sieve_handle->error_raw));
+
$everything_went_fine = FALSE;
print_red(to_string($this->sieve_handle->error_raw));
$this->scripts[$key]['MSG'] = "<font color='red'>".