werc-1.5.0-tweaks

Tweaks for the werc website builder created by the mad architect Uriel
Log | Files | Refs | README

error (815B)


      1 #!/bin/rc
      2 # DO NOT make this script callable directly from the web!
      3 fn do_error{
      4 	echo 'HTTP/1.1 '^$1^$cr
      5 	emit_extra_headers
      6 	echo 'Content-type: text/html'^$cr
      7 	echo $cr
      8 	echo '<html>
      9 <head>
     10 <title>'^$1^'</title>
     11 </head>
     12 <body>
     13 <h1>'^$1^'</h1>'
     14 	echo $2
     15 	echo '<p><i>rc-httpd at' $SERVER_NAME '</i>'
     16 	echo '
     17 	</body>
     18 	</html>
     19 	'
     20 }
     21 
     22 fn 401{
     23 	do_error '401 Unauthorized' \
     24 	'The requested path '^$"location^' requires authorization.'
     25 }
     26 
     27 fn 404{
     28 	do_error '404 Not Found' \
     29 	'The requested path '^$"location^' was not found on this server.'
     30 }
     31 
     32 fn 500{
     33 	do_error '500 Internal Server Error' \
     34 	'The server has encountered an internal misconfiguration and is unable to satisfy your request.'
     35 }
     36 
     37 fn 503{
     38 	do_error '503 Forbidden' \
     39 	'You do not have permission to access '^$"location^' on this server.'
     40 }
     41 
     42 do_log $1
     43 $1