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