xref: /webtrees/resources/views/setup/step-4-database-pgsql.phtml (revision f24a8589f7d8400d503c5bb64be9ca10e1637659)
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>
78    </div>
79
80    <div class="row mb-3">
81        <label class="col-form-label col-sm-3" for="dbpass">
82            <?= I18N::translate('Database password') ?>
83        </label>
84        <div class="col-sm-9">
85            <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')) ?>">
86        </div>
87    </div>
88
89    <div class="row mb-3">
90        <label class="col-form-label col-sm-3" for="dbname">
91            <?= I18N::translate('Database name') ?>
92        </label>
93        <div class="col-sm-9">
94            <input class="form-control" dir="ltr" id="dbname" name="dbname" pattern="[^`'&quot;]{1,63}" type="text" value="<?= e($dbname) ?>">
95        </div>
96    </div>
97
98    <div class="row mb-3">
99        <label class="col-form-label col-sm-3" for="tblpfx">
100            <?= I18N::translate('Table prefix') ?>
101        </label>
102        <div class="col-sm-9">
103            <input class="form-control" dir="ltr" id="tblpfx" maxlength="15"  name="tblpfx" pattern="[a-zA-Z0-9_]+" type="text" value="<?= e($tblpfx) ?>">
104            <div class="form-text">
105                <?= 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.') ?>
106                <?= I18N::translate('Use letters A-Z, a-z, digits 0-9, or underscores') ?>
107            </div>
108        </div>
109    </div>
110
111    <hr>
112
113    <div class="d-flex justify-content-between">
114        <button class="btn btn-primary" name="step" type="submit" value="5">
115            <?= I18N::translate('next') ?>
116        </button>
117
118        <button class="btn btn-secondary" name="step" type="submit" value="3">
119            <?= I18N::translate('previous') ?>
120        </button>
121    </div>
122</form>
123