From: eldy <> Date: Tue, 17 Feb 2004 20:55:32 +0000 (+0000) Subject: webmin module: X-Git-Tag: AWSTATS_6_1_BETA~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7fdbb045cd515d17fc0c30d453ba4c8cd692bc9;p=thirdparty%2FAWStats.git webmin module: Translation was in french for some texts, whatever was choosed language. Added a warning to explain to add '/private/etc' to webmin ACL for MacOS users. A first screen for the schedule update feature. Better description for ACL page. --- diff --git a/tools/webmin/awstats/acl_security.pl b/tools/webmin/awstats/acl_security.pl index 7520c737..07e3562a 100644 --- a/tools/webmin/awstats/acl_security.pl +++ b/tools/webmin/awstats/acl_security.pl @@ -5,32 +5,32 @@ do 'awstats-lib.pl'; # Output HTML for editing security options for the awstats module sub acl_security_form { -print " $text{'acl_view'}\n"; -printf " %s\n", +print " $text{'acl_view'}\n"; +printf " %s\n", $_[0]->{'view'} ? "checked" : "", $text{'yes'}; printf " %s \n", $_[0]->{'view'} ? "" : "checked", $text{'no'}; -print " $text{'acl_global'}\n"; -printf " %s\n", +print " $text{'acl_global'}\n"; +printf " %s\n", $_[0]->{'global'} ? "checked" : "", $text{'yes'}; printf " %s \n", $_[0]->{'global'} ? "" : "checked", $text{'no'}; -print " $text{'acl_add'}\n"; -printf " %s\n", +print " $text{'acl_add'}\n"; +printf " %s\n", $_[0]->{'add'} ? "checked" : "", $text{'yes'}; printf " %s \n", $_[0]->{'add'} ? "" : "checked", $text{'no'}; -print " $text{'acl_update'}\n"; -printf " %s\n", +print " $text{'acl_update'}\n"; +printf " %s\n", $_[0]->{'update'} ? "checked" : "", $text{'yes'}; printf " %s \n", $_[0]->{'update'} ? "" : "checked", $text{'no'}; -print " $text{'acl_user'}\n"; -printf " %s\n", +print " $text{'acl_user'}\n"; +printf " %s\n", $_[0]->{'user'} eq "" ? "checked" : "", $text{'acl_this'}; printf " %s\n", $_[0]->{'user'} eq "*" ? "checked" : "", $text{'acl_any'}; @@ -40,8 +40,8 @@ printf " %s \n", $_[0]->{'user'} eq "*" ? "" : $_[0]->{'user'}, &user_chooser_button("user"); -print " $text{'acl_dir'}\n"; -print " \n"; +print " $text{'acl_dir'}\n"; +print " \n"; } # acl_security_save(&options) @@ -53,7 +53,6 @@ $_[0]->{'global'} = $in{'global'}; $_[0]->{'add'} = $in{'add'}; $_[0]->{'update'} = $in{'update'}; $_[0]->{'dir'} = $in{'dir'}; -$_[0]->{'user'} = $in{'user_def'} == 2 ? "*" : - $in{'user_def'} == 1 ? "" : $in{'user'}; +$_[0]->{'user'} = $in{'user_def'} == 2 ? "*" : $in{'user_def'} == 1 ? "" : $in{'user'}; } diff --git a/tools/webmin/awstats/awstats-webmin_changelog.txt b/tools/webmin/awstats/awstats-webmin_changelog.txt index 90ead4e7..985817d5 100644 --- a/tools/webmin/awstats/awstats-webmin_changelog.txt +++ b/tools/webmin/awstats/awstats-webmin_changelog.txt @@ -2,6 +2,18 @@ AWStats-Webmin module Changelog ------------------------------- $Revision$ - $Author$ - $Date$ +1.300 + +Fixes: +- Translation was in french for some texts, whatever was choosed language. + +New features/improvements: +- Added a warning to explain to add '/private/etc' to webmin ACL for + MacOS users. +- A first screen for the schedule update feature. +- Better description for ACL page. + + 1.210 diff --git a/tools/webmin/awstats/edit_config.cgi b/tools/webmin/awstats/edit_config.cgi index 8a2d4d98..c1600d3a 100644 --- a/tools/webmin/awstats/edit_config.cgi +++ b/tools/webmin/awstats/edit_config.cgi @@ -74,6 +74,11 @@ function neww(id) { EOF +if (-d "/private/etc" && ! &can_edit_config("/private/etc")) { # For MacOS users + print "Warning: It seems that you are a MacOS user. With MacOS, the '/etc/awstats' directory is not a hard directory but a link to '/private/etc/awstats' which is not by default an allowed directory to store config files, so if you want to store config files in '/etc/awstats', you must first change the Webmin ACL for AWStats module to add '/private/etc' in the allowed directories list:
\n"; + print &text('index_changeallowed',"Webmin - Webmin Users", $text{'index_title'})."
\n"; +} + print "
\n"; @@ -93,8 +98,10 @@ print " \n"; my $filenametosave=""; if ($in{'new'}) { print "\n"; print "\n"; } else { diff --git a/tools/webmin/awstats/index.cgi b/tools/webmin/awstats/index.cgi index c6cf2ff5..73a3e9b2 100644 --- a/tools/webmin/awstats/index.cgi +++ b/tools/webmin/awstats/index.cgi @@ -110,7 +110,7 @@ foreach my $dir (split(/\s/,$access{'dir'})) { print "$dir
"; } print "
\n"; -print &text('index_changeallowed',"Menu Webmin - Utilisateurs Webmin puis clic sur $text{'index_title'}")."
\n"; +print &text('index_changeallowed',"Webmin - Webmin Users", $text{'index_title'})."
\n"; print "
"; my $nbofallowedconffound=0; diff --git a/tools/webmin/awstats/lang/de b/tools/webmin/awstats/lang/de index c1cceda4..05f0f772 100644 --- a/tools/webmin/awstats/lang/de +++ b/tools/webmin/awstats/lang/de @@ -29,7 +29,7 @@ index_advanced5=Direktiven f index_hideadvanced=Optionale Direktiven verbergen index_nodirallowed=Der Benutzer $1 hat kein berechtigtes Verzeichniss zum lesen/speichern von AWStats Konfigurationen index_allowed=Ihr Benutzer-Konto $1 ist berechtigt, um Dateien anzusehen/bearbeiten in -index_changeallowed=Berechtigungen für Verzeichnisse, die es Ihnen erlaube AWStats Konfigurationen zu listen/berabeiten, kann Ihnen der Webmin Administrator über den Benutzer ACL Editor zuweisen ($1) +index_changeallowed=Berechtigungen für Verzeichnisse, die es Ihnen erlaube AWStats Konfigurationen zu listen/berabeiten, kann Ihnen der Webmin Administrator über den Benutzer ACL Editor zuweisen (Menu $1 then clic on $2) edit_title1=Konfiguration hinzufügen edit_title2=Konfiguration bearbeiten diff --git a/tools/webmin/awstats/lang/en b/tools/webmin/awstats/lang/en index 31325d7f..124f0e18 100644 --- a/tools/webmin/awstats/lang/en +++ b/tools/webmin/awstats/lang/en @@ -29,7 +29,7 @@ index_advanced5=View directives for OPTIONAL EXTRA SETUP SECTION index_hideadvanced=Hide optional directives index_nodirallowed=Your user $1 has no allowed directory to read/store AWStats configuration files. index_allowed=Your account $1 is allowed to view/edit config files into (or that are links to) -index_changeallowed=Permissions on directories into which you are allowed to scan/edit AWStats configuration files can be granted to you by a webmin administrator from the Webmin user ACL editor ($1) +index_changeallowed=Permissions on directories into which you are allowed to scan/edit AWStats configuration files can be granted to you by a webmin administrator from the Webmin user ACL editor (Menu $1 then clic on $2) edit_title1=Add config File edit_title2=Edit config File @@ -70,7 +70,7 @@ acl_update=Can update stats for existing config files? acl_user=Run AWStats as Unix user acl_this=Current webmin user acl_any=Any user -acl_dir=Only allow viewing reports and editing config for config files under +acl_dir=Only allow viewing reports and editing config for config files under (hard directory paths, no links) help_title=Help page help_subtitle=Help for config file parameter $1 diff --git a/tools/webmin/awstats/lang/fr b/tools/webmin/awstats/lang/fr index 0d3071b3..1f113d03 100644 --- a/tools/webmin/awstats/lang/fr +++ b/tools/webmin/awstats/lang/fr @@ -29,7 +29,7 @@ index_advanced5=Voir param index_hideadvanced=Cacher paramètres optionnels index_allowed=Votre login $1 est autorisé à voir/editer les fichiers de config dans (ou pointant vers) index_nodirallowed=Votre compte $1 n'a aucun répertoire autorisé en lecture/écriture de fichier de configuration AWStats. -index_changeallowed=Les permissions des répertoires dans lesquels vous pouvez voir/éditer des fichiers de configuration AWStats peuvent vous être accordées par un administrateur Webmin via l'éditeur des ACL utilisateurs Webmin ($1) +index_changeallowed=Les permissions des répertoires dans lesquels vous pouvez voir/éditer des fichiers de configuration AWStats peuvent vous être accordées par un administrateur Webmin via l'éditeur des ACL utilisateurs Webmin (Menu $1 puis clic sur $2) edit_title1=Ajout d'un fichier de config edit_title2=Edition d'un fichier de config @@ -65,12 +65,12 @@ log_generate_log=Mise acl_view=Peut voir les stats pour les fichiers config existant? acl_global=Peut editer les fichiers config AWStats? -acl_add=Peut ajouter/supprimer les fichiers? -acl_update=Peut mettre à jour les stats pour les fichiers config existant? +acl_add=Peut ajouter/supprimer des fichiers config? +acl_update=Peut mettre à jour les stats pour les fichiers config existants? acl_user=Lancer AWStats sour l'utilisateur Unix acl_this=Utilisateur webmin actuel acl_any=Tout utilisateur -acl_dir=Autorise la vue de stats et l'édition de fichier de config pour les fichiers config dans +acl_dir=Autorise la vue de stats et l'édition de fichier de config pour les fichiers config dans (chemin de répertoires en durs, pas de liens) help_title=Page d'aide help_subtitle=Aide sur le paramètre de configuration $1 diff --git a/tools/webmin/awstats/module.info b/tools/webmin/awstats/module.info index eaa7808b..4c27d9f7 100644 --- a/tools/webmin/awstats/module.info +++ b/tools/webmin/awstats/module.info @@ -2,8 +2,9 @@ category=system desc=AWStats Logfile Analyzer longdesc=Generate and analyze graphicaly statistics from web, proxy, wap, ftp or mail server log files name=AWStats -version=1.210 -depends=cron 1.000 +version=1.300 depends=webmin 1.030 +depends=cron 1.000 +depends=logrotate 1.131 desc_fr=Analyseur de Logs AWStats -long_desc_fr=Génèration et analyse graphique de statistiques à partir des logs de server web, ftp ou mail \ No newline at end of file +long_desc_fr=Génération et analyse graphique de statistiques à partir des logs de server web, ftp ou mail \ No newline at end of file diff --git a/tools/webmin/awstats/save_config.cgi b/tools/webmin/awstats/save_config.cgi index 7120b3ae..a8a5af36 100644 --- a/tools/webmin/awstats/save_config.cgi +++ b/tools/webmin/awstats/save_config.cgi @@ -28,10 +28,10 @@ elsif ($in{'delete'}) { # Delete this config file from the configuration local $cfile = $in{'file'}; - &lock_file($cfile); - unlink($cfile); - &unlock_file($cfile); - &webmin_log("delete", "log", $in{'file'}); + local $cfileold = $in{'file'}.".old"; + &lock_file($cfile); unlink($cfile); &unlock_file($cfile); + &lock_file($cfileold); unlink($cfileold); &unlock_file($cfileold); + &webmin_log("delete", "log", $cfile); # Create or delete the cron job # &lock_file($job->{'file'}); diff --git a/tools/webmin/awstats/schedule_stats.cgi b/tools/webmin/awstats/schedule_stats.cgi index 1a3ff777..dcb719e2 100644 --- a/tools/webmin/awstats/schedule_stats.cgi +++ b/tools/webmin/awstats/schedule_stats.cgi @@ -17,11 +17,73 @@ if ($in{'file'} =~ /^(.*)[\\\/][^\\\/]+$/) { $dir=$1; } print "
\n"; + print "Feature not yet available\n"; print "You must manually check if AWStats update process is"; - print " in crontab"; -print " or added into a logrotate preprocessor task"; +print " or added into a logrotate preprocessor task
"; +print "
\n"; + +# Read cron +&foreign_require("cron", "cron-lib.pl"); +#@procs = &foreign_call("proc", "list_processes"); +#&foreign_call("proc", "renice_proc", $pid, -10); + +# Read logrotate +&foreign_require("logrotate", "logrotate-lib.pl"); +#@procs = &foreign_call("proc", "list_processes"); +#&foreign_call("proc", "renice_proc", $pid, -10); + + +# For global update +print "
$text{'edit_add'} \n"; -# print ""; - print ""; + + my $newfile="/etc/awstats/awstats.newconfig.conf"; + print ""; + print "

\n"; +print "\n"; + +print "\n"; +print "\n"; +print "
"; +print "Scheduled AWStats global update process (For all files in /etc/awstats)"; +print "
None  
Yes "; + +print "\n"; +# Show cron found +print "\n"; +# Loop on each logrotate found +print "\n"; +print "\n"; +print "\n"; +print "
By cron Date: NA Remove this order
By logrotate preprocess File: NA Remove this order
Add a new global update order by cron
Add a new global update order by a logrotate file
"; + +print "
"; + + +print "
\n"; + + +# For particular config file update +print "\n"; +print "\n"; + +print "\n"; +print "\n"; +print "
"; +print "Scheduled AWStats update process for this config file only (".$in{'file'}.")"; +print "
None  
Yes "; + +print "\n"; +# Show cron found +print "\n"; +# Loop on each logrotate found +print "\n"; +print "\n"; +print "\n"; +print "
By cron Date: NA Remove this order
By logrotate preprocess File: NA Remove this order
Add a new global update order by cron
Add a new global update order by a logrotate file
"; + +print "
"; + + +print "
\n"; + 0;