Fix a bug where Show Message on Login didn't work with anonymous

registration for WebGUI auth.  Added POD to the Auth createAccountSave
method to detail that what it returns is important.
This commit is contained in:
Colin Kuskie 2008-09-05 01:38:22 +00:00
parent 58c81ede6d
commit 3e318493c9
3 changed files with 25 additions and 24 deletions

View file

@ -21,6 +21,7 @@
- added: Page range (start-finish) to available paginator text
- rfe: view profile
- fixed: Show Message On Login continue link
- fixed: Show Message On Login doesn't show after anon registration
7.5.22
- fixed: Layout template now gets prepared correctly

View file

@ -240,7 +240,9 @@ sub createAccount {
=head2 createAccountSave ( username,properties [,password,profile] )
Superclass method that performs general functionality for saving new accounts.
Superclass method that performs general functionality for saving new accounts. Based
on various settings and user actions, it may return output that should be displayed
to the user.
=head3 username
@ -290,8 +292,10 @@ sub createAccountSave {
status => 'completed',
});
}
$self->session->user({user=>$u});
$self->_logLogin($userId,"success");
if ($self->session->setting->get("runOnRegistration")) {
WebGUI::Workflow::Instance->create($self->session, {
workflowId=>$self->session->setting->get("runOnRegistration"),
@ -301,24 +305,6 @@ sub createAccountSave {
priority=>1
})->start;
}
# If we have something to do after login, do it
if ( $self->session->setting->get( 'showMessageOnLogin' ) ) {
return $self->showMessageOnLogin;
}
elsif ($self->session->form->get('returnUrl')) {
$self->session->http->setRedirect( $self->session->form->get('returnUrl') );
$self->session->scratch->delete("redirectAfterLogin");
}
elsif ($self->session->scratch->get("redirectAfterLogin")) {
my $url = $self->session->scratch->delete("redirectAfterLogin");
$self->session->http->setRedirect($url);
return undef;
}
else {
$self->session->http->setStatus(201,"Account Registration Successful");
}
##Finalize the record in the user invitation table.
my $inviteId = $self->session->form->get('uniqueUserInvitationCode');
@ -333,7 +319,24 @@ sub createAccountSave {
},
);
}
# If we have something to do after login, do it
if ( $self->session->setting->get( 'showMessageOnLogin' ) ) {
return $self->showMessageOnLogin;
}
elsif ($self->session->form->get('returnUrl')) {
$self->session->http->setRedirect( $self->session->form->get('returnUrl') );
$self->session->scratch->delete("redirectAfterLogin");
}
elsif ($self->session->scratch->get("redirectAfterLogin")) {
my $url = $self->session->scratch->delete("redirectAfterLogin");
$self->session->http->setRedirect($url);
return undef;
}
else {
$self->session->http->setStatus(201,"Account Registration Successful");
}
return undef;
}
@ -898,8 +901,6 @@ sub showMessageOnLogin {
|| $self->session->url->getSiteURL . $self->session->url->gateway()
;
$self->session->log->warn('getSiteURL='.$self->session->url->getSiteURL);
$self->session->log->warn('scratch='.$self->session->scratch->get( 'redirectAfterLogin' ));
$output .= '<p><a href="' . $redirectUrl . '">' . $i18n->get( 'showMessageOnLogin return' )
. '</a></p>'
;

View file

@ -226,7 +226,6 @@ sub createAccountSave {
$properties->{ passwordLastUpdated } = $session->datetime->time();
$properties->{ passwordTimeout } = $setting->get("webguiPasswordTimeout");
$properties->{ status } = 'Deactivated' if ($setting->get("webguiValidateEmail"));
$self->SUPER::createAccountSave($username,$properties,$password,$profile);
# Send validation e-mail if required
if ($setting->get("webguiValidateEmail")) {
@ -251,7 +250,7 @@ sub createAccountSave {
$self->logout;
return $self->displayLogin($i18n->get('check email for validation','AuthWebGUI'));
}
return undef;
return $self->SUPER::createAccountSave($username,$properties,$password,$profile);
}
#-------------------------------------------------------------------