Codex's updates...

This commit is contained in:
2026-10-18 19:27:17 -04:00
parent a1643eb1b7
commit 02223083f6
338 changed files with 14757 additions and 7986 deletions
+9 -37
View File
@@ -1,48 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Create System Tables</title>
<style>
body {
background-color: #333;
color: white;
font-family: sans-serif;
padding: 1em;
}
.log {
margin-bottom: 1em;
}
.success {
color: #8fd19e;
}
.warning {
color: #ffd966;
}
.error {
color: #ff9999;
}
</style>
</head>
<body>
<?php
define("INITIALIZATION_FILE_NAME", "../xml/settings.xml");
<?php
if (PHP_SAPI !== 'cli') { http_response_code(404); exit; }
define("INITIALIZATION_FILE_NAME", getenv("HCR_SETTINGS_FILE") ?: (__DIR__ . "/../xml/" . (is_file(__DIR__ . "/../xml/settings.local.xml") ? "settings.local.xml" : "settings.xml")));
define("INIT_SCRIPT_USER", "Init Script");
// Safety switch - Change this to true when you intentionally want to rebuild system tables.
$allow_rebuild = true;
$allow_rebuild = getenv('HCR_ALLOW_REBUILD') === 'yes';
if (!$allow_rebuild) {
echoLog("Rebuild is disabled. Set \$allow_rebuild to true to continue.", "warning");
exit();
}
if (strlen(getenv('HCR_INITIAL_ADMIN_PASSWORD') ?: '') < 12 || strlen(getenv('HCR_INITIAL_ADMIN_PASSWORD') ?: '') > 72) throw new RuntimeException('Set HCR_INITIAL_ADMIN_PASSWORD before rebuilding.');
// --------------------------
// Load Application Settings
// --------------------------
@@ -247,7 +217,9 @@
function seedInitialAdminUser(PDO $connection) {
$password = password_hash("349Jamot@", PASSWORD_DEFAULT);
$initialPassword = getenv('HCR_INITIAL_ADMIN_PASSWORD');
if (!$initialPassword || strlen($initialPassword) < 12 || strlen($initialPassword) > 72) throw new RuntimeException('Set HCR_INITIAL_ADMIN_PASSWORD to a unique 12-72 byte password.');
$password = password_hash($initialPassword, PASSWORD_DEFAULT);
$SQL = "INSERT INTO users (
user_name,
+2 -10
View File
@@ -1,14 +1,6 @@
<style>
body {
background-color: #333333;
color: white;
font-family: sans-serif;
padding: 1em;
}
</style>
<?php
define("INITIALIZATION_FILE_NAME", "../xml/settings.xml");
if (PHP_SAPI !== 'cli') { http_response_code(404); exit; }
define("INITIALIZATION_FILE_NAME", getenv("HCR_SETTINGS_FILE") ?: (__DIR__ . "/../xml/" . (is_file(__DIR__ . "/../xml/settings.local.xml") ? "settings.local.xml" : "settings.xml")));
// Retrieve and validate table name.
+2 -1
View File
@@ -12,6 +12,7 @@ $SQL = "create table users (
user_password_hash varchar(255) not null,
user_role varchar(255) not null,
user_change_password boolean default false,
user_auth_version int unsigned not null default 0,
user_status varchar(255) not null default 'active',
user_last_login datetime default null,
@@ -26,6 +27,6 @@ $SQL = "create table users (
unique key (user_email),
index (user_name)
) default character set = utf8mb4
) engine = InnoDB default character set = utf8mb4
collate = utf8mb4_unicode_ci";
?>