Changeset 495 for branches/htmlform/cgi-bin/main.cgi
- Timestamp:
- 09/23/10 22:44:04 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/htmlform/cgi-bin/main.cgi
r493 r495 87 87 } 88 88 89 my $page = HTML::Template->new(filename => "$webvar{action}.tmpl"); 89 my $page; 90 if (-e "$ENV{HTML_TEMPLATE_ROOT}/admin/$webvar{action}.tmpl") { 91 $page = HTML::Template->new(filename => "$webvar{action}.tmpl"); 92 } else { 93 $page = HTML::Template->new(filename => "dunno.tmpl"); 94 } 90 95 91 96 if($webvar{action} eq 'index') { … … 164 169 } 165 170 166 # Default is an error. It shouldn't be possible to easily get here. 167 # The only way I can think of offhand is to just call main.cgi bare- 168 # which is not in any way guaranteed to provide anything useful. 171 # Default is an error. It shouldn't be possible to get here unless you're 172 # randomly feeding in values for webvar{action}. 169 173 else { 170 174 my $rnd = rand 500; 171 175 my $boing = sprintf("%.2f", rand 500); 172 my @excuses = ("Aether cloudy. Ask again later.","The gods are unhappy with your sacrifice.", 173 "Because one of it's legs are both the same", "*wibble*", 174 "Hey! Stop pushing my buttons!", "I ain't done nuttin'", "9", 175 "8", "9", "10", "11", "12", "13", "14", "15", "16", "17"); 176 printAndExit("Error $boing: ".$excuses[$rnd/30.0]); 176 my @excuses = ( 177 "Aether cloudy. Ask again later about $webvar{action}.", 178 "The gods are unhappy with your sacrificial $webvar{action}.", 179 "Because one of $webvar{action}'s legs are both the same", 180 "<b>wibble</b><br>Can't $webvar{action}, the grue will get me!<br>Can't $webvar{action}, the grue will get me!", 181 "Hey, man, you've had your free $webvar{action}. Next one's gonna... <i>cost</i>....", 182 "I ain't done $webvar{action}", 183 "Oooo, look! A flying $webvar{action}!", 184 "$webvar{action} too evil, avoiding.", 185 "Rocks fall, $webvar{action} dies.", 186 "Bit bucket must be emptied before I can $webvar{action}..." 187 ); 188 $page->param(dunno => $excuses[$rnd/50.0]); 177 189 } 178 190 ## Finally! Done with that NASTY "case" emulation!
Note:
See TracChangeset
for help on using the changeset viewer.