From: hickert Date: Tue, 29 Dec 2009 09:10:42 +0000 (+0000) Subject: Updated logging attribute X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ec66914afd0f18d1d2086ac3d251ba568651d7fb;p=gosa.git Updated logging attribute -It is now bool. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14971 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/contrib/gosa.conf b/gosa-core/contrib/gosa.conf index 25513647f..da0df2c9a 100644 --- a/gosa-core/contrib/gosa.conf +++ b/gosa-core/contrib/gosa.conf @@ -378,6 +378,11 @@ -->
config) && empty($entry['user'])){ $entry['user'] = "unknown"; } - + /* Check if all given values are valid */ + global $config; $msgs = @log::check($entry); if(count($msgs)){ foreach($msgs as $msg){ @@ -86,7 +87,9 @@ class log { msg_dialog::display(_("Internal error"), sprintf(_("Logging failed: %s"), $msg), ERROR_DIALOG); } }else{ - $this->log_into_syslog($entry); + if(is_object($config) && preg_match("/true/i",$config->get_cfg_value("logging",""))){ + $this->log_into_syslog($entry); + } } } diff --git a/gosa-core/setup/class_setupStep_Config2.inc b/gosa-core/setup/class_setupStep_Config2.inc index 2ec4ede33..1bf1d2ff5 100644 --- a/gosa-core/setup/class_setupStep_Config2.inc +++ b/gosa-core/setup/class_setupStep_Config2.inc @@ -40,7 +40,7 @@ class Step_Config2 extends setup_step "snapshot_base" => "ou=snapshots,%base%", "snapshot_user" => "%admin%", "snapshot_password" => "", - "logging" => "syslog,mysql", + "logging" => TRUE, "snapshot_server" => "%connection%"); var $samba_settings = array( "samba_sid" => "0-815-4711", @@ -131,8 +131,7 @@ class Step_Config2 extends setup_step $smarty->assign("mail_methods", reverse_html_entities($this->mail_methods)); $smarty->assign("samba_settings", reverse_html_entities($this->samba_settings)); - $smarty->assign("logging_mysql" ,preg_match("/mysql/",$this->generic_settings['logging'])); - $smarty->assign("logging_syslog",preg_match("/syslog/",$this->generic_settings['logging'])); + $smarty->assign("logging",$this->generic_settings['logging']); $smarty->assign("bool",array(FALSE => _("No"), TRUE => _("Yes"))); foreach($this->attributes as $attr){ @@ -161,14 +160,7 @@ class Step_Config2 extends setup_step } /* Get logging */ - $logging = ""; - if(isset($_POST['logging_syslog'])){ - $logging.= "syslog,"; - } - if(isset($_POST['logging_mysql'])){ - $logging.= "mysql,"; - } - $this->generic_settings['logging'] = trim($logging,","); + $this->generic_settings['logging'] = isset($_POST['logging']); /* Mail settings */ if(isset($_POST['vacationdir_active'])){ diff --git a/gosa-core/setup/setup_config2.tpl b/gosa-core/setup/setup_config2.tpl index f81536640..1cf915a17 100644 --- a/gosa-core/setup/setup_config2.tpl +++ b/gosa-core/setup/setup_config2.tpl @@ -120,13 +120,14 @@
- {t}Logging options{/t} + {t}GOsa logging{/t}
- {t}Syslog{/t} - {t}MySQL{/t} + {if $logging} + + {else} + + {/if}