Handle hostnames with upper-case letters
[webmin.git] / apache / mod_log_agent.pl
1 # mod_log_agent.pl
2 # Defines editors for logging user agents
3
4 sub mod_log_agent_directives
5 {
6 $rv = [ [ 'AgentLog', 0, 3, 'virtual' ] ];
7 return &make_directives($rv, $_[0], "mod_log_agent");
8 }
9
10 sub edit_AgentLog
11 {
12 local($rv);
13 $rv = sprintf "<input type=radio name=AgentLog_mode value=0 %s> $text{'mod_log_agent_default'}\n",
14        $_[0] ? "" : "checked";
15 $rv .= sprintf "<input type=radio name=AgentLog_mode value=1 %s> $text{'mod_log_agent_file'}",
16          $_[0] && $_[0]->{'value'} !~ /^\|/ ? "checked" : "";
17 $rv .= sprintf "<input type=radio name=AgentLog_mode value=2 %s> $text{'mod_log_agent_program'}",
18          $_[0]->{'value'} =~ /^\|/ ? "checked" : "";
19 $rv .= sprintf "<input name=AgentLog size=20 value=\"%s\">\n",
20         $_[0]->{'value'} =~ /^\|(.*)$/ ? $1 : $_[0]->{'value'};
21 return (1, "$text{'mod_log_agent_log'}", $rv); 
22 }
23 sub save_AgentLog
24 {
25 if ($in{'AgentLog_mode'} == 0) { return ( [ ] ); }
26 $in{'AgentLog'} =~ /^\S+$/ ||
27         &error(&text('mod_log_agent_efile', $in{'AgentLog'}));
28 if ($in{'AgentLog_mode'} == 1) { return ( [ $in{'AgentLog'} ] ); }
29 else { return ( [ "|$in{'AgentLog'}" ] ); }
30 }
31
32 1;
33