summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d4a670b)
raw | patch | inline | side by side (parent: d4a670b)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 11 May 2007 13:07:35 +0000 (13:07 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 11 May 2007 13:07:35 +0000 (13:07 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6362 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_log.inc | patch | blob | history |
diff --git a/include/class_log.inc b/include/class_log.inc
index 23f6f01282db4e0ca7e21e57c683c6d6c8bc4022..b46a5adc90bc5d6ba861d9be3073adefdfa06fe7 100644 (file)
--- a/include/class_log.inc
+++ b/include/class_log.inc
*/
-/*! \brief The plugin base class
- \author Cajus Pollmeier <pollmeier@gonicus.de>
- \version 2.00
- \date 24.07.2003
-
- This is the base class for all plugins. It can be used standalone or
- can be included by the tabs class. All management should be done
- within this class. Extend your plugins from this class.
+/*! \brief The logging base class
+ \author Fabian Hickert <hickert@gonicus.de>
+ \version 2.6
+ \date 11.04.2007
+
+ This is the base class for the GOsa logging functionality.
+ All logging should lead to this class.
*/
class log {
var $LOG_TO_SYSLOG= FALSE;
- /*! \brief plugin constructor
+ /*! \brief logging constructor
- If 'dn' is set, the node loads the given 'dn' from LDAP
+ \param action One of these values (modify|create|remove|snapshot|copy)
+ \param objecttype represents the current edited objecttype, like users/user
+ \param object represents the current edited object dn
+ \param changes_array An array containing names of all touched attributes
+ \param result A status message, containing errors or success messages
- \param dn Distinguished name to initialize plugin from
- \sa plugin()
+ \sa log()
*/
function log($action,$objecttype,$object,$changes_array = array(),$result = TRUE)
{
global $config;
-
$ui = get_userinfo();
+ /* Create string out of changes */
$changes ="";
foreach($changes_array as $str ){
$changes .= $str.",";
}
- $changes = preg_replace("/,$/","",$str);
-
+ $changes = preg_replace("/,$/","",$changes );
+ /* Create data object */
$entry = array();
$entry['timestamp'] = time();
$entry['user'] =$ui->dn;
$entry['changes'] = $changes;
$entry['result'] = $result;
+ /* Start logging for configured methods */
if(isset($this->config->current['LOGGING']) && preg_match("/(^|,)syslog(,|$)/i",$this->config->current['LOGGING'])){
@log::log_into_syslog($entry);
}
}
}
-
-
+
+ /* This function is used to into the systems syslog */
function log_into_syslog($entry)
{
$str = $entry['user']." ".$entry['action']." ".$entry['object']." from type ".$entry['objecttype']." ".$data." : Result was ".$entry['result'];
}
+ /* Log into configured logging databses.*/
function log_into_db($entry)
{
if(isset($this->config->data['SERVERS']['LOGGING'])){
}
}
-
-
-
-
-
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>