Files
ops-Gazelle/sections/tools/managers/db_key.php
T
2023-02-03 11:13:44 +01:00

18 lines
404 B
PHP

<?php
if (!$Viewer->permitted('admin_site_debug')) {
error(403);
}
if (isset($_POST['dbkey'])) {
authorize();
apcu_store('DB_KEY', hash('sha512', $_POST['dbkey']));
}
echo $Twig->render('admin/db-key.twig', [
'auth' => $Viewer->auth(),
'fingerprint' => (apcu_exists('DB_KEY') && apcu_fetch('DB_KEY'))
? '0x' . substr(apcu_fetch('DB_KEY'), 0, 4)
: false,
]);