db check working

This commit is contained in:
Paul Spenke
2023-06-30 16:37:44 +08:00
parent 77c642984c
commit 400d960f81
10 changed files with 193 additions and 99 deletions
@@ -44,6 +44,13 @@ class WebsiteManager implements WebsiteManagerContract
}
}
if ($route === 'database') {
if ($action === 'update') {
$this->handleUpdateDB();
exit();
}
}
if ($route === 'page_settings') {
if ($action === 'create') {
$this->handleCreate();
@@ -155,6 +162,21 @@ class WebsiteManager implements WebsiteManagerContract
}
}
/**
* Handle requests for updating the website DB.
*/
public function handleUpdateDB()
{
global $phpb_db;
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$phpb_db->resolveDiffDB();
phpb_redirect(phpb_url('website_manager', ['tab' => 'info']), [
'message-type' => 'success',
'message' => phpb_trans('website-manager.db-updated')
]);
}
}
/**
* Render the website manager overview page.
*/