Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
0c593f5
Merge tag '1.10.49.1' into develop
rhukster Sep 4, 2025
325764a
improved login/session handling
rhukster Sep 15, 2025
6d673fc
upgrade JS
rhukster Sep 15, 2025
a8ac6f8
looks like a fix for deeply nested sortable fields!
rhukster Sep 20, 2025
0334dfa
minor css fixes
rhukster Sep 25, 2025
a4e0c83
safe upgrade progress
rhukster Oct 16, 2025
6ff2c45
more updates
rhukster Oct 16, 2025
4d789fc
upgrade flow
rhukster Oct 16, 2025
f642992
more upgrade flow fixes
rhukster Oct 16, 2025
e33e99e
yet more upgrade flow fixes
rhukster Oct 16, 2025
532274b
yet more upgrade flow fixes 2
rhukster Oct 16, 2025
b23940f
yet more upgrade flow fixes 3
rhukster Oct 16, 2025
f08a32c
new and improve admin async upgrade process
rhukster Oct 16, 2025
79c061a
improvements to logging and command calling
rhukster Oct 16, 2025
679a237
progress status during upates
rhukster Oct 17, 2025
8142b48
ensure binaries are executable
rhukster Oct 17, 2025
a21e5ec
Merge branch 'develop' of github.com:getgrav/grav-plugin-admin into d…
rhukster Oct 17, 2025
06461be
fix for progress bar
rhukster Oct 17, 2025
099e6cd
more progress fixes
rhukster Oct 17, 2025
f15d3a3
missing package size
rhukster Oct 17, 2025
ca65770
fix stuck progress at 80%
rhukster Oct 17, 2025
4a2b386
fix stuck progress at 80% - part deux
rhukster Oct 17, 2025
51551b3
dedicated endpoint for upgrade
rhukster Oct 17, 2025
746f09d
dedicated endpoint for upgrade
rhukster Oct 17, 2025
84d6cca
Merge branch 'develop' of github.com:getgrav/grav-plugin-admin into d…
rhukster Oct 17, 2025
78fc74a
use new safeupgrade route
rhukster Oct 17, 2025
654c2bb
more improvements to safe upgrade
rhukster Oct 17, 2025
fe42c33
more fixes for installation process
rhukster Oct 17, 2025
7e73ba9
more granular upgrade status
rhukster Oct 17, 2025
4aedf58
smoother progress
rhukster Oct 17, 2025
a572533
integer progress
rhukster Oct 17, 2025
3b07e9a
css tweaks
rhukster Oct 17, 2025
765e760
css tweaks 2
rhukster Oct 17, 2025
1a308b1
css tweaks 3
rhukster Oct 17, 2025
3910792
css tweaks 4
rhukster Oct 17, 2025
1ab0231
css tweaks 5
rhukster Oct 17, 2025
db72e52
css tweaks 6
rhukster Oct 17, 2025
a73d5aa
css tweaks 7
rhukster Oct 17, 2025
eac840a
logic fixes
rhukster Oct 17, 2025
48b4f3f
sync directory changes
rhukster Oct 17, 2025
92664e9
progress check fix
rhukster Oct 18, 2025
c24c137
extra attribute
rhukster Oct 18, 2025
7bb6044
improved safe upgrade modal
rhukster Oct 18, 2025
796c61e
restore tool - but not curretly working
rhukster Oct 18, 2025
39aa026
restore tool - mostly working
rhukster Oct 18, 2025
d437bd1
minor tweaks
rhukster Oct 18, 2025
64bbed1
Revert "minor tweaks"
rhukster Oct 18, 2025
84cf62b
bg process for restore
rhukster Oct 18, 2025
1e14c47
fixes for restore
rhukster Oct 18, 2025
0663272
fixes for progress bar
rhukster Oct 19, 2025
c4fb1f7
fixes for polling restore
rhukster Oct 19, 2025
419fcc3
create adhoc snapshot
rhukster Oct 19, 2025
e81ed34
fix labels in snapshots
rhukster Oct 19, 2025
08862b5
minor tweaks
rhukster Oct 19, 2025
ce38f72
ignore unpublished plugins
rhukster Oct 19, 2025
49a9b3b
timer tweaks
rhukster Oct 19, 2025
00be4fa
stop deleting recover.window file
rhukster Oct 20, 2025
9078633
fix for deprecation notice
rhukster Oct 29, 2025
0a1d38a
algnment of array field fix
rhukster Oct 29, 2025
b568929
simplified safe-upgrade
rhukster Nov 10, 2025
1dca097
admin fixes for safe update
rhukster Nov 11, 2025
1cf9aa1
fix status bar percent
rhukster Nov 11, 2025
a65eeed
improved safe upgrade success message
rhukster Nov 11, 2025
dfc1875
some fixes for new safe-upgrade
rhukster Nov 14, 2025
0a7f9c0
regression fix for session/logout
rhukster Nov 14, 2025
c4659c2
prepare for release
rhukster Nov 14, 2025
c2560d4
Merge branch 'release/1.10.50'
rhukster Nov 14, 2025
419ab56
Merge tag '1.10.50' into develop
rhukster Nov 14, 2025
bbed7e5
honor safe_upgrade setting
rhukster Nov 14, 2025
7d7d30e
more safe-guards
rhukster Nov 14, 2025
1ec8fab
Merge branch 'release/1.10.50'
rhukster Nov 14, 2025
2b2ed6e
Part of the fix for #2468 - Wrong log output date
Xoriander Dec 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# v1.10.50
## 11/14/2025

1. [](#new)
* Support for 'safe-upgrade' installation
* Support for safe-upgrade restore functionality in Tools
1. [](#improved)
* Improved session expiration/logout handling
* Various minor CSS fixes
1. [](#bugfix)
* Fix for deeply nested sortable fields (at last!)
* Restore admin session timeout modal by returning 401 for timed-out AJAX requests
* Honor `system.updates.safe_upgrade` so legacy Grav installs keep the classic updater

# v1.10.49.1
## 09/03/2025

Expand Down
29 changes: 29 additions & 0 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
use Grav\Plugin\Admin\Router;
use Grav\Plugin\Admin\Themes;
use Grav\Plugin\Admin\AdminController;
use Grav\Plugin\Admin\SafeUpgradeManager;
use Grav\Plugin\Admin\Twig\AdminTwigExtension;
use Grav\Plugin\Admin\WhiteLabel;
use Grav\Plugin\Form\Form;
Expand Down Expand Up @@ -383,6 +384,34 @@ public function onAdminTools(Event $event)
'reports' => [['admin.super'], 'PLUGIN_ADMIN.REPORTS'],
'direct-install' => [['admin.super'], 'PLUGIN_ADMIN.DIRECT_INSTALL'],
]);

$config = $this->grav['config'] ?? null;
if (!SafeUpgradeManager::configAllowsSafeUpgrade($config)) {
return;
}

try {
$manifestFiles = glob(GRAV_ROOT . '/user/data/upgrades/*.json') ?: [];

if (!$manifestFiles) {
$manager = new SafeUpgradeManager(Grav::instance());
$manifestFiles = $manager->hasSnapshots() ? [true] : [];
}

$tools = $event['tools'];
Grav::instance()['log']->debug('[Admin] Tools before restore grav: ' . implode(',', array_keys($tools)));

if ($manifestFiles) {
$tools['restore-grav'] = [['admin.super'], 'PLUGIN_ADMIN.RESTORE_GRAV'];
Grav::instance()['log']->debug('[Admin] Restore Grav tool enabled');
}

$event['tools'] = $tools;
Grav::instance()['log']->debug('[Admin] Tools after register: ' . implode(',', array_keys($tools)));
} catch (\Throwable $e) {
// ignore availability errors, snapshots tool will simply stay hidden
Grav::instance()['log']->warning('[Admin] Restore Grav detection failed: ' . $e->getMessage());
}
}

/**
Expand Down
1 change: 1 addition & 0 deletions admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pages:
show_modular: true
session:
timeout: 1800
keep_alive: true
edit_mode: normal
frontend_preview_target: inline
show_github_msg: true
Expand Down
14 changes: 13 additions & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Admin Panel
slug: admin
type: plugin
version: 1.10.49.1
version: 1.10.50
description: Adds an advanced administration panel to manage your site
icon: empire
author:
Expand Down Expand Up @@ -224,6 +224,18 @@ form:
type: number
min: 1

session.keep_alive:
type: toggle
label: Keep Alive Ping
help: "Periodically pings to keep your admin session alive. Turn OFF to allow the session to expire while idle (useful for testing timeouts)."
highlight: 1
default: 1
options:
1: PLUGIN_ADMIN.ENABLED
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool

hide_page_types:
type: select
size: large
Expand Down
25 changes: 25 additions & 0 deletions classes/plugin/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,31 @@ public static function toolsPermissions()
return array_unique($perms);
}

/**
* @return array<int, array{id:string, source_version:?string, target_version:?string, created_at:int, created_at_iso:?string, backup_path:?string, package_path:?string}>
*/
public function safeUpgradeSnapshots(): array
{
try {
$manager = new SafeUpgradeManager();

return $manager->listSnapshots();
} catch (\Throwable $e) {
return [];
}
}

public function safeUpgradeHasSnapshots(): bool
{
try {
$manager = new SafeUpgradeManager();

return $manager->hasSnapshots();
} catch (\Throwable $e) {
return false;
}
}

/**
* Return the languages available in the site
*
Expand Down
27 changes: 27 additions & 0 deletions classes/plugin/AdminBaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ public function execute()

// Make sure that user is logged into admin.
if (!$this->admin->authorize()) {
$this->respondUnauthorizedIfAjax();

return false;
}

Expand Down Expand Up @@ -236,6 +238,31 @@ protected function sendJsonResponse(array $json, $code = 200): void
$this->close($response);
}

/**
* Return a JSON 401 response when an unauthenticated request was clearly triggered via AJAX.
*
* @return void
*/
protected function respondUnauthorizedIfAjax(): void
{
$uri = $this->grav['uri'] ?? null;
$extension = $uri ? $uri->extension() : null;
$accept = $_SERVER['HTTP_ACCEPT'] ?? '';
$requestedWith = $_SERVER['HTTP_X_REQUESTED_WITH'] ?? '';

$acceptsJson = is_string($accept) && (stripos($accept, 'application/json') !== false || stripos($accept, 'text/json') !== false);
$isAjax = ($extension === 'json') || $acceptsJson || (is_string($requestedWith) && strtolower($requestedWith) === 'xmlhttprequest');

if (!$isAjax) {
return;
}

$this->sendJsonResponse([
'status' => 'unauthenticated',
'message' => Admin::translate('PLUGIN_ADMIN.SESSION_EXPIRED_DESC')
], 401);
}

/**
* @param ResponseInterface $response
* @return never-return
Expand Down
Loading