diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 25f22f255..1087e5739 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -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 diff --git a/lib/WebGUI/Auth.pm b/lib/WebGUI/Auth.pm index 3d71890cf..d3bfc430d 100644 --- a/lib/WebGUI/Auth.pm +++ b/lib/WebGUI/Auth.pm @@ -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 .= '
' ; diff --git a/lib/WebGUI/Auth/WebGUI.pm b/lib/WebGUI/Auth/WebGUI.pm index c325baada..a206318f9 100644 --- a/lib/WebGUI/Auth/WebGUI.pm +++ b/lib/WebGUI/Auth/WebGUI.pm @@ -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); } #-------------------------------------------------------------------