2 # Defines editors for the per-child UID module in apache 2.0
3 # The actual functions for most of these are still in core.pl
5 sub perchild_directives
8 $rv = [ [ 'AssignUserId', 0, 8, 'virtual virtualonly', 2.0 ],
9 [ 'ChildPerUserId', 1, 8, 'global', 2.0 ],
10 [ 'CoreDumpDirectory', 0, 9, 'global', 2.0 ],
11 [ 'BindAddress Listen Port', 1, 1, 'global', 2.0, 10 ],
12 [ 'ListenBacklog', 0, 1, 'global', 2.0 ],
13 [ 'LockFile', 0, 9, 'global', 2.0 ],
14 [ 'MaxRequestsPerChild', 0, 0, 'global', 2.0 ],
15 [ 'MinSpareThreads', 0, 0, 'global', 2.0 ],
16 [ 'MaxSpareThreads', 0, 0, 'global', 2.0 ],
17 [ 'MaxThreadsPerChild', 0, 0, 'global', 2.0 ],
18 [ 'NumServers', 0, 0, 'global', 2.0 ],
19 [ 'PidFile', 0, 9, 'global', 2.0 ],
20 [ 'ScoreBoardFile', 0, 9, 'global', 2.0 ],
21 [ 'SendBufferSize', 0, 1, 'global', 2.0 ],
22 [ 'StartThreads', 0, 0, 'global', 2.0 ],
23 [ 'Group', 0, 8, 'global', 2.0, 9 ],
24 [ 'User', 0, 8, 'global', 2.0, 10 ] ];
25 return &make_directives($rv, $_[0], "perchild");
31 $rv .= sprintf "<input type=radio name=AssignUserId_def value=1 %s> %s\n",
32 $_[0] ? "" : "checked", $text{'core_none'};
33 $rv .= sprintf "<input type=radio name=AssignUserId_def value=0 %s>\n",
34 $_[0] ? "checked" : "";
35 $rv .= &text('perchild_assignug',
36 "<input name=AssignUserId_uid size=8 value='$_[0]->{'words'}->[0]'>",
37 "<input name=AssignUserId_gid size=8 value='$_[0]->{'words'}->[1]'>");
38 return (2, $text{'perchild_assign'}, $rv);
42 if ($in{'AssignUserId_def'}) {
46 $in{'AssignUserId_uid'} =~ /^-?\d+$/ || &error($text{'perchild_euid'});
47 $in{'AssignUserId_gid'} =~ /^-?\d+$/ || &error($text{'perchild_egid'});
48 return ( [ "$in{'AssignUserId_uid'} $in{'AssignUserId_gid'}" ] );
52 sub edit_ChildPerUserId
54 local $rv = "<table border>\n".
55 "<tr $tb> <td><b>$text{'perchild_num'}</b></td>\n".
56 "<td><b>$text{'perchild_uid'}</b></td>\n".
57 "<td><b>$text{'perchild_gid'}</b></td> </tr>\n";
59 foreach $c (@{$_[0]}, undef) {
60 local @v = $c ? @{$c->{'words'}} : ();
62 $rv .= "<td><input name=ChildPerUserId_n_$i size=5 value='$v[2]'></td>\n";
63 $rv .= "<td><input name=ChildPerUserId_u_$i size=8 value='$v[0]'></td>\n";
64 $rv .= "<td><input name=ChildPerUserId_g_$i size=8 value='$v[1]'></td>\n";
69 return (2, $text{'perchild_child'}, $rv);
71 sub save_ChildPerUserId
74 for($i=0; defined($in{"ChildPerUserId_n_$i"}); $i++) {
75 next if (!$in{"ChildPerUserId_n_$i"});
76 $in{"ChildPerUserId_n_$i"} =~ /^[1-9]\d*$/ ||
77 &error($text{'perchild_enum'});
78 $in{"ChildPerUserId_u_$i"} =~ /^-?\d+$/ ||
79 &error($text{'perchild_euid'});
80 $in{"ChildPerUserId_g_$i"} =~ /^-?\d+$/ ||
81 &error($text{'perchild_egid'});
82 push(@rv, $in{"ChildPerUserId_u_$i"}." ".$in{"ChildPerUserId_g_$i"}." ".
83 $in{"ChildPerUserId_n_$i"});
88 sub edit_MinSpareThreads
91 $text{'worker_minspare'},
92 &opt_input($_[0]->{'value'},"MinSpareThreads",$text{'default'}, 4));
94 sub save_MinSpareThreads
96 return &parse_opt("MinSpareThreads", '^\d+$',
97 $text{'worker_eminspare'});
100 sub edit_MaxSpareThreads
103 $text{'worker_maxspare'},
104 &opt_input($_[0]->{'value'},"MaxSpareThreads",$text{'default'}, 4));
106 sub save_MaxSpareThreads
108 return &parse_opt("MaxSpareThreads", '^\d+$',
109 $text{'worker_emaxspare'});
112 sub edit_StartThreads
115 $text{'perchild_sthreads'},
116 &opt_input($_[0]->{'value'},"StartThreads",$text{'default'}, 4));
118 sub save_StartThreads
120 return &parse_opt("StartThreads", '^\d+$',
121 $text{'perchild_esthreads'});
127 $text{'perchild_numservers'},
128 &opt_input($_[0]->{'value'},"NumServers",$text{'default'}, 4));
132 return &parse_opt("NumServers", '^\d+$',
133 $text{'perchild_enumservers'});
136 sub edit_MaxThreadsPerChild
139 $text{'perchild_maxthreads'},
140 &opt_input($_[0]->{'value'},"MaxThreadsPerChild",$text{'default'}, 4));
142 sub save_MaxThreadsPerChild
144 return &parse_opt("MaxThreadsPerChild", '^\d+$',
145 $text{'perchild_emaxthreads'});