From 624e2a7bc8361a16f24967235e911d0fbb1267d2 Mon Sep 17 00:00:00 2001 From: Sky Johnson Date: Tue, 2 Jul 2024 09:34:38 -0500 Subject: [PATCH] Finish install step 1 --- public/css/dragon.css | 4 ++ public/install/index.php | 50 +++++++++++++++--- server/database/dragon.db-shm | Bin 0 -> 32768 bytes server/database/dragon.db-wal | Bin 0 -> 65952 bytes server/lib.php | 23 ++++++++ server/templates/install/done.php | 14 +++++ .../templates/install/partials/adminForm.php | 31 +++++++++++ server/templates/install/second.php | 31 +---------- server/templates/install/third.php | 12 +++++ 9 files changed, 129 insertions(+), 36 deletions(-) create mode 100644 server/database/dragon.db-shm create mode 100644 server/database/dragon.db-wal create mode 100644 server/templates/install/done.php create mode 100644 server/templates/install/partials/adminForm.php create mode 100644 server/templates/install/third.php diff --git a/public/css/dragon.css b/public/css/dragon.css index c60209c..892c043 100644 --- a/public/css/dragon.css +++ b/public/css/dragon.css @@ -26,6 +26,10 @@ body { } } +.text-red { + color: #d20f39; +} + .mb-1 { margin-bottom: 1rem; } diff --git a/public/install/index.php b/public/install/index.php index 5c292fa..5cfe0d6 100644 --- a/public/install/index.php +++ b/public/install/index.php @@ -7,7 +7,8 @@ if (installed()) redirect('/'); $db = new Database(DB); -const STEPS = ['first', 'second', 'third', 'fourth', 'fifth']; +// Define our pages and whitelist the request +const STEPS = ['first', 'second', 'third']; $step = isset($_GET['step']) && in_array($_GET['step'], STEPS) ? $_GET['step'] : 'first'; // Introduction; offer the user two options for installation; @@ -21,7 +22,7 @@ if ($step == 'first') { // Database setup; create tables and default data (if requested) if ($step == 'second') { $istart = microtime(true); // time the database setup - if (!isset($_POST['mode'])) redirect('/install/'); // dont run install if a button wasnt clicked + if (!required(['mode'])) redirect('/install/'); // dont run step two if a button wasnt clicked $complete = $_POST['mode'] == 'complete'; // complete or partial setup // Create Control table @@ -378,7 +379,7 @@ if ($step == 'second') { ['name' => 'Breath', 'type' => 1, 'mp' => 25, 'effect' => 'heal:self,50', 'icon' => 'breath.png'], ['name' => 'Revive', 'type' => 1, 'mp' => 50, 'effect' => 'heal:self,100', 'icon' => 'revive.png'], ['name' => 'Gaia', 'type' => 1, 'mp' => 75, 'effect' => 'heal:self,150', 'icon' => 'gaia.png' ], - + // Type 2 = damage ['name' => 'Slash', 'type' => 2, 'mp' => 5, 'effect' => 'damage:opp,10', 'icon' => 'slash.png' ], ['name' => 'Magic Missile', 'type' => 2, 'mp' => 12, 'effect' => 'damage:opp,35', 'icon' => 'missile.png' ], @@ -431,8 +432,8 @@ if ($step == 'second') { ]); } - // Create Users table - $db->table('users')->create([ + // Create Players table + $db->table('players')->create([ 'id INTEGER PRIMARY KEY', 'username TEXT NOT NULL', 'password TEXT NOT NULL', @@ -469,7 +470,7 @@ if ($step == 'second') { // Create Fights table $db->table('fights')->create([ 'id INTEGER PRIMARY KEY', - 'user_id INTEGER DEFAULT 1', + 'player_id INTEGER DEFAULT 1', 'monster_id INTEGER DEFAULT 1', 'turn INTEGER DEFAULT 1', 'user_hp INTEGER DEFAULT 0', @@ -484,6 +485,41 @@ if ($step == 'second') { 'monster_sleep INTEGER DEFAULT 0', ]); - echo render('install/layout', ['title' => 'Database', 'step' => 'second', 'complete' => $complete]); + echo render('install/layout', ['title' => 'Database Setup', 'step' => 'second', 'complete' => $complete, 'start' => $istart]); exit; } + +// Admin account; create it from the provided info +if ($step == 'third') { + $errors = []; + + if (!required(['username', 'password', 'email'])) { + $errors[] = 'All fields are required.'; + } else { + if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) { + $errors[] = 'Invalid email address format.'; + } + + if (strlen($_POST['password']) < 6) { + $errors[] = 'Password must be at least 6 characters long.'; + } + } + + $class = isset($_POST['class']) && in_array($_POST['class'], [1, 2, 3]) ? $_POST['class'] : 0; + + if (!empty($errors)) { + echo render('install/layout', ['title' => 'Admin Account', 'step' => 'third', 'errors' => $errors, 'complete' => $_POST['complete'] ?? false]); + exit; + } + + $db->table('players')->insert([ + 'username' => trim($_POST['username']), + 'password' => password_hash($_POST['password'], PASSWORD_ARGON2ID), + 'email' => trim($_POST['email']), + 'class' => $class, + 'role' => 5 + ]); + + echo render('install/layout', ['title' => 'Finished!', 'step' => 'done', 'name' => $_POST['username'], 'complete' => $_POST['complete'] ?? false]); + exit; +} diff --git a/server/database/dragon.db-shm b/server/database/dragon.db-shm new file mode 100644 index 0000000000000000000000000000000000000000..b38007b0d758f3e774fe4c808295df7d98ddabbd GIT binary patch literal 32768 zcmeI)OG*Pl5C-5*e8y)Mf&mpl@d1*(D_3s4hr8S$=n=$q?qM$ADYDXgsMQk0)es>A zcIGSi>B&q}ss0Yoy|;eKwH9fm)a}N485s`tZeP;q`R3tc|MB(d`tE)*9$&p5_5Qd& zT76gU`}wP;uYZ3`i@^FUo9rP#fB*pk1pc)^zA;=8AV8o>V5{n*Zv+SsC`w?psA&yLV4ebVoF02s6$|-j;4ANC_-SPh$#(8pbmkZI-2T9fB*pk1PC-r;0ui)Cr1DP literal 0 HcmV?d00001 diff --git a/server/database/dragon.db-wal b/server/database/dragon.db-wal new file mode 100644 index 0000000000000000000000000000000000000000..4e119a0e3b19ec638eeaf0c4e5a2c01aab19af23 GIT binary patch literal 65952 zcmeHw33yx8nfAR``yN7KS(X<$j$=Df5?NldG(a3L*__0&9TGA?kZsu(ktHL^i5(!+ za;7x*LJL!dE_6DSLKiv(IzwAZr?iC*W%x^{L)Yoh(sl}kwm-vk+LPs-0wTvch2|T^L{$Zwp)y8X7f*L8Dw~WAUE5to=eM2rIp>|1JME4iI6e+h z^;5M#)dE!uR4q`oK-B_O3sfyowLsMZRSQ%t@ZYvTz~N%rIE%yLSnKs#@EJ&iX5um5 z!B}KwHpRSgC^Qp39!ex4@x(|d8k&m40``hi*eXt8tvH3H;uPkJQNpaV9SClgGQh_S<(RI>(L*@o%+1ZOoR~;|8Ma`aO|1x_)n4wmxe4Q}d6^8%&M5$Jw8< zKTu0pefB@KfYENGS*#qhncN-^d#fQ8nuvy{3GyVx-_HKg!M^c9-+14i;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PfM3zq7|5?DhxoyVu_poS{l2>8`_>qlRuxB`?rl9BN=#y7Z|JS_Z=K)8{szk1{5xnCNZIKR2K^+99by(S zNttA_ZP-c{?BLVabP(H%!ylY#pK9#!_xiVEu`Q`VZt~Maha~JgXeBFh@Y&I@ClN^w zJ?;s*g8nXlx4*~ViNrhn!GKug1jHms$AL_ej)qa(+1uD?^%%q?Qi2`iDqo`7y&r8e zn{m`%PwSzGXl#Q44M72&+cNoYNB(n?l%xvmtGM&_W_qCF&ci^i$B!Hr7+4cO|DHc% z9wTu9*0r0#|Er&>1*#UPTA*ryss*YRs9K=KPhHmSpTDeg{pn3d zukSyzIGyN@_r|Y0y>)4BdT*?6{n;buj)ca$rWfbKGr^(Mw&~v41K~jT(1GLKU6WTG y?_E3)x@!3F>BZ!g`)Mh=>AB!rCgXF#K(KprVB6+E(AU|$v#Wb&V7tmA!~X$'; + $r ? print_r($var) : var_dump($var); + echo ''; + exit; +} + function gettemplate($templatename) { // SQL query for the template. diff --git a/server/templates/install/done.php b/server/templates/install/done.php new file mode 100644 index 0000000..e0e5929 --- /dev/null +++ b/server/templates/install/done.php @@ -0,0 +1,14 @@ +

+ Congratulations, ! Your installation is complete. Dragon Knight is ready to go. + All that's left is to log in and start playing. Once you've set the + classes in the admin panel, you can assign yourself one. +

+ +

+ Click here to log in. +

+ +

+ We'd love if you were to join the Sharkk community and let us know what you think! + @TODO +

\ No newline at end of file diff --git a/server/templates/install/partials/adminForm.php b/server/templates/install/partials/adminForm.php new file mode 100644 index 0000000..4ef4aad --- /dev/null +++ b/server/templates/install/partials/adminForm.php @@ -0,0 +1,31 @@ +
+ "> + +
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+ + +
+ + + +
diff --git a/server/templates/install/second.php b/server/templates/install/second.php index 47cb618..1121510 100644 --- a/server/templates/install/second.php +++ b/server/templates/install/second.php @@ -1,5 +1,6 @@

If you're seeing this page with no errors, then database setup is complete! + It took about seconds.

@@ -21,32 +22,4 @@ panel.

-
-
- - -
- -
- - -
- -
- - -
- - -
- - -
- - - -
+ $complete]) ?> diff --git a/server/templates/install/third.php b/server/templates/install/third.php new file mode 100644 index 0000000..c2d7e9f --- /dev/null +++ b/server/templates/install/third.php @@ -0,0 +1,12 @@ +

+ It looks like we encountered some errors with the info provided for your + admin account. Let's try that again. +

+ +' . $error . '

'; +} +?> + + $complete]) ?>