Setup wizard stage 1: rebuild the setup wizard as a centred installer with a step bar and each step in its own file under setup/steps, split checks into required and recommended with fixes and Check again, make the database step explain connection failures, refuse a database that already has tables, create the tables before writing config.php and show its contents when it cannot be written, make each step wait for the one before, show the messages after each step, stop Finish halting on the telemetry reply or landing back on setup from a cached config.php, fix the show-password and copy buttons, and fit the wizard on a phone

This commit is contained in:
johnnyq
2026-10-20 11:24:37 -04:00
parent 717c6234d5
commit 9b95bb6d07
14 changed files with 1352 additions and 1024 deletions

65
setup/steps/user.php Normal file
View File

@@ -0,0 +1,65 @@
<?php
/*
* Setup - Your account: the first user, an administrator (add_user in
* setup/index.php). Made once - an install that has one carries on.
*/
defined('FROM_SETUP') || die("Direct file access is not allowed");
?>
<div class="card itflow-setup-card">
<div class="card-body p-4">
<h1 class="h4 fw-semibold mb-1"><i class="fas fa-user text-body-secondary me-2"></i>Your account</h1>
<p class="text-body-secondary mb-4">The first account - an administrator. The rest of your team is added from Admin &gt; Users once you are signed in.</p>
<?php if ($install_is_live) { ?>
<div class="d-flex gap-3 align-items-start mb-4" data-step-done>
<i class="fas fa-check-circle text-success fa-lg mt-1"></i>
<div class="fw-semibold">This install already has its first account.</div>
</div>
<a href="?<?= $resume_step ?>" class="btn btn-primary" data-setup-next>Continue<i class="fas fa-arrow-right ms-2"></i></a>
<?php } elseif (!$database_ready) { ?>
<div class="alert alert-info mb-3"><i class="fas fa-info-circle me-2"></i>The database comes first.</div>
<a href="?<?= $resume_step ?>" class="btn btn-primary">Set up the database<i class="fas fa-arrow-right ms-2"></i></a>
<?php } else { ?>
<form method="post" enctype="multipart/form-data" autocomplete="off">
<div class="row g-3">
<div class="col-12">
<label class="form-label" for="setupUserName">Name <strong class="text-danger">*</strong></label>
<div class="input-group">
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
<input type="text" class="form-control" id="setupUserName" name="name" placeholder="Your full name" maxlength="200" autofocus required>
</div>
</div>
<div class="col-12">
<label class="form-label" for="setupUserEmail">Email <strong class="text-danger">*</strong></label>
<div class="input-group">
<span class="input-group-text"><i class="fa fa-fw fa-envelope"></i></span>
<input type="email" class="form-control" id="setupUserEmail" name="email" placeholder="you@company.com" maxlength="200" required>
</div>
<div class="form-text">What you sign in with.</div>
</div>
<div class="col-12">
<label class="form-label" for="setupUserPassword">Password <strong class="text-danger">*</strong></label>
<div class="input-group">
<span class="input-group-text"><i class="fa fa-fw fa-lock"></i></span>
<input type="password" class="form-control" id="setupUserPassword" data-toggle="password" name="password" placeholder="At least 8 characters" autocomplete="new-password" required minlength="8">
<span class="input-group-text"><i class="fa fa-fw fa-eye"></i></span>
</div>
</div>
<div class="col-12">
<label class="form-label" for="setupUserAvatar">Avatar</label>
<div class="input-group">
<span class="input-group-text"><i class="fa fa-fw fa-image"></i></span>
<input type="file" class="form-control" id="setupUserAvatar" accept="image/*" name="file">
</div>
</div>
</div>
<div class="d-flex justify-content-end mt-4">
<button type="submit" name="add_user" class="btn btn-primary" data-setup-next>Create my account<i class="fas fa-arrow-right ms-2"></i></button>
</div>
</form>
<?php } ?>
</div>
</div>