* Sat Sep 27 2025 Brian Read <brianr@koozali.org> 11.0.0-2.sme

- Add css to make embedded static version look a bit better [SME: 13195]
This commit is contained in:
2025-09-27 10:06:35 +01:00
parent c8ce77259d
commit 8964829c1c
4 changed files with 214 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
package SrvMngr::Controller::Phpsysinfo;
#----------------------------------------------------------------------
# heading : Legacy
# heading : Investigation
# description : System Information
# navigation : 4000 600
#----------------------------------------------------------------------
@@ -22,18 +22,16 @@ $ua->insecure(1);
sub main {
my $c = shift;
my $title = $c->l('psi_phpsysinfo_panel');
my $php_url = 'https://sme11.thereadclan.me.uk/phpsysinfo/index.php?disp=static';
#my $first_line = q{<meta http-equiv="Content-Security-Policy" content="default-src 'unsafe-inline' 'unsafe-eval' 'self'" />};
#my $second_line = q{<meta name="Description" content="phpSysInfo is a customizable PHP script that displays information about your system nicely" />};
my $host = $c->req->url->to_abs->host;
my $php_url = "https://".$host."/phpsysinfo/index.php?disp=static";
my $php_url2 = "https://".$host."/phpsysinfo/index.php?disp=bootstrap";
$ua->get($php_url => sub {
my ($ua, $tx) = @_;
if ($tx->res->is_success) {
my $php_content = $tx->res->body;
my ($phpsysinfo_html) = $php_content =~ m{<body[^>]*>(.*?)</body>}si;
$phpsysinfo_html =~ s/^( SME Server|<BR>Copyright \(c\)).*\n//gmi;
# Insert $first_line before $second_line - supressing CSP
#$phpsysinfo_html =~ s/(\Q$second_line\E)/$first_line\n$1/;
$c->stash(title => $title, phpsysinfo => $phpsysinfo_html, php_url => $php_url);
$c->stash(title => $title, phpsysinfo => $phpsysinfo_html, php_url => $php_url, php_url2 => $php_url2);
$c->render(template => 'phpsysinfo');
} else {
my $code = $tx->res->code // 'No code';