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.
# 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'};
$_[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)
$_[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'};
}
-------------------------------
$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
</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";
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 {
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_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_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
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_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
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>
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
# 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'});
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> </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> </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;