#!/usr/bin/perl # Copyright 1999-2003 Fred Steinberg, Brown Bear Software BEGIN {$Defines::calendar_root = 'CalciumDir38'} use lib $Defines::calendar_root; use lib "$Defines::calendar_root/upgrades"; # Everything starts from here. use strict; use CGI::Carp ('fatalsToBrowser'); use 5.004; use CGI 2.42; use Calendar::User; use Calendar::Audit; use Calendar::GetHTML; use Operation::OperationFactory; $|++; # Parse the CGI params into a hash my %params; my $cgi = new CGI; foreach my $name ($cgi->param) { $params{$name} = $cgi->param($name); # watch out! no multi-valued params! } # Check pathinfo for calendar name my $pathinfo = $cgi->path_info; if ($pathinfo and !defined $params{CalendarName}) { # fixed for borken servers; some give entire url $pathinfo =~ s{^.*/(.)}{$1}; # delete up to last slash with something # after it $pathinfo =~ s{/$}{}; # and delete slash if at end of line, so e.g. # .../cgi-bin/calcium/Default/ will work $params{CalendarName} = $pathinfo unless ($pathinfo =~ /\W/); } $params{Op} ||= ($params{'CalendarName'} ? 'ShowIt' : 'Splash'); my $operation = $params{Op}; # If we're testing a cookie, see if it worked if ($params{TestCookie}) { my $ok = $cgi->cookie ('-name' => $params{TestCookie}); if (!defined ($ok)) { warn "Couldn't set cookie: $params{TestCookie}\n"; my $i18n = I18N->new (Preferences->new (MasterDB->new)->Language); my $string = $i18n->get ('Calcium_CookieFailed'); if ($string eq 'Calcium_CookieFailed') { $string =<< " FNORD";
Go to the login screen, " .
"the Calcium home page, or ";
} else {
$message = $i18n->get ('Calcium_NoPermission');
$message .= "
" . $i18n->get ('Login') . ' ' .
"
" . $i18n->get ('Calcium home page') .
'';
}
GetHTML->errorPage ($i18n,
header => $i18n->get ('Permission Denied'),
message => $message);
}