xref: /webtrees/resources/views/setup/step-5-administrator.phtml (revision 3430c0bab1304f028145cca3ec085308fb0390b5)
1<?php
2
3use Fisharebest\Webtrees\I18N;
4use Illuminate\Support\Collection;
5
6/**
7 * @var string                 $dbhost
8 * @var string                 $dbname
9 * @var string                 $dbpass
10 * @var string                 $dbport
11 * @var string                 $dbtype
12 * @var string                 $dbuser
13 * @var Collection<int,string> $errors
14 * @var string                 $lang
15 * @var string                 $tblpfx
16 * @var Collection<int,string> $warnings
17 * @var string                 $wtemail
18 * @var string                 $wtname
19 * @var string                 $wtpass
20 * @var string                 $wtuser
21 */
22
23?>
24
25<form method="post" autocomplete="off">
26    <input name="lang" type="hidden" value="<?= e($lang) ?>">
27    <input name="dbtype" type="hidden" value="<?= e($dbtype) ?>">
28    <input name="dbhost" type="hidden" value="<?= e($dbhost) ?>">
29    <input name="dbport" type="hidden" value="<?= e($dbport) ?>">
30    <input name="dbuser" type="hidden" value="<?= e($dbuser) ?>">
31    <input name="dbpass" type="hidden" value="<?= e($dbpass) ?>">
32    <input name="dbname" type="hidden" value="<?= e($dbname) ?>">
33    <input name="tblpfx" type="hidden" value="<?= e($tblpfx) ?>">
34    <input name="baseurl" type="hidden" value="">
35
36    <h2>
37        <?= I18N::translate('Administrator account') ?>
38    </h2>
39
40    <?php foreach ($errors as $error) : ?>
41        <p class="alert alert-danger"><?= $error ?></p>
42    <?php endforeach ?>
43
44    <?php foreach ($warnings as $warning) : ?>
45        <p class="alert alert-warning"><?= $warning ?></p>
46    <?php endforeach ?>
47
48    <p>
49        <?= I18N::translate('You need to set up an administrator account. This account can control all aspects of this webtrees installation. Please choose a strong password.') ?>
50    </p>
51
52    <div class="row mb-3">
53        <label class="col-form-label col-sm-3" for="wtname">
54            <?= I18N::translate('Your name') ?>
55        </label>
56        <div class="col-sm-9">
57            <input class="form-control" dir="ltr" id="wtname" name="wtname" type="text" value="<?= e($wtname) ?>" autocomplete="name">
58            <div class="form-text">
59                <?= I18N::translate('This is your real name, as you would like it displayed on screen.') ?>
60            </div>
61        </div>
62    </div>
63
64    <div class="row mb-3">
65        <label class="col-form-label col-sm-3" for="wtuser">
66            <?= I18N::translate('Username') ?>
67        </label>
68        <div class="col-sm-9">
69            <input class="form-control" dir="ltr" id="wtuser" name="wtuser" type="text" value="<?= e($wtuser) ?>" autocomplete="username">
70            <div class="form-text">
71                <?= I18N::translate('You will use this to sign in to webtrees.') ?>
72            </div>
73        </div>
74    </div>
75
76    <div class="row mb-3">
77        <label class="col-form-label col-sm-3" for="wtpass">
78            <?= I18N::translate('Password') ?>
79        </label>
80        <div class="col-sm-9">
81            <input class="form-control" dir="ltr" id="wtpass" name="wtpass" pattern=".{6,}" type="password" value="<?= e($wtpass) ?>" autocomplete="current-password" data-wt-show-password-text="<?= e(I18N::translate('show')) ?>" data-wt-show-password-title="<?= e(I18N::translate('Show password')) ?>" data-wt-hide-password-text="<?= e(I18N::translate('hide')) ?>" data-wt-hide-password-title="<?= e(I18N::translate('Hide password')) ?>">
82            <div class="form-text">
83                <?= I18N::translate('This must be at least six characters long. It is case-sensitive.') ?>
84            </div>
85        </div>
86    </div>
87
88    <div class="row mb-3">
89        <label class="col-form-label col-sm-3" for="wtemail">
90            <?= I18N::translate('Email address') ?>
91        </label>
92        <div class="col-sm-9">
93            <input class="form-control" dir="ltr" id="wtemail" name="wtemail" type="email" value="<?= e($wtemail) ?>" autocomplete="email">
94            <div class="form-text">
95                <?= I18N::translate('This email address will be used to send password reminders, website notifications, and messages from other family members who are registered on the website.') ?>
96            </div>
97        </div>
98    </div>
99
100    <hr>
101
102    <div class="d-flex justify-content-between">
103        <button class="btn btn-primary" name="step" type="submit" value="6">
104            <?= I18N::translate('next') ?>
105        </button>
106
107        <button class="btn btn-secondary" name="step" type="submit" value="4">
108            <?= I18N::translate('previous') ?>
109        </button>
110    </div>
111</form>
112
113<script>
114  document.querySelector('input[name=baseurl]').value = decodeURI(location.href.split('index.php')[0].replace(/\/+$/, ''));
115</script>
116