Don't use "login" to display errors for connected users (#595)

This commit is contained in:
Xavier Guimard 2017-02-19 07:17:42 +00:00
parent 11e6cd2134
commit 2735520c16
4 changed files with 20 additions and 12 deletions

View File

@ -142,16 +142,11 @@ sub display {
} }
# 2.2 Case : display menu (with error or not) # 2.2 Case : display menu (with error or not)
elsif ( $req->error == PE_OK or ( $req->userData and %{ $req->userData } ) ) elsif ( $req->error == PE_OK ) {
{
$skinfile = 'menu'; $skinfile = 'menu';
#utf8::decode($auth_user); #utf8::decode($auth_user);
%templateParams = ( %templateParams = (
AUTH_ERROR => $req->error,
AUTH_ERROR_TYPE => $req->error_type,
AUTH_USER => $req->{sessionInfo}->{ $self->conf->{portalUserAttr} }, AUTH_USER => $req->{sessionInfo}->{ $self->conf->{portalUserAttr} },
NEWWINDOW => $self->conf->{portalOpenLinkInNewWindow}, NEWWINDOW => $self->conf->{portalOpenLinkInNewWindow},
LOGOUT_URL => $self->conf->{portal} . "?logout=1", LOGOUT_URL => $self->conf->{portal} . "?logout=1",
@ -161,6 +156,15 @@ sub display {
); );
} }
# 2.3 Case : user authenticated but an error was returned (bas url,...)
elsif ( $req->userData and %{ $req->userData } ) {
$skinfile = 'error';
%templateParams = (
AUTH_ERROR => $req->error,
AUTH_ERROR_TYPE => $req->error_type,
);
}
# 3 Authentication has been refused OR first access # 3 Authentication has been refused OR first access
else { else {
$skinfile = 'login'; $skinfile = 'login';

View File

@ -1,7 +1,8 @@
<TMPL_INCLUDE NAME="header.tpl"> <TMPL_INCLUDE NAME="header.tpl">
<div id="errorcontent" class="container"> <div id="errorcontent" class="container">
<TMPL_IF AUTH_ERROR>
<div class="message message-<TMPL_VAR NAME="AUTH_ERROR_TYPE"> alert"><span trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></span></div>
</TMPL_IF>
<TMPL_IF ERROR403> <TMPL_IF ERROR403>
<div class="message message-negative alert"> <div class="message message-negative alert">
<span trspan="accessDenied">You have no access authorization for this application</span> <span trspan="accessDenied">You have no access authorization for this application</span>
@ -21,7 +22,6 @@
</TMPL_IF> </TMPL_IF>
<div id="error"> <div id="error">
<TMPL_IF URL> <TMPL_IF URL>
<div class="message message-warning alert"> <div class="message message-warning alert">
<span trspan="redirectedFrom">You were redirect from </span> <span trspan="redirectedFrom">You were redirect from </span>
@ -41,9 +41,6 @@
</a> </a>
</TMPL_IF> </TMPL_IF>
</div> </div>
</div> </div>
</div> </div>
<TMPL_INCLUDE NAME="footer.tpl"> <TMPL_INCLUDE NAME="footer.tpl">

View File

@ -8,6 +8,9 @@
</div> </div>
<p></p> <p></p>
<div id="content-all-info"> <div id="content-all-info">
<TMPL_IF NAME="AUTH_ERROR">
<h3 trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></h3>
</TMPL_IF>
<TMPL_IF ERROR403> <TMPL_IF ERROR403>
<h3 trspan="accessDenied">You have no access authorization for this application</h3> <h3 trspan="accessDenied">You have no access authorization for this application</h3>
</TMPL_IF> </TMPL_IF>

View File

@ -2,6 +2,10 @@
<div id="errorcontent"> <div id="errorcontent">
<TMPL_IF NAME="AUTH_ERROR">
<div class="message <TMPL_VAR NAME="AUTH_ERROR_TYPE">"><ul><li trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></li></ul></div>
</TMPL_IF>
<TMPL_IF ERROR403> <TMPL_IF ERROR403>
<div class="message negative"><ul><li><span trspan="accessDenied">You have no access authorization for this application</span></li></ul></div> <div class="message negative"><ul><li><span trspan="accessDenied">You have no access authorization for this application</span></li></ul></div>
</TMPL_IF> </TMPL_IF>