generated from jric11/baseProject
Codex's updates...
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user