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