--- smeserver-awstats-1.2/root/etc/e-smith/web/functions/awstats.note 2007-04-06 14:59:44.000000000 +1000 +++ smeserver-awstats-1.2/root/etc/e-smith/web/functions/awstats 2008-09-20 12:48:10.000000000 +1000 @@ -173,43 +173,43 @@ print $q->hr; } - # find domains that this user can edit, store in @mydom - my $acctName = $ENV{'REMOTE_USER'}; + # find domains that this user can edit, store in @mydom + my $acctName = $ENV{'REMOTE_USER'}; my $owner = ''; - - my @mydom = (); - my @alldom = (); - - if ($acctName ne 'admin') - { - #A. user must be set as owner - #1. include all virtual domains + primary - foreach (keys %domains) - { - push (@alldom, $_) - if (db_get_type(\%domains, $_) eq "domain"); - } - - #2. only retain this users domains - foreach my $vd (@alldom) - { - if ($vd eq db_get(\%conf, 'DomainName')) - { - $owner = db_get_prop(\%conf, "AWStats", "owner") || 'admin'; - } - else - { - $owner = db_get_prop(\%domains, $vd, "owner") || 'admin'; - } - + + my @mydom = (); + my @alldom = (); + + if ($acctName ne 'admin') + { + #A. user must be set as owner + #1. include all virtual domains + primary + foreach (keys %domains) + { + push (@alldom, $_) + if (db_get_type(\%domains, $_) eq "domain"); + } + + #2. only retain this users domains + foreach my $vd (@alldom) + { + if ($vd eq db_get(\%conf, 'DomainName')) + { + $owner = db_get_prop(\%conf, "AWStats", "owner") || 'admin'; + } + else + { + $owner = db_get_prop(\%domains, $vd, "owner") || 'admin'; + } + #is owner a group ? my $userlist = db_get_prop(\%accounts, $owner, 'Members') || 'notgroup'; if ($userlist eq 'notgroup') { #then is it a user or everyone ? - if (($owner eq $acctName) || ($owner eq 'everyone')) - { - push (@mydom, $vd); + if (($owner eq $acctName) || ($owner eq 'everyone')) + { + push (@mydom, $vd); } } else @@ -218,24 +218,24 @@ my @selected = split (/,/, $userlist); foreach my $grpmem (@selected) { - if ($grpmem eq $acctName) - { - push (@mydom, $vd); + if ($grpmem eq $acctName) + { + push (@mydom, $vd); } } } - } - } - else + } + } + else { - #B. admin gets all domains - foreach (keys %domains) - { - push (@mydom, $_) - if (db_get_type(\%domains, $_) eq "domain"); - } - } - + #B. admin gets all domains + foreach (keys %domains) + { + push (@mydom, $_) + if (db_get_type(\%domains, $_) eq "domain"); + } + } + print $q->startform (-method => 'POST', -action => $q->url (-absolute => 1)); @@ -262,7 +262,9 @@ print $q->h4 ("List of Domains viewable by $acctName"); - print "Note: A Domain is not shown until statistics are available.
"; + print "Note: A Domain is not shown in the list below until after midnight on the day
". + "statistics are available. To force the display sooner, browse to the website to
". + "create some stats, then resave awstats settings.
"; print "";