]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
webmin module:
authoreldy <>
Tue, 17 Feb 2004 20:55:32 +0000 (20:55 +0000)
committereldy <>
Tue, 17 Feb 2004 20:55:32 +0000 (20:55 +0000)
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.

tools/webmin/awstats/acl_security.pl
tools/webmin/awstats/awstats-webmin_changelog.txt
tools/webmin/awstats/edit_config.cgi
tools/webmin/awstats/index.cgi
tools/webmin/awstats/lang/de
tools/webmin/awstats/lang/en
tools/webmin/awstats/lang/fr
tools/webmin/awstats/module.info
tools/webmin/awstats/save_config.cgi
tools/webmin/awstats/schedule_stats.cgi

index 7520c7378d65d054b89d93eb3153c162a05be512..07e3562abda4da11ae248f43e75ef26a157e6e73 100644 (file)
@@ -5,32 +5,32 @@ do 'awstats-lib.pl';
 # Output HTML for editing security options for the awstats module
 sub acl_security_form
 {
-print "<tr> <td><b>$text{'acl_view'}</b></td>\n";
-printf "<td nowrap><input type=radio name=view value=1 %s> %s\n",
+print "<tr> <td colspan=2><b>$text{'acl_view'}</b></td>\n";
+printf "<td colspan=2 nowrap><input type=radio name=view value=1 %s> %s\n",
        $_[0]->{'view'} ? "checked" : "", $text{'yes'};
 printf "<input type=radio name=view value=0 %s> %s</td> </tr>\n",
        $_[0]->{'view'} ? "" : "checked", $text{'no'};
 
-print "<tr> <td><b>$text{'acl_global'}</b></td>\n";
-printf "<td nowrap><input type=radio name=global value=1 %s> %s\n",
+print "<tr> <td colspan=2><b>$text{'acl_global'}</b></td>\n";
+printf "<td colspan=2 nowrap><input type=radio name=global value=1 %s> %s\n",
        $_[0]->{'global'} ? "checked" : "", $text{'yes'};
 printf "<input type=radio name=global value=0 %s> %s</td> </tr>\n",
        $_[0]->{'global'} ? "" : "checked", $text{'no'};
 
-print "<tr> <td><b>$text{'acl_add'}</b></td>\n";
-printf "<td nowrap><input type=radio name=add value=1 %s> %s\n",
+print "<tr> <td colspan=2><b>$text{'acl_add'}</b></td>\n";
+printf "<td colspan=2 nowrap><input type=radio name=add value=1 %s> %s\n",
        $_[0]->{'add'} ? "checked" : "", $text{'yes'};
 printf "<input type=radio name=add value=0 %s> %s</td> </tr>\n",
        $_[0]->{'add'} ? "" : "checked", $text{'no'};
 
-print "<tr> <td><b>$text{'acl_update'}</b></td>\n";
-printf "<td nowrap><input type=radio name=update value=1 %s> %s\n",
+print "<tr> <td colspan=2><b>$text{'acl_update'}</b></td>\n";
+printf "<td colspan=2 nowrap><input type=radio name=update value=1 %s> %s\n",
         $_[0]->{'update'} ? "checked" : "", $text{'yes'};
 printf "<input type=radio name=update value=0 %s> %s</td> </tr>\n",
         $_[0]->{'update'} ? "" : "checked", $text{'no'};
 
-print "<tr> <td><b>$text{'acl_user'}</b></td>\n";
-printf "<td colspan=3><input type=radio name=user_def value=1 %s> %s\n",
+print "<tr> <td colspan=2><b>$text{'acl_user'}</b></td>\n";
+printf "<td colspan=2><input type=radio name=user_def value=1 %s> %s\n",
        $_[0]->{'user'} eq "" ? "checked" : "", $text{'acl_this'};
 printf "<input type=radio name=user_def value=2 %s> %s\n",
        $_[0]->{'user'} eq "*" ? "checked" : "", $text{'acl_any'};
@@ -40,8 +40,8 @@ printf "<input name=user size=8 value='%s'> %s</td> </tr>\n",
        $_[0]->{'user'} eq "*" ? "" : $_[0]->{'user'},
        &user_chooser_button("user");
 
-print "<tr> <td><b>$text{'acl_dir'}</b></td>\n";
-print "<td colspan=3><input name=dir size=50 value='$_[0]->{'dir'}'></td> </tr>\n";
+print "<tr> <td colspan=2><b>$text{'acl_dir'}</b></td>\n";
+print "<td colspan=2><input name=dir size=50 value='$_[0]->{'dir'}'></td> </tr>\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'};
 }
 
index 90ead4e779c29c4fb1305be6b44b667abda594d2..985817d5113d97cd2ae932ed315afc65b743db01 100644 (file)
@@ -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
 
index 8a2d4d98440d0736c934c653d6b701e74e57b1e2..c1600d3aab05e53ba6877ced2ef9cad4a80acc10 100644 (file)
@@ -74,6 +74,11 @@ function neww(id) {
 </SCRIPT>
 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:<br>\n";
+       print &text('index_changeallowed',"<a href=\"/acl/\">Webmin - Webmin Users</a>", $text{'index_title'})."<br>\n";
+}
+
 
 print "<form name='editconfig' action='save_config.cgi'>\n";
 
@@ -93,8 +98,10 @@ print "<tr $cb> <td><table width=100%>\n";
 my $filenametosave="";
 if ($in{'new'}) {
        print "<tr> <td><b>$text{'edit_add'}</b></td> <td>\n";
-#      print "<input type=text name=new size=50 value='$config{'awstats_conf'}/awstats.newconfig.conf'>";
-       print "<input type=text name=new size=50 value='/etc/awstats/awstats.newconfig.conf'>";
+
+       my $newfile="/etc/awstats/awstats.newconfig.conf";
+       print "<input type=text name=new size=50 value='$newfile'>";
+
        print "</td> <td> </td> </tr>\n";
        print "<tr> <td colspan=3><hr></td> </tr>\n";
 } else {
index c6cf2ff5f6c0608838df333172d93f73b5a3d72b..73a3e9b2721302eb1258575198f912025194d394 100644 (file)
@@ -110,7 +110,7 @@ foreach my $dir (split(/\s/,$access{'dir'})) {
        print "$dir<br>"; 
 }
 print "<br>\n";
-print &text('index_changeallowed',"Menu <a href=\"/acl/\">Webmin - Utilisateurs Webmin</a> puis clic sur $text{'index_title'}")."<br>\n";
+print &text('index_changeallowed',"<a href=\"/acl/\">Webmin - Webmin Users</a>", $text{'index_title'})."<br>\n";
 print "<br>";
 
 my $nbofallowedconffound=0;
index c1cceda4336296e25c9240f1fc928e2562cd2e20..05f0f7720ebd5cefac73b9788e4c18a19272d0d7 100644 (file)
@@ -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
index 31325d7f52b3cb38ec7ea1dfde02b47684a0fab2..124f0e188c7cd2b1e6e72aacee3bd0adc694751f 100644 (file)
@@ -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=<b>Help for config file parameter $1</b>
index 0d3071b396f9437e8f0e84400eb10aa7de03a4f6..1f113d03be1646c8b333787316605f0c24a84e35 100644 (file)
@@ -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=<b>Aide sur le paramètre de configuration $1</b>
index eaa7808be1c7fe2ea0f0624b22f856525cf3d99c..4c27d9f79e228e465997affe7e573ea1793f2c64 100644 (file)
@@ -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
index 7120b3aebaa38acbb0848136a85cbc7edda85971..a8a5af36f26d6b7ecd40d74340a2439681134128 100644 (file)
@@ -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'});
index 1a3ff7774337a65bf977a52d75720c18d192ce0d..dcb719e29da08f506802a53701c883f456bd0eec 100644 (file)
@@ -17,11 +17,73 @@ if ($in{'file'} =~ /^(.*)[\\\/][^\\\/]+$/) { $dir=$1; }
 
 print "<hr>\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<br>";
+print "<br>\n";
+
+# Read cron
+&foreign_require("cron", "cron-lib.pl");\r
+#@procs = &foreign_call("proc", "list_processes");\r
+#&foreign_call("proc", "renice_proc", $pid, -10);
+
+# Read logrotate
+&foreign_require("logrotate", "logrotate-lib.pl");\r
+#@procs = &foreign_call("proc", "list_processes");\r
+#&foreign_call("proc", "renice_proc", $pid, -10);
+
+
+# For global update
+print "<table border width=100%>\n";
+print "<tr $tb> <td colspan=2 align=left><b>";
+print "Scheduled AWStats global update process (For all files in /etc/awstats)";
+print "</b></td> </tr>\n";
+
+print "<tr> <td valign=top><input name=GlobalUpdate type=radio value='none'> <b>None</b></td> <td> &nbsp; </td> </tr>\n";
+print "<tr> <td valign=top><input name=GlobalUpdate type=radio value='yes'> <b>Yes</b></td> <td> ";
+
+print "<table border=0 width=100%>\n";
+# Show cron found
+print "<tr> <td><input name=GlobalUpdate type=checkbox value='bycron'> <b>By cron</b></td> <td> Date: NA </td> <td> Remove this order </td> </tr>\n";
+# Loop on each logrotate found
+print "<tr> <td><input name=GlobalUpdate type=checkbox value='bylogrotate'> <b>By logrotate preprocess</b></td> <td> File: NA </td> <td> Remove this order </td> </tr>\n";
+print "<tr> <td> Add a new global update order by cron </td> </tr>\n";
+print "<tr> <td> Add a new global update order by a logrotate file </td> </tr>\n";
+print "</table>";
+
+print "</td> </tr>\n";
+print "</table>";
+
+
+print "<br>\n";
+
+
+# For particular config file update
+print "<table border width=100%>\n";
+print "<tr $tb> <td colspan=2 align=left><b>";
+print "Scheduled AWStats update process for this config file only (".$in{'file'}.")";
+print "</b></td> </tr>\n";
+
+print "<tr> <td valign=top><input name=GlobalUpdate type=radio value='none'> <b>None</b></td> <td> &nbsp; </td> </tr>\n";
+print "<tr> <td valign=top><input name=GlobalUpdate type=radio value='yes'> <b>Yes</b></td> <td> ";
+
+print "<table border=0 width=100%>\n";
+# Show cron found
+print "<tr> <td><input name=GlobalUpdate type=checkbox value='bycron'> <b>By cron</b></td> <td> Date: NA </td> <td> Remove this order </td> </tr>\n";
+# Loop on each logrotate found
+print "<tr> <td><input name=GlobalUpdate type=checkbox value='bylogrotate'> <b>By logrotate preprocess</b></td> <td> File: NA </td> <td> Remove this order </td> </tr>\n";
+print "<tr> <td> Add a new global update order by cron </td> </tr>\n";
+print "<tr> <td> Add a new global update order by a logrotate file </td> </tr>\n";
+print "</table>";
+
+print "</td> </tr>\n";
+print "</table>";
+
+
+print "<br>\n";
+
 
 0;