]> git.proxmox.com Git - pve-http-server.git/commitdiff
pass auth_handler result to formatters
authorDietmar Maurer <dietmar@proxmox.com>
Sat, 14 Jan 2017 10:12:05 +0000 (11:12 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Sat, 14 Jan 2017 10:12:05 +0000 (11:12 +0100)
In case somebody want to display that info.

PVE/APIServer/Formatter/Bootstrap.pm
PVE/APIServer/Formatter/HTML.pm

index be9d3d832170d5c9b001749dc479385a66f625db..e875b897b9904ccbcda3720eba2cf4b85d1dfa8c 100644 (file)
@@ -64,7 +64,7 @@ PVE = {
 _EOJS
 
 sub new {
-    my ($class, $res, $url) = @_;
+    my ($class, $res, $url, $auth) = @_;
 
     my $self = bless {
        url => $url,
index 7979526c6fddc2817ce358ce5279cc6346566f2b..ba824aac890fe9601c376fef0b35be8fe5696ccb 100644 (file)
@@ -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);