xref: /webtrees/resources/views/setup/step-4-database-pgsql.phtml (revision 61351a03dbeb5920221fcb08c904615fe551fd3a)
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="wtname" type="hidden" value="<?= e($wtname) ?>">
31    <input name="wtuser" type="hidden" value="<?= e($wtuser) ?>">
32    <input name="wtpass" type="hidden" value="<?= e($wtpass) ?>">
33    <input name="wtemail" type="hidden" value="<?= e($wtemail) ?>">
34
35    <h2>
36        <?= I18N::translate('Database connection') ?> – PostgreSQL
37    </h2>
38
39    <?php foreach ($errors as $error) : ?>
40        <p class="alert alert-danger"><?= $error ?></p>
41    <?php endforeach ?>
42
43    <?php foreach ($warnings as $warning) : ?>
44        <p class="alert alert-warning"><?= $warning ?></p>
45    <?php endforeach ?>
46
47    <div class="row mb-3">
48        <label class="col-form-label col-sm-3" for="dbhost">
49            <?= I18N::translate('Server name') ?>
50        </label>
51        <div class="col-sm-9">
52            <input class="form-control" id="dbhost" name="dbhost" type="text" value="<?= e($dbhost) ?>" dir="ltr">
53            <div class="form-text">
54                <?= I18N::translate('Most sites are configured to use localhost. This means that your database runs on the same computer as your web server.') ?>
55            </div>
56        </div>
57    </div>
58
59    <div class="row mb-3">
60        <label class="col-form-label col-sm-3" for="dbport">
61            <?= I18N::translate('Port number') ?>
62        </label>
63        <div class="col-sm-9">
64            <input class="form-control" id="dbport" name="dbport" pattern="\d+" type="text" value="<?= e($dbport) ?>" dir="ltr">
65            <div class="form-text">
66                <?= I18N::translate('Most sites are configured to use the default value of 5432.') ?>
67            </div>
68        </div>
69    </div>
70
71    <div class="row mb-3">
72        <label class="col-form-label col-sm-3" for="dbuser">
73            <?= I18N::translate('Database user account') ?>
74        </label>
75        <div class="col-sm-9">
76            <input class="form-control" id="dbuser" name="dbuser" type="text" value="<?= e($dbuser) ?>" dir="ltr">
77            <div class="form-text">
78                <?= I18N::translate('This is case sensitive.') ?>
79            </div>
80        </div>
81    </div>
82
83    <div class="row mb-3">
84        <label class="col-form-label col-sm-3" for="dbpass">
85            <?= I18N::translate('Database password') ?>
86        </label>
87        <div class="col-sm-9">
88            <input class="form-control" id="dbpass" name="dbpass" type="password" value="<?= e($dbpass) ?>" dir="ltr" autocomplete="off" 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')) ?>">
89            <div class="form-text">
90                <?= I18N::translate('This is case sensitive.') ?>
91            </div>
92        </div>
93    </div>
94
95    <div class="row mb-3">
96        <label class="col-form-label col-sm-3" for="dbname">
97            <?= I18N::translate('Database name') ?>
98        </label>
99        <div class="col-sm-9">
100            <input class="form-control" dir="ltr" id="dbname" name="dbname" pattern="[^`'&quot;]{1,63}" type="text" value="<?= e($dbname) ?>">
101        </div>
102    </div>
103
104    <div class="row mb-3">
105        <label class="col-form-label col-sm-3" for="tblpfx">
106            <?= I18N::translate('Table prefix') ?>
107        </label>
108        <div class="col-sm-9">
109            <input class="form-control" dir="ltr" id="tblpfx" maxlength="15"  name="tblpfx" pattern="[a-zA-Z0-9_]+" type="text" value="<?= e($tblpfx) ?>">
110            <div class="form-text">
111                <?= I18N::translate('The prefix is optional, but recommended. By giving the table names a unique prefix you can let several different applications share the same database.') ?>
112                <?= I18N::translate('Use letters A-Z, a-z, digits 0-9, or underscores') ?>
113            </div>
114        </div>
115    </div>
116
117    <hr>
118
119    <div class="d-flex justify-content-between">
120        <button class="btn btn-primary" name="step" type="submit" value="5">
121            <?= I18N::translate('next') ?>
122        </button>
123
124        <button class="btn btn-secondary" name="step" type="submit" value="3">
125            <?= I18N::translate('previous') ?>
126        </button>
127    </div>
128</form>
129