2 # Functions used by both mod_proxy.pl and the new apache caching modules
6 return (1, $text{'mod_proxy_dir'},
7 &opt_input($_[0]->{'value'}, "CacheRoot", $text{'mod_proxy_none'}, 20).
8 &file_chooser_button("CacheRoot", 0));
12 $in{'CacheRoot_def'} || &allowed_auth_file($in{'CacheRoot'}) ||
13 &error($text{'mod_proxy_eunder'});
14 return &parse_opt("CacheRoot", '^\S+$', $text{'mod_proxy_edir'});
19 return (1, $text{'mod_proxy_size'},
20 &opt_input($_[0]->{'value'}, "CacheSize", $text{'mod_proxy_default'}, 8)." kB");
24 return &parse_opt("CacheSize", '^\d+$', $text{'mod_proxy_esize'});
27 sub edit_CacheGcInterval
29 return (1, $text{'mod_proxy_garbage'},
30 &opt_input($_[0]->{'value'}, "CacheGcInterval", $text{'mod_proxy_nogc'}, 6).
31 $text{'mod_proxy_hours'});
33 sub save_CacheGcInterval
35 return &parse_opt("CacheGcInterval", '^\d+$',
36 $text{'mod_proxy_egarbage'});
39 sub edit_CacheMaxExpire
41 return (1, $text{'mod_proxy_maxexp'},
42 &opt_input($_[0]->{'value'}, "CacheMaxExpire", $text{'mod_proxy_default'}, 6).
43 $text{'mod_proxy_seconds'});
45 sub save_CacheMaxExpire
47 return &parse_opt("CacheMaxExpire", '^\d+$',
48 $text{'mod_proxy_emaxexp'});
51 sub edit_CacheLastModifiedFactor
53 return (1, $text{'mod_proxy_expfac'},
54 &opt_input($_[0]->{'value'}, "CacheLastModifiedFactor", $text{'mod_proxy_default'}, 6));
56 sub save_CacheLastModifiedFactor
58 return &parse_opt("CacheLastModifiedFactor", '^\d+$',
59 $text{'mod_proxy_eexpfac'});
62 sub edit_CacheDirLevels
64 return (1, $text{'mod_proxy_levels'},
65 &opt_input($_[0]->{'value'}, "CacheDirLevels", $text{'mod_proxy_default'}, 6));
67 sub save_CacheDirLevels
69 return &parse_opt("CacheDirLevels", '^\d+$',
70 $text{'mod_proxy_elevels'});
73 sub edit_CacheDirLength
75 return (1, $text{'mod_proxy_length'},
76 &opt_input($_[0]->{'value'}, "CacheDirLength", $text{'mod_proxy_default'}, 4));
78 sub save_CacheDirLength
80 return &parse_opt("CacheDirLength", '^\d+$',
81 $text{'mod_proxy_elength'});
84 sub edit_CacheDefaultExpire
86 return (1, $text{'mod_proxy_defexp'},
87 &opt_input($_[0]->{'value'}, "CacheDefaultExpire", $text{'mod_proxy_default'}, 6).
88 $text{'mod_proxy_seconds'});
90 sub save_CacheDefaultExpire
92 return &parse_opt("CacheDefaultExpire", '^\d+$', $text{'mod_proxy_edefexp'});
95 sub edit_CacheForceCompletion
97 return (1, $text{'mod_proxy_finish'},
98 &opt_input($_[0]->{'value'}, "CacheForceCompletion", $text{'mod_proxy_default'}, 6)."%");
100 sub save_CacheForceCompletion
102 return &parse_opt("CacheForceCompletion", '^\d+$',
103 $text{'mod_proxy_efinish'});
109 foreach $n (@{$_[0]}) { push(@n, $n->{'value'}); }
110 return (1, $text{'mod_proxy_nocache'},
111 &opt_input(@n ? join(' ', @n) : undef, "NoCache", $text{'mod_proxy_none2'}, 20));
115 return &parse_opt("NoCache", '\S', $text{'mod_proxy_enocache'});