From 8001eb275fc9f88a2a293507cd4306bf44a10a42 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sat, 14 Jan 2017 11:12:05 +0100 Subject: [PATCH] pass auth_handler result to formatters In case somebody want to display that info. --- PVE/APIServer/Formatter/Bootstrap.pm | 2 +- PVE/APIServer/Formatter/HTML.pm | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PVE/APIServer/Formatter/Bootstrap.pm b/PVE/APIServer/Formatter/Bootstrap.pm index be9d3d8..e875b89 100644 --- a/PVE/APIServer/Formatter/Bootstrap.pm +++ b/PVE/APIServer/Formatter/Bootstrap.pm @@ -64,7 +64,7 @@ PVE = { _EOJS sub new { - my ($class, $res, $url) = @_; + my ($class, $res, $url, $auth) = @_; my $self = bless { url => $url, diff --git a/PVE/APIServer/Formatter/HTML.pm b/PVE/APIServer/Formatter/HTML.pm index 7979526..ba824aa 100644 --- a/PVE/APIServer/Formatter/HTML.pm +++ b/PVE/APIServer/Formatter/HTML.pm @@ -174,7 +174,7 @@ PVE::APIServer::Formatter::register_formatter($portal_format, sub { $data = $res->{data}; my $html = ''; - my $doc = PVE::APIServer::Formatter::Bootstrap->new($res, $path); + my $doc = PVE::APIServer::Formatter::Bootstrap->new($res, $path, $auth); if (!HTTP::Status::is_success($res->{status})) { $html .= $doc->alert(text => "Error $res->{status}: $res->{message}"); @@ -250,7 +250,7 @@ PVE::APIServer::Formatter::register_page_formatter( code => sub { my ($res, $data, $param, $path, $auth) = @_; - my $doc = PVE::APIServer::Formatter::Bootstrap->new($res, $path); + my $doc = PVE::APIServer::Formatter::Bootstrap->new($res, $path, $auth); my $html = &$login_form($doc); @@ -277,7 +277,7 @@ PVE::APIServer::Formatter::register_page_formatter( # Note: HTTP server redirects to 'GET /access/ticket', so below # output is not really visible. - my $doc = PVE::APIServer::Formatter::Bootstrap->new($res, $path); + my $doc = PVE::APIServer::Formatter::Bootstrap->new($res, $path, $auth); my $html = &$login_form($doc);