#!/usr/bin/perl
#
# $Id: login.pl,v 1.16 2006/10/19 17:35:29 psims Exp $
#
# Source File: login.pl
# Get config
require 'sitecfg.pl';
require 'testlib.pl';
&traceoutput("login.pl"); # TRACE IF ACTIVE
&app_initialize;
$SESSION{'temptime'} = time();
$SESSION{'clid'} = $FORM{'clid'};
$SESSION{'lang'} = $FORM{'lang'};
&get_client_configuration();
&traceoutput("login.pl:$FORM{'clid'}:$FORM{'uid'}:$FORM{'pwd'}"); # TRACE IF ACTIVE
&setbrowsertype();
## DED Patch for secure_html/tests dir permission problem 2006/10/11
if (! -x $testroot) {
print STDERR "PERMS: $testroot is not X\n";
chmod(0777, $testroot);
}
if ($FORM{'selfregister'} eq "Y") {
&get_client_profile($SESSION{'clid'});
$CANDIDATE{'new'}="Y";
print "Content-Type: text/html\n\n";
&show_template("regsas");
} elsif (&verifyaccess) {
&init_session;
&LanguageSupportInit();
&log_entry($SESSION{'clid'}, $SESSION{'uid'}, "1");
$FORM{'notice'} = $SYSTEM{'message'};
### For redirect to regcnd & regsas
$vars{'tid'} = $SESSION{'tid'};
$vars{'lang'} = $SESSION{'lang'};
$vars{'badid'} = $FORM{'badid'} unless !(defined($FORM{'badid'})); #This is used if badid is passed from regsas for autorefresh location trick
$vars{'direction'} = $FORM{'direction'} unless !(defined($FORM{'direction'}));
if ($SESSION{'taclid'} ne '') {
print "Content-Type: text/html\n\n";
&get_client_profile($SESSION{'clid'});
my $opts = { restrict_to_availability_window => 1 };
&set_session($SESSION{'tid'},'taclauthtests',$SESSION{'taclauthtests'});
&set_session($SESSION{'tid'},'uid',$SESSION{'taclid'});
if ($FORM{'pwd'} eq '_____') {
&get_tacl_profile("regauto");
®dusr("regauto");
} else {
&get_tacl_profile();
®dusr("regtacl");
}
} elsif ($FORM{'sas'} ne '') {
## ^ support for wilcard login
# register an account to the candidate
&get_client_profile($SESSION{'clid'});
my $opts = { restrict_to_availability_window => 1 };
&get_candidate_profile($SESSION{'clid'}, $SESSION{'uid'}, $opts);
#®dusr("regsas");
&redirect("regsas", \%vars);
} else {
if ($FORM{'sadm'} ne '') {
print "Content-Type: text/html\n\n";
if ($SESSION{'uac'} eq 'gadmin') {
# Site administration
$CLIENT{'active'} = "X";
$CLIENT{'logo'} = "\n";
$CLIENT{'clorg'} = "ACTS Corporation";
®dusr("frsadmin");
} elsif ($SESSION{'uac'} =~ /txlatr./ ) {
($FORM{'uac'},$FORM{'lang'}) = split(/\./, $SESSION{'uac'});
$CLIENT{'active'} = "X";
$CLIENT{'logo'} = "
\n";
$CLIENT{'clorg'} = "ACTS Corporation";
print "\n";
print "