7 if ($cgi eq 'edit_log.cgi' && $access{'syslog'}) {
8 # Link to editor for first log
9 my $conf = &get_config();
10 my @logs = grep { !$_->{'tag'} && &can_edit_log($_) } @$conf;
11 return @logs ? 'idx='.$logs[0]->{'index'} :
12 $access{'noedit'} ? 'none' : 'new=1';
14 elsif ($cgi eq 'save_log.cgi') {
15 if ($access{'syslog'}) {
16 # View first system log
17 my $conf = &get_config();
18 my @logs = grep { !$_->{'tag'} && &can_edit_log($_) &&
19 $_->{'file'} && -f $_->{'file'} } @$conf;
21 return 'view=1&idx='.$logs[0]->{'index'};
24 # View first individual log
25 my @extras = grep { &can_edit_log($_) } &extra_log_files();
26 return @extras ? 'view=1&extra='.&urlize($extras[0]->{'file'})