lmError(): return JSON if wanted (#1745)
This commit is contained in:
parent
c20c14ac95
commit
1186aba52b
|
@ -873,6 +873,15 @@ sub lmError {
|
||||||
|
|
||||||
# Check URL
|
# Check URL
|
||||||
$self->controlUrl($req);
|
$self->controlUrl($req);
|
||||||
|
$req->pdata( {} );
|
||||||
|
|
||||||
|
if ( $req->wantJSON ) {
|
||||||
|
return $self->sendJSONresponse(
|
||||||
|
$req,
|
||||||
|
{ error => $httpError, result => 0 },
|
||||||
|
code => $httpError
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
my %templateParams = (
|
my %templateParams = (
|
||||||
MAIN_LOGO => $self->conf->{portalMainLogo},
|
MAIN_LOGO => $self->conf->{portalMainLogo},
|
||||||
|
@ -880,7 +889,6 @@ sub lmError {
|
||||||
LOGOUT_URL => $self->conf->{portal} . "?logout=1",
|
LOGOUT_URL => $self->conf->{portal} . "?logout=1",
|
||||||
URL => $req->{urldc},
|
URL => $req->{urldc},
|
||||||
);
|
);
|
||||||
$req->pdata( {} );
|
|
||||||
|
|
||||||
# Error code
|
# Error code
|
||||||
$templateParams{"ERROR$_"} = ( $httpError == $_ ? 1 : 0 )
|
$templateParams{"ERROR$_"} = ( $httpError == $_ ? 1 : 0 )
|
||||||
|
|
Loading…
Reference in New Issue
Block a user