Commit 70a5c645 authored by Christophe Maudoux's avatar Christophe Maudoux

Improve checkUser display (#1658)

parent 3f9957ee
......@@ -70,6 +70,7 @@ sub check {
MAIN_LOGO => $self->conf->{portalMainLogo},
LANGS => $self->conf->{showLanguages},
MSG => "PE$msg",
ALERTE => 'message-warning',
TOKEN => $token,
}
) if $msg;
......@@ -126,6 +127,7 @@ sub check {
MAIN_LOGO => $self->conf->{portalMainLogo},
LANGS => $self->conf->{showLanguages},
MSG => $msg,
ALERTE => 'message-positive',
LOGIN => (
$self->p->checkXSSAttack( 'LOGIN', $req->{user} ) ? ""
: $req->{user}
......@@ -134,10 +136,11 @@ sub check {
$self->p->checkXSSAttack( 'URL', $url ) ? ""
: $url
),
ALLOWED => $result,
HEADERS => $array_hdrs,
ATTRIBUTES => $array_attrs,
TOKEN => $token,
ALLOWED => $result,
ALERTE_AUTH => ($result eq 'allowed' ? "alert-success" : "alert-danger"),
HEADERS => $array_hdrs,
ATTRIBUTES => $array_attrs,
TOKEN => $token,
}
);
}
......@@ -155,6 +158,7 @@ sub display {
MAIN_LOGO => $self->conf->{portalMainLogo},
LANGS => $self->conf->{showLanguages},
MSG => 'checkUser',
ALERTE => 'message-positive',
LOGIN => (
$self->p->checkXSSAttack( 'LOGIN', $req->{user} )
? ""
......@@ -176,7 +180,7 @@ sub _userDatas {
$req->steps($steps);
if ( my $error = $self->p->process($req) ) {
if ( $error == PE_USERNOTFOUND ) {
$self->userLogger->warn( "Check requested for an unvalid user ("
$self->userLogger->warn( 'Check requested for an unvalid user ('
. $req->{user}
. ")" );
}
......
<TMPL_INCLUDE NAME="header.tpl">
<div id="errorcontent" class="container">
<!--
<div class="message message-positive alert"><span trspan="<TMPL_VAR NAME="MSG">"></span></div>
-->
<div class="message <TMPL_VAR NAME="ALERTE"> alert"><span trspan="<TMPL_VAR NAME="MSG">"></span></div>
<form id="checkuser" action="/checkuser" method="post" class="password" role="form">
<TMPL_IF NAME="TOKEN">
<input type="hidden" name="token" value="<TMPL_VAR NAME="TOKEN">" />
</TMPL_IF>
<!--
<input type="hidden" name="confirm" value="<TMPL_VAR NAME="CONFIRMKEY">">
<input type="hidden" name="url" value="<TMPL_VAR NAME="URL">">
-->
<TMPL_IF NAME="TOKEN">
<input type="hidden" name="token" value="<TMPL_VAR NAME="TOKEN">" />
</TMPL_IF>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-user"></i> </span>
......@@ -28,7 +26,7 @@
<TMPL_IF NAME="ALLOWED">
<div class="message message-positive alert"><span trspan="<TMPL_VAR NAME="ALLOWED">"></span></div>
<div class="alert <TMPL_VAR NAME="ALERTE_AUTH">"><span trspan="<TMPL_VAR NAME="ALLOWED">"></span></div>
</TMPL_IF>
<TMPL_IF NAME="HEADERS">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment