-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.cgi
More file actions
executable file
·33 lines (26 loc) · 1 KB
/
index.cgi
File metadata and controls
executable file
·33 lines (26 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/perl -wT
use strict;
use lib qw(/var/www/webperl);
use lib qw(modules);
use utf8;
# System modules
use CGI::Carp qw(fatalsToBrowser set_message); # Catch as many fatals as possible and send them to the user as well as stderr
# Webperl modules
use AppUser::Cohort;
use Application;
my $contact = 'moodlesupport@cs.man.ac.uk'; # global contact address, for error messages
# install more useful error handling
BEGIN {
$ENV{"PATH"} = ""; # Force no path.
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; # Clean up ENV
sub handle_errors {
my $msg = shift;
print "<h1>Software error</h1>\n";
print '<p>Server time: ',scalar(localtime()),'<br/>Error was:</p><pre>',$msg,'</pre>';
print '<p>Please report this error to ',$contact,' giving the text of this error and the time and date at which it occured</p>';
}
set_message(\&handle_errors);
}
my $app = Application -> new(appuser => AppUser::Cohort -> new())
or die "Unable to create application";
$app -> run();