]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
webmin: Add a summary for all configs on same page.
authoreldy <>
Mon, 1 Nov 2004 16:42:27 +0000 (16:42 +0000)
committereldy <>
Mon, 1 Nov 2004 16:42:27 +0000 (16:42 +0000)
tools/webmin/awstats/awstats-lib.pl
tools/webmin/awstats/awstats-webmin_changelog.txt
tools/webmin/awstats/edit_config.cgi
tools/webmin/awstats/index.cgi
tools/webmin/awstats/lang/en
tools/webmin/awstats/lang/fr

index c583e88d0b215e78bd45e4c9f798dce032e1e957..0e4168e57b3e7af128b67996971f34a2c89e7c9c 100644 (file)
@@ -2,7 +2,7 @@
 # Common functions for editing the awstats config file
 
 do '../web-lib.pl';
-require '../javascript-lib.pl'; \r
+require '../javascript-lib.pl';
 &init_config();
 
 #$config{'awstats'}||='/usr/local/awstats/wwwroot/cgi-bin/awstats.pl';
@@ -18,9 +18,9 @@ $cron_cmd = "$module_config_directory/awstats.pl";
 # Show help tooltip
 sub hblink
 {
-       my $t=shift;
-       my $url=shift;
-       print "<a href=\"javascript:neww('$url');\">$t</a>";
+    my $t=shift;
+    my $url=shift;
+    print "<a href=\"javascript:neww('$url');\">$t</a>";
 }
 
 
@@ -28,268 +28,327 @@ sub hblink
 # Update the awstats config file
 sub update_config
 {
-my ($file,$conf)=@_;
-if (! $file) { error("Call to update_config with wrong parameter"); }
-
-open(FILE, $file) || error("Failed to open $file for update");
-open(FILETMP, ">$file.tmp") || error("Failed to open $file.tmp for writing");
-
-# $%conf contains param and values
-my %confchanged=();
-my $conflinenb = 0;
-
-# First, change values that are already present in old config file
-while(<FILE>) {
-       my $savline=$_;
-
-       chomp $_; s/\r//;
-       $conflinenb++;
-
-       # Remove comments not at beginning of line
-       $_ =~ s/\s#.*$//;
-
-       # Extract param and value
-       my ($param,$value)=split(/=/,$_,2);
-       $param =~ s/^\s+//; $param =~ s/\s+$//;
-       $value =~ s/#.*$//; 
-       $value =~ s/^[\s\'\"]+//; $value =~ s/[\s\'\"]+$//;
-
-       if ($param) {
-               # cleanparam is param without begining #
-               my $cleanparam=$param; my $wascleaned=0;
-               if ($cleanparam =~ s/^#//) { $wascleaned=1; }
-               if ($cleanparam !~ /LoadPlugin/i && defined($conf->{$cleanparam})) {
-                       # Value was provided from submit form in %conf hash array so we change line with this new value
-                       $savline = "$cleanparam=\"".($conf->{$cleanparam})."\"\n";
-                       $confchanged{$cleanparam}=1;
-               }
-               if ($cleanparam =~ /^LoadPlugin/i && $conf->{"advanced"} == 4) {
-                       # It's a plugin load directive
-                       my ($pluginname,$pluginparam)=split(/\s/,$value,2);
-                       if ($conf->{"plugin_$pluginname"}) {    # Plugin loaded is asked
-                               $savline = "$cleanparam=\"$pluginname".($conf->{"plugin_param_$pluginname"}?" ".$conf->{"plugin_param_$pluginname"}:"")."\"\n";
-                       } else {                                                                # Plugin loaded is not asked
-                               $savline = "#$cleanparam=\"$pluginname".($conf->{"plugin_param_$pluginname"}?" ".$conf->{"plugin_param_$pluginname"}:"")."\"\n";
-                       }
-                       $confchanged{"plugin_$pluginname"}=1;
-               }
-       }
-       # Write line
-       print FILETMP "$savline";       
+    my ($file,$conf)=@_;
+    if (! $file) { error("Call to update_config with wrong parameter"); }
+
+    open(FILE, $file) || error("Failed to open $file for update");
+    open(FILETMP, ">$file.tmp") || error("Failed to open $file.tmp for writing");
+
+    # $%conf contains param and values
+    my %confchanged=();
+    my $conflinenb = 0;
+
+    # First, change values that are already present in old config file
+    while(<FILE>) {
+        my $savline=$_;
+
+        chomp $_; s/\r//;
+        $conflinenb++;
+
+        # Remove comments not at beginning of line
+        $_ =~ s/\s#.*$//;
+
+        # Extract param and value
+        my ($param,$value)=split(/=/,$_,2);
+        $param =~ s/^\s+//; $param =~ s/\s+$//;
+        $value =~ s/#.*$//;
+        $value =~ s/^[\s\'\"]+//; $value =~ s/[\s\'\"]+$//;
+
+        if ($param) {
+            # cleanparam is param without begining #
+            my $cleanparam=$param; my $wascleaned=0;
+            if ($cleanparam =~ s/^#//) { $wascleaned=1; }
+            if ($cleanparam !~ /LoadPlugin/i && defined($conf->{$cleanparam})) {
+                # Value was provided from submit form in %conf hash array so we change line with this new value
+                $savline = "$cleanparam=\"".($conf->{$cleanparam})."\"\n";
+                $confchanged{$cleanparam}=1;
+            }
+            if ($cleanparam =~ /^LoadPlugin/i && $conf->{"advanced"} == 4) {
+                # It's a plugin load directive
+                my ($pluginname,$pluginparam)=split(/\s/,$value,2);
+                if ($conf->{"plugin_$pluginname"}) {   # Plugin loaded is asked
+                    $savline = "$cleanparam=\"$pluginname".($conf->{"plugin_param_$pluginname"}?" ".$conf->{"plugin_param_$pluginname"}:"")."\"\n";
+                } else {                                                               # Plugin loaded is not asked
+                    $savline = "#$cleanparam=\"$pluginname".($conf->{"plugin_param_$pluginname"}?" ".$conf->{"plugin_param_$pluginname"}:"")."\"\n";
+                }
+                $confchanged{"plugin_$pluginname"}=1;
+            }
+        }
+        # Write line
+        print FILETMP "$savline";
+    }
+
+    # Now add values for directives that were not present in old config file
+    foreach my $key (keys %$conf) {
+        if ($key eq 'advanced') { next; }      # param to know if plugin setup section was opened
+        if ($key =~ /^plugin_/) { next; }      # field from plugin section, not an awstats directive
+        if ($confchanged{$key}) { next; }      # awstats directive already changed
+        print FILETMP "\n";
+        print FILETMP "# Param $key added by AWStats Webmin module\n";
+        print FILETMP "$key=\"$conf->{$key}\"\n";
+    }
+
+    # Now add plugin load that were not already present in old config file
+    foreach my $key (keys %$conf) {
+        my $pluginname = $key;
+        if ($pluginname !~ s/^plugin_//) { next; }                     # not a plugin load row
+        if ($pluginname =~ /^param_/) { next; }                                # not a plugin load row
+        if ($confchanged{"plugin_$pluginname"}) { next; }      # awstats directive or load plugin already changed
+        print FILETMP "\n";
+        print FILETMP "# Plugin load for plugin $pluginname added by AWStats Webmin module\n";
+        print FILETMP "LoadPlugin=\"$pluginname".($conf->{"plugin_param_$pluginname"}?" ".$conf->{"plugin_param_$pluginname"}:"")."\"\n";
+    }
+
+    close(FILE);
+    close(FILETMP);
+
+    # Move file to file.sav
+    if (rename("$file","$file.old")==0) {
+        error("Failed to make backup of current config file to $file.old");
+    }
+
+    # Move tmp file into config file
+    if (rename("$file.tmp","$file")==0) {
+        error("Failed to move tmp config file $file.tmp to $file");
+    }
+
+
+    return 0;
 }
 
-# Now add values for directives that were not present in old config file
-foreach my $key (keys %$conf) {
-       if ($key eq 'advanced') { next; }       # param to know if plugin setup section was opened
-       if ($key =~ /^plugin_/) { next; }       # field from plugin section, not an awstats directive
-       if ($confchanged{$key}) { next; }       # awstats directive already changed
-       print FILETMP "\n";
-       print FILETMP "# Param $key added by AWStats Webmin module\n";
-       print FILETMP "$key=\"$conf->{$key}\"\n";
-}
-
-# Now add plugin load that were not already present in old config file
-foreach my $key (keys %$conf) {
-       my $pluginname = $key; 
-       if ($pluginname !~ s/^plugin_//) { next; }                      # not a plugin load row
-       if ($pluginname =~ /^param_/) { next; }                         # not a plugin load row
-       if ($confchanged{"plugin_$pluginname"}) { next; }       # awstats directive or load plugin already changed
-       print FILETMP "\n";
-       print FILETMP "# Plugin load for plugin $pluginname added by AWStats Webmin module\n";
-       print FILETMP "LoadPlugin=\"$pluginname".($conf->{"plugin_param_$pluginname"}?" ".$conf->{"plugin_param_$pluginname"}:"")."\"\n";
-}
-
-close(FILE);
-close(FILETMP);
-
-# Move file to file.sav
-if (rename("$file","$file.old")==0) {
-       error("Failed to make backup of current config file to $file.old");
+# get_dirdata($configfile)
+# Read config file to return value of dirdata parameter
+sub get_dirdata
+{
+    my $dirdata="notfound";
+    
+    my ($file)=@_;
+    if (! $file) { error("Call to get_dirdata with wrong parameter"); }
+
+    open(FILE, "<$file") || error("Failed to open $file for read");
+
+    # First, search value of DirData parameter
+    while(<FILE>) {
+        my $savline=$_;
+
+        chomp $_; s/\r//;
+
+        # Remove comments not at beginning of line
+        $_ =~ s/\s#.*$//;
+
+        # Extract param and value
+        my ($param,$value)=split(/=/,$_,2);
+        $param =~ s/^\s+//; $param =~ s/\s+$//;
+        $value =~ s/#.*$//;
+        $value =~ s/^[\s\'\"]+//; $value =~ s/[\s\'\"]+$//;
+
+        if ($param) {
+            # cleanparam is param without begining #
+            my $cleanparam=$param; my $wascleaned=0;
+            if ($cleanparam =~ s/^#//) { $wascleaned=1; }
+            if ($cleanparam =~ /^DirData/) {
+                $dirdata=$value;
+                last;
+            }
+        }
+    }
+    close(FILE);
+
+    return $dirdata;
 }
 
-# Move tmp file into config file
-if (rename("$file.tmp","$file")==0) {
-       error("Failed to move tmp config file $file.tmp to $file");
-}
-
-
-return 0;
+use vars qw/ $regclean1 $regclean2 /;
+$regclean1=qr/<(recnb|\/td)>/i;
+$regclean2=qr/<\/?[^<>]+>/i;
+
+#------------------------------------------------------------------------------
+# Function:     Clean tags in a string
+# Parameters:   stringtodecode
+# Input:        None
+# Output:       None
+# Return:              decodedstring
+#------------------------------------------------------------------------------
+sub CleanFromTags {
+       my $stringtoclean=shift;
+       $stringtoclean =~ s/$regclean1/ /g;     # Replace <recnb> or </td> with space
+       $stringtoclean =~ s/$regclean2//g;      # Remove <xxx>
+       return $stringtoclean;
 }
 
 # save_directive(&config, name, [value]*)
 sub save_directive
 {
-local ($conf, $name, @values) = @_;
-local @old = &find($name, $conf);
-local $lref = &read_file_lines($conf->[0]->{'file'});
-local $i;
-for($i=0; $i<@old || $i<@values; $i++) {
-       if ($i < @old && $i < @values) {
-               # Just replacing a line
-               $lref->[$old[$i]->{'line'}] = "$name $values[$i]";
-               }
-       elsif ($i < @old) {
-               # Deleting a line
-               splice(@$lref, $old[$i]->{'line'}, 1);
-               &renumber($conf, $old[$i]->{'line'}, -1);
-               }
-       elsif ($i < @values) {
-               # Adding a line
-               if (@old) {
-                       # after the last one of the same type
-                       splice(@$lref, $old[$#old]->{'line'}+1, 0,
-                              "$name $values[$i]");
-                       &renumber($conf, $old[$#old]->{'line'}+1, 1);
-                       }
-               else {
-                       # at end of file
-                       push(@$lref, "$name $values[$i]");
-                       }
-               }
-       }
+    local ($conf, $name, @values) = @_;
+    local @old = &find($name, $conf);
+    local $lref = &read_file_lines($conf->[0]->{'file'});
+    local $i;
+    for($i=0; $i<@old || $i<@values; $i++) {
+        if ($i < @old && $i < @values) {
+            # Just replacing a line
+            $lref->[$old[$i]->{'line'}] = "$name $values[$i]";
+        }
+        elsif ($i < @old) {
+            # Deleting a line
+            splice(@$lref, $old[$i]->{'line'}, 1);
+            &renumber($conf, $old[$i]->{'line'}, -1);
+        }
+        elsif ($i < @values) {
+            # Adding a line
+            if (@old) {
+                # after the last one of the same type
+                splice(@$lref, $old[$#old]->{'line'}+1, 0,
+                "$name $values[$i]");
+                &renumber($conf, $old[$#old]->{'line'}+1, 1);
+            }
+            else {
+                # at end of file
+                push(@$lref, "$name $values[$i]");
+            }
+        }
+    }
 }
 
 # renumber(&config, line, offset)
 sub renumber
 {
-foreach $c (@{$_[0]}) {
-       $c->{'line'} += $_[2] if ($c->{'line'} >= $_[1]);
-       }
+    foreach $c (@{$_[0]}) {
+        $c->{'line'} += $_[2] if ($c->{'line'} >= $_[1]);
+    }
 }
 
 # temp_file_name(file)
 sub temp_file_name
 {
-local $p = $_[0];
-$p =~ s/^\///;
-$p =~ s/\//_/g;
-return "$module_config_directory/$p.tmp";
+    local $p = $_[0];
+    $p =~ s/^\///;
+    $p =~ s/\//_/g;
+    return "$module_config_directory/$p.tmp";
 }
 
 # find(name, &config)
 sub find
 {
-local @rv;
-foreach $c (@{$_[1]}) {
-       push(@rv, $c) if (lc($c->{'name'}) eq lc($_[0]));
-       }
-return wantarray ? @rv : $rv[0];
+    local @rv;
+    foreach $c (@{$_[1]}) {
+        push(@rv, $c) if (lc($c->{'name'}) eq lc($_[0]));
+    }
+    return wantarray ? @rv : $rv[0];
 }
 
 # find_value(name, &config)
 sub find_value
 {
-local @rv = map { $_->{'value'} } &find(@_);
-return wantarray ? @rv : $rv[0];
+    local @rv = map { $_->{'value'} } &find(@_);
+    return wantarray ? @rv : $rv[0];
 }
 
 # all_config_files(file)
 sub all_config_files
 {
-$_[0] =~ /^(.*)\/([^\/]+)$/;
-local $dir = $1;
-local $base = $2;
-local ($f, @rv);
-opendir(DIR, $dir);
-foreach $f (readdir(DIR)) {
-       if ($f =~ /^\Q$base\E/ && -f "$dir/$f") {
-               push(@rv, "$dir/$f");
-               }
-       }
-closedir(DIR);
-return @rv;
+    $_[0] =~ /^(.*)\/([^\/]+)$/;
+    local $dir = $1;
+    local $base = $2;
+    local ($f, @rv);
+    opendir(DIR, $dir);
+    foreach $f (readdir(DIR)) {
+        if ($f =~ /^\Q$base\E/ && -f "$dir/$f") {
+            push(@rv, "$dir/$f");
+        }
+    }
+    closedir(DIR);
+    return @rv;
 }
 
 # get_config(path)
 # Get the configuration for some log file
 sub get_config
 {
-local %rv;
-&read_file($_[0], \%rv) || return undef;
-return \%rv;
+    local %rv;
+    &read_file($_[0], \%rv) || return undef;
+    return \%rv;
 }
 
 # generate_report_as_pdf(file, handle, escape)
 sub generate_report_as_pdf
 {
-local $h = $_[1];
-local $lconf = &get_config($_[0]);
-local @all = &all_config_files($_[0]);
-if (!@all) {
-       print $h "Log file $_[0] does not exist\n";
-       return;
-       }
-local ($a, %mtime);
-foreach $a (@all) {
-       local @st = stat($a);
-       $mtime{$a} = $st[9];
-       }
-local $type = $lconf->{'type'} == 1 ? "" :
-             $lconf->{'type'} == 2 ? "-F squid" :
-             $lconf->{'type'} == 3 ? "-F ftp" : "";
-local $cfile = &temp_file_name($_[0]);
-local $conf = -r $cfile ? "-c $cfile" : "";
-if ($lconf->{'over'}) {
-       unlink("$lconf->{'dir'}/awstats.current");
-       unlink("$lconf->{'dir'}/awstats.hist");
-       }
-local $user = $lconf->{'user'} || "root";
-if ($user ne "root" && -r $cfile) {
-       chmod(0644, $cfile);
-       }
-foreach $a (sort { $mtime{$a} <=> $mtime{$b} } @all) {
-       local $cmd = "$config{'awstats'} $conf -o '$lconf->{'dir'}' $type -p '$a'";
-       if ($user ne "root") {
-               $cmd = "su \"$user\" -c \"$cmd\"";
-               }
-       open(OUT, "$cmd 2>&1 |");
-       while(<OUT>) {
-               print $h $_[2] ? &html_escape($_) : $_;
-               }
-       close(OUT);
-       return 0 if ($?);
-       &additional_config("exec", undef, $cmd);
-       }
-return 1;
+    local $h = $_[1];
+    local $lconf = &get_config($_[0]);
+    local @all = &all_config_files($_[0]);
+    if (!@all) {
+        print $h "Log file $_[0] does not exist\n";
+        return;
+    }
+    local ($a, %mtime);
+    foreach $a (@all) {
+        local @st = stat($a);
+        $mtime{$a} = $st[9];
+    }
+    local $type = $lconf->{'type'} == 1 ? "" :
+    $lconf->{'type'} == 2 ? "-F squid" :
+    $lconf->{'type'} == 3 ? "-F ftp" : "";
+    local $cfile = &temp_file_name($_[0]);
+    local $conf = -r $cfile ? "-c $cfile" : "";
+    if ($lconf->{'over'}) {
+        unlink("$lconf->{'dir'}/awstats.current");
+        unlink("$lconf->{'dir'}/awstats.hist");
+    }
+    local $user = $lconf->{'user'} || "root";
+    if ($user ne "root" && -r $cfile) {
+        chmod(0644, $cfile);
+    }
+    foreach $a (sort { $mtime{$a} <=> $mtime{$b} } @all) {
+        local $cmd = "$config{'awstats'} $conf -o '$lconf->{'dir'}' $type -p '$a'";
+        if ($user ne "root") {
+            $cmd = "su \"$user\" -c \"$cmd\"";
+        }
+        open(OUT, "$cmd 2>&1 |");
+        while(<OUT>) {
+            print $h $_[2] ? &html_escape($_) : $_;
+        }
+        close(OUT);
+        return 0 if ($?);
+        &additional_config("exec", undef, $cmd);
+    }
+    return 1;
 }
 
 # spaced_buttons(button, ...)
 sub spaced_buttons
 {
-local $pc = int(100 / scalar(@_));
-print "<table width=100%><tr>\n";
-foreach $b (@_) {
-       local $al = $b eq $_[0] && scalar(@_) != 1 ? "align=left" : $b eq $_[@_-1] && scalar(@_) != 1 ? "align=right" : "align=center";
-       print "<td width=$pc% $al>$b</td>\n";
-       }
-print "</tr>\n";
-print "</table>\n";
+    local $pc = int(100 / scalar(@_));
+    print "<table width=100%><tr>\n";
+    foreach $b (@_) {
+        local $al = $b eq $_[0] && scalar(@_) != 1 ? "align=left" : $b eq $_[@_-1] && scalar(@_) != 1 ? "align=right" : "align=center";
+        print "<td width=$pc% $al>$b</td>\n";
+    }
+    print "</tr>\n";
+    print "</table>\n";
 }
 
 # scan_config_dir()
 # Scan directory $dir for config file. Return an array with full path
 sub scan_config_dir
 {
-my $dir=shift;
-opendir(DIR, $dir) || return;
-local @rv = grep { /^awstats\.(.*)conf$/ } sort readdir(DIR);
-closedir(DIR);
-foreach my $file (0..@rv-1) {
-       if ($rv[$file] eq 'awstats.model.conf') { next; }
-       $rv[$file]="$dir/".$rv[$file];
-       #print "$rv[0]\n<br>";
-}
-return @rv;
+    my $dir=shift;
+    opendir(DIR, $dir) || return;
+    local @rv = grep { /^awstats\.(.*)conf$/ } sort readdir(DIR);
+    closedir(DIR);
+    foreach my $file (0..@rv-1) {
+        if ($rv[$file] eq 'awstats.model.conf') { next; }
+        $rv[$file]="$dir/".$rv[$file];
+        #print "$rv[0]\n<br>";
+    }
+    return @rv;
 }
 
 # can_edit_config(file)
 sub can_edit_config
 {
-foreach $d (split(/\s+/, $access{'dir'})) {
-       local $ok = &is_under_directory($d, $_[0]);
-       return 1 if ($ok);
-       }
-return 0;
+    foreach $d (split(/\s+/, $access{'dir'})) {
+        local $ok = &is_under_directory($d, $_[0]);
+        return 1 if ($ok);
+    }
+    return 0;
 }
 
 
index 0835e64e380a4959e1a803729de6139674577a2a..32d3a29669811f29741cf03776fc6d3f100b2fc3 100644 (file)
@@ -5,8 +5,11 @@ $Revision$ - $Author$ - $Date$
 1.400
 
 New features/improvements:
-- Some change to add scheduler management for update process
+- Some change to add scheduler management for update process.
 - Creating new config files can be done by copying an old one.
+- Add a page for a summary of all config files on same pages.
+- Added a row number on each row of index page.
+- Translation more complete.
 
 
 1.300
index ac9bba23b70e1ee81a587e1c2510f6c76272466f..e641d5a1d1745388486467a9ff94ebb7c757fd65 100644 (file)
@@ -190,7 +190,7 @@ print "<tr> <td><b>AllowToUpdateStatsFromBrowser</b></td> <td> <input size=10 na
 print &hblink($text{'help_help'}, "help.cgi?param=AllowToUpdateStatsFromBrowser")." </td> </tr>\n";
 print "<tr> <td><b>AllowFullYearView</b></td> <td> <input size=10 name=AllowFullYearView type=text value='$lconf->{'AllowFullYearView'}'> </td> <td> ";
 print &hblink($text{'help_help'}, "help.cgi?param=AllowFullYearView")." </td> </tr>\n";
-print "<tr> <td colspan=2><b>*</b> are required parameters with no default value. They can't be empty.</td> <td> ";
+print "<tr> <td colspan=2><b>*</b> ".$text{'help_starrequired'}."</td> <td> ";
 
 
 print "<tr> <td colspan=3><br>OPTIONAL SETUP SECTION (Not required but increase AWStats features)<br><hr></td> </tr>\n";
index 1b2c41ff81cec60875bc7c686fedc288bff806fa..13e32fba1bf012202b85ed34e63134345f006b60 100644 (file)
@@ -61,7 +61,7 @@ my @configdirtoscan=split(/\s+/, $access{'dir'});
        
 if (! @configdirtoscan) {
        print &text('index_nodirallowed',"<b>$remote_user</b>")."<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 - Utilisateurs Webmin</a>", $text{'index_title'})."<br>\n";
        print "<br>\n";
 #      print "<p>",&text('index_econfdir', "<tt>$config{'awstats_conf'}</tt>",
 #                "$gconfig{'webprefix'}/config.cgi?$module_name"),"<p>\n";
@@ -115,29 +115,36 @@ print &text('index_changeallowed',"<a href=\"/acl/\">Webmin - Webmin Users</a>",
 print "<br>";
 
 my $nbofallowedconffound=0;
-if (@config) {
+if (scalar @config) {
 
        # Loop on each config file
        foreach my $l (@config) {
                next if (!&can_edit_config($l));
                $nbofallowedconffound++;
 
+
                # Head of config file's table list
                if ($nbofallowedconffound == 1) {
-                       print "<a href='edit_config.cgi?new=1'>$text{'index_add'}</a>\n" if ($access{'add'});
-                       print "<table border width=100%>\n";
+
+               print "<a href='edit_config.cgi?new=1'>$text{'index_add'}</a><br><br>\n" if ($access{'add'});
+
+            if (scalar @config >= 2 && $access{'view'}) {
+                   print "<a href='view_all.cgi?new=1'>$text{'index_viewall'}</a><br><br>\n";
+            }
+            
+                       print "<table border width=\"100%\">\n";
                        print "<tr $tb>";
-                       print "<td rowspan=2 colspan=2><b>$text{'index_path'}</b></td> ";
-                       print "<td rowspan=2 align=center><b>$text{'index_create'}</b></td> ";
-                       #print "<td rowspan=2 align=center><b>$text{'index_databasesize'}</b></td> ";
-                       print "<td colspan=2 align=center><b>$text{'index_update'}</b></td> ";
-                       print "<td rowspan=2 align=center><b>$text{'index_view'}</b></td> </tr>\n";
+                       print "<td rowspan=2 colspan=2><b>$text{'index_path'}</b></td>";
+                       print "<td rowspan=2 align=center><b>$text{'index_create'}</b></td>";
+                       print "<td colspan=2 align=center><b>$text{'index_update'}</b></td>";
+                       print "<td rowspan=2 align=center><b>$text{'index_view'}</b></td>";
+                       print "</tr>\n";
                        print "<tr $tb><td align=center>$text{'index_scheduled'}</td><td align=center>$text{'index_now'}</td></tr>\n";
                }
 
                # Config file line
-               local @files = &all_config_files($l);
-               next if (!@files);
+               #local @files = &all_config_files($l);
+               #next if (!@files);
                local $lconf = &get_config($l);
                my $conf=""; my $dir="";
                if ($l =~ /awstats\.(.*)\.conf$/) { $conf=$1; }
@@ -194,15 +201,13 @@ if (@config) {
                print "</tr>\n";
        }
        
-       if ($nbofallowedconffound > 0) { print "</table>\n"; }
+       if ($nbofallowedconffound > 0) { print "</table><br>\n"; }
 }
 
 if (! $nbofallowedconffound) {
-       print "<br><p><b>$text{'index_noconfig'}</b><p><br>\n";
+       print "<br><p><b>$text{'index_noconfig'}</b></p><br>\n";
 }
 
-print "<a href='edit_config.cgi?new=1'>$text{'index_add'}</a><br>\n" if ($access{'add'});
-
 
 print "<hr>\n";
 &footer("/", $text{'index'});
index 6ed2c40d7eb126edb3bab1eb1cd05abf9eaa591d..dc41a5bd0ef86e8e9a35a979c1c05ef65dd7517b 100644 (file)
@@ -32,6 +32,7 @@ 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 (Menu $1 then clic on $2)
+index_viewall=Show a summary of all available configurations
 
 edit_title1=Add config File
 edit_title2=Edit config File
@@ -63,8 +64,8 @@ update_run=Run update process with command
 update_finished=Update process finished
 update_wait=Please wait
 
-scheduled_title=Schedule statistic's update
-scheduled_ecannot=You are not allowed to update or schedule update process
+schedule_title=Schedule statistic's update
+schedule_ecannot=You are not allowed to update or schedule update process
 
 log_create_log=Created AWStats config file $1
 log_modify_log=Modified AWStats config file $1
@@ -84,4 +85,28 @@ help_title=Help page
 help_subtitle=<b>Help for config file parameter $1</b>
 help_subtitleplugin=<b>Help for plugin $1</b>
 help_notfound=Parameter not found in your sample file $1.<br>May be your AWStats version does not support it, so no help is available.
-help_help=Help
\ No newline at end of file
+help_help=Help
+help_starrequired=required parameters with no default value. They can't be empty.
+
+viewall_title=Summary for all configurations files
+viewall_notallowed=You don't have rights to see statisitics
+viewall_allowed=This page presents a summary of all configurations files found in directories allowed to user $1
+viewall_period=Period
+viewall_u=Unique visitors
+viewall_v=Visits
+viewall_p=Pages
+viewall_h=Hits
+viewall_k=Bandwith
+
+month01=January
+month02=February
+month03=Mars
+month04=April
+month05=May
+month06=June
+month07=July
+month08=August
+month09=September
+month10=October
+month11=November
+month12=December
\ No newline at end of file
index fac7981df1d4d093a93fd74ca30d3455dee8ec0e..7dc49bd1a8f4b2371f43d967ed36f0c65afb9cd2 100644 (file)
@@ -31,6 +31,7 @@ index_hideadvanced=Cacher param
 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 (Menu $1 puis clic sur $2)
+index_viewall=Voir un résumé pour toutes les configurations disponibles
 
 edit_title1=Ajout d'un fichier de config
 edit_title2=Edition d'un fichier de config
@@ -62,8 +63,8 @@ update_run=Lancement de la mise 
 update_finished=Mise a jour terminée
 update_wait=Merci de patienter
 
-scheduled_title=Programmation de mise à jour
-scheduled_ecannot=Vous n'êtes pas autorisé à mettre à jour ou programmer une mise à jour des statistiques
+schedule_title=Programmation de mise à jour
+schedule_ecannot=Vous n'êtes pas autorisé à mettre à jour ou programmer une mise à jour des statistiques
 
 log_create_log=Fichier de config AWStats $1 créé
 log_modify_log=Fichier de config AWStats $1 modifié
@@ -83,4 +84,28 @@ help_title=Page d'aide
 help_subtitle=<b>Aide sur le paramètre de configuration $1</b>
 help_subtitleplugin=<b>Aide sur le plugin $1</b>
 help_notfound=Paramètre non trouvé dans votre fichier de configuration modèle $1.<br>Peut-être votre version d'AWStats ne le supporte pas, aussi aucune aide n'est disponible.
-help_help=Aide
\ No newline at end of file
+help_help=Aide
+help_starrequired=paramètres obligatoires sans valeurs par défaut. Ils ne peuvent etre vide.
+
+viewall_title=Résumé pour tout fichier de configuration
+viewall_notallowed=Vous n'avez pas les droits pour voir les stats
+viewall_allowed=Cette page présente un résumé de toutes les configurations trouvés dans les répertoires autorisés à l'utilisateur $1
+viewall_period=Période
+viewall_u=Visiteurs uniques
+viewall_v=Visites
+viewall_p=Pages
+viewall_h=Hits
+viewall_k=Bande passante
+
+month01=Janvier
+month02=Février
+month03=Mars
+month04=Avril
+month05=Mai
+month06=Juin
+month07=Juillet
+month08=Aout
+month09=Septembre
+month10=Octobre
+month11=Novembre
+month12=Décembre
\ No newline at end of file