From 08569e045b59eec3450a366e44b86d26cb0af522 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Fri, 5 Jan 2007 09:08:03 +0000 Subject: [PATCH] Ajout nouveau parametre pour le niveau max de sortie --- htdocs/admin/syslog.php | 91 +++++++++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 35 deletions(-) diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index b862cada5a9..7484f5a69a2 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -1,5 +1,6 @@ + * Copyright (C) 2007 Rodolphe Quiedeville * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,16 +21,49 @@ */ /** - \file htdocs/admin/syslog.php - \ingroup syslog - \brief Page de configuration du module syslog - \version $Revision$ + \file htdocs/admin/syslog.php + \ingroup syslog + \brief Page de configuration du module syslog + \version $Revision$ */ - require("./pre.inc.php"); if (!$user->admin) - accessforbidden(); + accessforbidden(); + +/* + * Actions + */ +$optionlogoutput=$_POST["optionlogoutput"]; +if ($optionlogoutput == "syslog") +{ + if (defined($_POST["facility"])) + { + dolibarr_del_const($db,"SYSLOG_FILE"); + dolibarr_set_const($db,"SYSLOG_FACILITY",$_POST["facility"]); + dolibarr_set_const($db,"SYSLOG_LEVEL",$_POST["level"]); + dolibarr_syslog("Admin Syslog: New level ".$_POST["level"]); + Header("Location: syslog.php"); + } + else + { + print '
'.$langs->trans("ErrorUnknownSyslogConstant",$_POST["facility"]).'
'; + } +} +if ($optionlogoutput == "file") +{ + $file=fopen($_POST["filename"],"a+"); + if ($file) + { + fclose($file); + dolibarr_del_const($db,"SYSLOG_FACILITY"); + dolibarr_set_const($db,"SYSLOG_FILE",$_POST["filename"]); + } + else + { + print '
'.$langs->trans("ErrorFailedToOpenFile",$_POST["filename"]).'
'; + } +} $langs->load("admin"); $langs->load("other"); @@ -41,31 +75,6 @@ print '
'; $def = array(); -/* - * Actions - */ -$optionlogoutput=$_POST["optionlogoutput"]; -if ($optionlogoutput == "syslog") { - if (defined($_POST["facility"])) { - dolibarr_del_const($db,"SYSLOG_FILE"); - dolibarr_set_const($db,"SYSLOG_FACILITY",$_POST["facility"]); - } else { - print '
'.$langs->trans("ErrorUnknownSyslogConstant",$_POST["facility"]).'
'; - } -} -if ($optionlogoutput == "file") { - $file=fopen($_POST["filename"],"a+"); - if ($file) { - fclose($file); - dolibarr_del_const($db,"SYSLOG_FACILITY"); - dolibarr_set_const($db,"SYSLOG_FILE",$_POST["filename"]); - } - else { - print '
'.$langs->trans("ErrorFailedToOpenFile",$_POST["filename"]).'
'; - } -} - - $syslogfacility=$defaultsyslogfacility=dolibarr_get_const($db,"SYSLOG_FACILITY"); $syslogfile=$defaultsyslogfile=dolibarr_get_const($db,"SYSLOG_FILE"); if (! $defaultsyslogfacility) $defaultsyslogfacility='LOG_USER'; @@ -76,9 +85,9 @@ if (! $defaultsyslogfile) $defaultsyslogfile='dolibarr.log'; */ print_titre($langs->trans("SyslogOutput")); -print ''; print ''; print ''; +print '
'; print ''; print ''; print ''; @@ -86,13 +95,25 @@ print "\n"; $var=true; $var=!$var; print ""; -print ''; +print ''; + $var=!$var; print ""; print ''; -print ""; -print "
'.$langs->trans("Type").''.$langs->trans("Parameter").'
".$langs->trans("SyslogSyslog")."'.$langs->trans("SyslogFacility").':
'.$langs->trans("SyslogFacility").': '; +print $langs->trans("SyslogLevel").':
".$langs->trans("SyslogSimpleFile")."'.$langs->trans("SyslogFilename").':
"; +print "\n"; +print "\n"; llxFooter('$Date$ - $Revision$'); ?>