шаг 5 завершен
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/** @var bool $canRun */
|
||||
/** @var bool $hasAdmin */
|
||||
/** @var string $token */
|
||||
/** @var string|null $message */
|
||||
/** @var string|null $error */
|
||||
?>
|
||||
<section class="start-screen">
|
||||
<p class="eyebrow">Админка</p>
|
||||
<h1>Создание администратора</h1>
|
||||
|
||||
<?php if ($message !== null): ?>
|
||||
<div class="status-box success"><?= e($message) ?> <a href="/admin/login.php">Перейти ко входу</a></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($error !== null): ?>
|
||||
<div class="status-box danger"><?= e($error) ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($hasAdmin): ?>
|
||||
<p class="muted">Администратор уже создан. Создание через setup закрыто.</p>
|
||||
<p><a class="primary-link" href="/admin/login.php">Войти в админку</a></p>
|
||||
<?php elseif (!$canRun): ?>
|
||||
<div class="status-box danger">Нужен корректный токен установки.</div>
|
||||
<?php else: ?>
|
||||
<p class="muted">Создайте первого администратора. После этого страница станет недоступна для повторного создания.</p>
|
||||
<form class="admin-form" method="post">
|
||||
<input type="hidden" name="token" value="<?= e($token) ?>">
|
||||
<label>
|
||||
Имя
|
||||
<input name="name" autocomplete="name" required>
|
||||
</label>
|
||||
<label>
|
||||
Email
|
||||
<input name="email" type="email" autocomplete="username" required>
|
||||
</label>
|
||||
<label>
|
||||
Пароль
|
||||
<input name="password" type="password" autocomplete="new-password" minlength="8" required>
|
||||
</label>
|
||||
<button class="primary-button" type="submit">Создать администратора</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
Reference in New Issue
Block a user