added runOnLogin and runOnLogout functionality.

This commit is contained in:
Frank Dillon 2006-07-19 16:23:19 +00:00
parent 75b03b006e
commit 58f1b9c4aa

View file

@ -578,6 +578,15 @@ sub login {
$self->session->http->setRedirect($self->session->scratch->get("redirectAfterLogin"));
$self->session->scratch->delete("redirectAfterLogin");
}
my $command = $self->session->config->get("runOnLogin");
if ($command ne "") {
WebGUI::Macro::process($self->session,\$command);
$self->session->errorHandler->warn("Executing $command");
my $error = qx($command);
$self->session->errorHandler->warn($error) if $error;
}
return "";
}
@ -595,6 +604,15 @@ sub logout {
$self->session->user({userId=>'1'});
my $u = WebGUI::User->new($self->session,1);
$self->{user} = $u;
my $command = $self->session->config->get("runOnLogout");
if ($command ne "") {
WebGUI::Macro::process($self->session,\$command);
$self->session->errorHandler->warn("Executing $command");
my $error = qx($command);
$self->session->errorHandler->warn($error) if $error;
}
return "";
}