301
293
logging.error('%s\n%s'%(str(msg), tb))
302
# Error messages are only displayed is the user is NOT a student,
303
# or if there has been a problem logging the error message
304
show_errors = (not publicmode) and (not login or \
305
(not str(role) == "student") or logfail)
306
295
req.write("""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
307
296
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
308
297
<html xmlns="http://www.w3.org/1999/xhtml">
309
298
<head><title>IVLE Internal Server Error</title></head>
311
300
<h1>IVLE Internal Server Error""")
313
if (codename is not None
314
and httpcode != apache.HTTP_INTERNAL_SERVER_ERROR):
315
req.write(": %s" % cgi.escape(codename))
301
if (codename is not None
302
and httpcode != apache.HTTP_INTERNAL_SERVER_ERROR):
303
req.write(": %s" % cgi.escape(codename))
317
304
req.write("""</h1>
318
305
<p>An error has occured which is the fault of the IVLE developers or
319
administration. The developers have been notified.</p>
323
req.write("<p>%s</p>\n" % cgi.escape(msg))
324
if httpcode is not None:
325
req.write("<p>(HTTP error code %d)</p>\n" % httpcode)
327
<p>Please report this to <a href="mailto:%s">%s</a> (the system
328
administrator). Include the following information:</p>
329
""" % (cgi.escape(admin_email), cgi.escape(admin_email)))
309
req.write("<p>%s</p>\n" % cgi.escape(msg))
310
if httpcode is not None:
311
req.write("<p>(HTTP error code %d)</p>\n" % httpcode)
313
<p>Please report this to <a href="mailto:%s">%s</a> (the system
314
administrator). Include the following information:</p>
315
""" % (cgi.escape(admin_email), cgi.escape(admin_email)))
331
req.write("<pre>\n%s\n</pre>\n"%cgi.escape(tb))
333
req.write("<p>Warning: Could not open Error Log: '%s'</p>\n"
334
%cgi.escape(logfile))
317
req.write("<pre>\n%s\n</pre>\n"%cgi.escape(tb))
319
req.write("<p>Warning: Could not open Error Log: '%s'</p>\n"
320
%cgi.escape(logfile))
335
321
req.write("</body></html>")