fix initializing

This commit is contained in:
2026-11-21 17:33:39 +01:00
parent 267d8004e0
commit 8ddea24272
3 changed files with 12 additions and 6 deletions
+4
View File
@@ -387,6 +387,10 @@ if (! function_exists('phpb_redirect')) {
$_SESSION["phpb_flash"] = $flashData;
}
if (session_status() === PHP_SESSION_ACTIVE) {
session_write_close();
}
header('Location: ' . $url, true, $statusCode);
exit();
}
@@ -3,17 +3,15 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title><?= phpb_trans('auth.title') ?></title>
<title><?= phpb_trans("auth.title") ?></title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
<link href="<?= phpb_asset('WebsiteManager.css') ?>" rel="stylesheet">
<link href="<?= phpb_asset("WebsiteManager.css") ?>" rel="stylesheet">
</head>
<body>
<div class="container p-4">
<?php
require __DIR__ . '/' . $viewFile . '.php';
?>
<?php require __DIR__ . "/" . $viewFile . ".php"; ?>
<footer class="my-5 pt-5 text-muted text-center text-small">
<p class="mb-1">Powered by <a href="https://github.com/deepDiverPaul/plugi" target="_blank">Plugi Page Builder</a></p>
+5 -1
View File
@@ -236,6 +236,10 @@ class Plugi
];
if(!phpb_on_url($module, $parameters[0])) {
if(!phpb_on_url($module, $parameters[1])) {
$authUrl = phpb_config('auth.url');
if ($authUrl !== null && strpos(phpb_current_relative_url(), $authUrl) === 0) {
return;
}
phpb_redirect(phpb_url($module, $parameters[0]), [
'message-type' => 'error',
'message' => phpb_trans('website-manager.check-database')
@@ -359,7 +363,7 @@ class Plugi
public function handleRequest($action = null)
{
$route = $route ?? $_GET['route'] ?? null;
$action = $action ?? $_GET['action'] ?? null;
$action = $action ?? $_GET['action'] ?? $_POST['action'] ?? null;
if (! phpb_config('auth.use_login') || ! phpb_config('website_manager.use_website_manager')) {
die('The Plugi Authentication module is disabled, but no alternative has been implemented (you are still calling the standard handleRequest() method).<br>'
. 'Implement a piece of code that checks whether the user is logged in. If logged in, call handleAuthenticatedRequest() or else call handlePublicRequest().');