Sean,

Thanks for your reply. I agree. Where do i put this code (or runmode). Does it go in the cgiapp_prerun section? Do I add it to the showLoginForm subroutine? If I do, how do I change from that routine to the next rumode?

The example I found does it via TMPL-IF statements in the template, but I do not want to put any logic into the templates.

cheers,

ski


I think that somewhere you have to process the input from the login form.
In other words, there has to be something (perhaps in the login run_mode)
that checks to see if a username and password were submitted from the login
form and then process these to see if the username and password are correct.
It is in this little piece of code that you have to set the "logged-in"
session variable.
cheers,

ski

sub cgiapp_init {
my $self = shift;
$self->session_config (
  CGI_SESSION_OPTIONS => ["driver:File", $self->query, {Directory =>
'/tmp'}],
  DEFAULT_EXPIRY => '+5m',
  COOKIE_PARAMS => {-expires => '+5m', -path => '/tmp' },
  SEND_COOKIE => 1
);
}

sub cgiapp_prerun {
my $self=shift;
unless ($self->session->param('logged-in') eq 'y') {
  $self->prerun_mode('login');
}
}

sub setup {
my $self = shift;
$self->start_mode('login');
$self->run_modes(
  'login' => 'showLoginForm',
  'student_pw' => 'showStudentPWForm'
);
$self->tmpl_path("/var/www/password/templates/");
}

# Show the first form for entering the esis id, staff acct, and staff
password
# There is no session id created yet
sub showLoginForm{
my $self = shift;
my $q = $self->query;
my $template = $self->load_tmpl('staff_form.tmpl');
my $html = $template->output;
return $html;
}

sub showStudentPWForm {
}




--
"When we try to pick out anything by itself, we find it
 connected to the entire universe"            John Muir

Chris "Ski" Kacoroski, [EMAIL PROTECTED], 425-681-0092

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to