Name: Anonymous 2007-08-20 2:21 ID:dTJ61zl0
BEST ID CONTEST GO!
'---idle mode
'--- do this instead of exiting the program
'--- it will normally just serve a page indicating it is dead
enum idleReason
initProblems '-problems during initialization
logUnwritable, badConfiguration
runtimeProblems=256 '-problems during normal operation
manualLockdown
end enum
sub idle(reason as integer)
dim result as integer, problem as eib
'-log that we are going idle, if we can
problem=mkeib(errorCode.enteringIdleState,"","",reason,0)
result=report(reportAction.newMessage,problem)
if result=-2 then
'-action to take if log file is unwritable
'-haven't decided what this is
end if
do while (FCGI_Accept() >= 0)
print "Context-type: text/html"+newline
print "<html> <head><title>Halted</title></head>"
print " <body>"
print " <h1>Halted</h1>"
print " <p>The program serving your request has ";
if reason=idleReason.manualLockdown then
print "been halted by the administrator. It's not related to you or anything you did.</p>"
print " <p>";
goto idleSkipPoint
end if
if reason>runtimeProblems then
print "encountered a really bad problem. It's halted, since it might go haywire and hurt something.";
else
print "not been able to start up properly.";
end if
print " </p>"
print " <p>Because of this, nothing more can happen until the administrator fixes the problem. This problem is a backend issue and is not related to you o
r anything you did.</p>"
print " <p>This is hopefully temporary and should be fixed shortly. ";
idleSkipPoint:
print "We apologize for any inconvenience. Please come back later.</p>"
print " <hr /> <center><p><i>This message was generated on ";date$;" ";time$;".</i></p></center>"
print " </body>"
print "</html>"
loop
end reason
end sub