# mod_setenvif.pl # Defines editors for directives to set environment variables sub mod_setenvif_directives { local($rv); $rv = [ [ 'BrowserMatch BrowserMatchNoCase', 1, 11, 'global', '-1.313' ], [ 'BrowserMatch BrowserMatchNoCase', 1, 11, 'virtual directory htaccess', 1.313 ], [ 'SetEnvIf SetEnvIfNoCase', 1, 11, 'global', '1.3-1.313' ], [ 'SetEnvIf SetEnvIfNoCase', 1, 11, 'virtual directory htaccess', 1.313 ] ]; return &make_directives($rv, $_[0], "mod_setenvif"); } require 'browsermatch.pl'; sub edit_SetEnvIf_SetEnvIfNoCase { local($d, @w, $i, @head, @regex, @var, @val, @case, $rv); foreach $d (@{$_[0]}, @{$_[1]}) { @w = @{$d->{'words'}}; for($i=2; $i<@w; $i++) { push(@head, $w[0]); push(@regex, $w[1]); if ($w[$i] =~ /^\!(\S+)$/) { push(@var, $1); push(@val, undef); } elsif ($w[$i] =~ /^(\S+)=(\S*)$/) { push(@var, $1); push(@val, $2); } else { push(@var, $w[$i]); push(@val, 1); } if ($d->{'name'} eq "SetEnvIf") { push(@case, 1); } else { push(@case, 0); } } } push(@head, ""); push(@regex, ""); push(@var, ""); push(@val, ""); push(@case, 0); $rv = "
| $text{'mod_setenvif_header'} | $text{'mod_setenvif_match'} | \n". "$text{'mod_setenvif_case'} | $text{'mod_setenvif_var'} | \n". "$text{'mod_setenvif_value'} |
| \n", $head[$i]; $rv .= sprintf " | \n", $regex[$i]; $rv .= " | ".&choice_input($case[$i], "SetEnvIf_case_$i", 1, "$text{'yes'},1", "$text{'no'},0")." | \n"; $rv .= sprintf "\n", $var[$i]; $rv .= " | ".&opt_input($val[$i], "SetEnvIf_val_$i", "$text{'mod_setenvif_clear'}", 10)." | \n"; $rv .= "