293
301
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)
295
306
req.write("""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
296
307
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
297
308
<html xmlns="http://www.w3.org/1999/xhtml">
298
309
<head><title>IVLE Internal Server Error</title></head>
300
311
<h1>IVLE Internal Server Error""")
301
if (codename is not None
302
and httpcode != apache.HTTP_INTERNAL_SERVER_ERROR):
303
req.write(": %s" % cgi.escape(codename))
313
if (codename is not None
314
and httpcode != apache.HTTP_INTERNAL_SERVER_ERROR):
315
req.write(": %s" % cgi.escape(codename))
304
317
req.write("""</h1>
305
318
<p>An error has occured which is the fault of the IVLE developers or
319
administration. The developers have been notified.</p>
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)))
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)))
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))
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))
321
335
req.write("</body></html>")