diff --git a/acl/cgi_args.pl b/acl/cgi_args.pl index 8934f6c06..dd989b8eb 100644 --- a/acl/cgi_args.pl +++ b/acl/cgi_args.pl @@ -7,12 +7,14 @@ my ($cgi) = @_; if ($cgi eq 'edit_user.cgi') { local ($u) = grep { &can_edit_user($u->{'name'}) } &list_users(); - return $u ? 'user='.&urlize($u->{'name'}) : 'none'; + return $u ? 'user='.&urlize($u->{'name'}) : + $access{'create'} ? '' : 'none'; } elsif ($cgi eq 'edit_group.cgi') { local ($u) = grep { &can_edit_group($u->{'name'}) } &list_groups(); - return $u ? 'group='.&urlize($u->{'name'}) : 'none'; + return $u ? 'group='.&urlize($u->{'name'}) : + $access{'groups'} ? '' : 'none'; } elsif ($cgi eq 'edit_acl.cgi') { local ($u) = grep { &can_edit_user($u->{'name'}) } diff --git a/backup-config/cgi_args.pl b/backup-config/cgi_args.pl new file mode 100644 index 000000000..0d48cf24e --- /dev/null +++ b/backup-config/cgi_args.pl @@ -0,0 +1,13 @@ + +do 'backup-config-lib.pl'; + +sub cgi_args +{ +my ($cgi) = @_; +if ($cgi eq 'edit.cgi') { + my @backups = &list_backups(); + return @backups ? 'id='.&urlize($backups[0]->{'id'}) + : 'new=1'; + } +return undef; +} diff --git a/usermin/cgi_args.pl b/usermin/cgi_args.pl index bd6852184..10330cb79 100644 --- a/usermin/cgi_args.pl +++ b/usermin/cgi_args.pl @@ -4,7 +4,7 @@ do 'usermin-lib.pl'; sub cgi_args { my ($cgi) = @_; -if ($cgi =~ /^edit_/) { +if ($cgi =~ /^edit_/ || $cgi eq 'index.cgi') { # No args needed for sure return ''; } diff --git a/webmin/cgi_args.pl b/webmin/cgi_args.pl index abfd87abb..c470aade1 100644 --- a/webmin/cgi_args.pl +++ b/webmin/cgi_args.pl @@ -4,7 +4,7 @@ do 'webmin-lib.pl'; sub cgi_args { my ($cgi) = @_; -if ($cgi =~ /^edit_/) { +if ($cgi =~ /^edit_/ || $cgi eq 'index.cgi') { # No args needed for sure return ''; } diff --git a/webmin_search.cgi b/webmin_search.cgi index 0e42349e7..7e1b2d505 100644 --- a/webmin_search.cgi +++ b/webmin_search.cgi @@ -346,10 +346,11 @@ if (-r "$mroot/cgi_args.pl") { return $args; } } -# Guess if any are needed if ($cgi eq "index.cgi") { + # Index page is always safe to link to return undef; } +# Otherwise check if it appears to parse any args local $data = &read_file_contents($mroot."/".$cgi); if ($data =~ /ReadParse\(/) { return "none";