xref: /webtrees/resources/views/admin/users-create.phtml (revision 3f0247b283a74c64ac885446380ea81de9cf779e)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
4use Fisharebest\Webtrees\Http\RequestHandlers\UserAddAction;
5use Fisharebest\Webtrees\Http\RequestHandlers\UserListPage;
6use Fisharebest\Webtrees\I18N;
7use Fisharebest\Webtrees\View;
8
9/**
10 * @var string $email
11 * @var string $real_name
12 * @var string $title
13 * @var string $username
14 */
15
16?>
17
18<?= view('components/breadcrumbs', ['links' => [
19    route(ControlPanel::class) => I18N::translate('Control panel'),
20    route(UserListPage::class) => I18N::translate('User administration'),
21    $title,
22]]) ?>
23
24<h1><?= $title ?></h1>
25
26<form method="post" action="<?= e(route(UserAddAction::class)) ?>" class="form-horizontal" autocomplete="off">
27    <!-- REAL NAME -->
28    <div class="row mb-3">
29        <label class="col-sm-3 col-form-label" for="real_name">
30            <?= I18N::translate('Real name') ?>
31        </label>
32        <div class="col-sm-9">
33            <input class="form-control" type="text" id="real_name" name="real_name" required="required" maxlength="64" value="<?= e($real_name) ?>" dir="auto">
34            <div class="form-text">
35                <?= I18N::translate('This is your real name, as you would like it displayed on screen.') ?>
36            </div>
37        </div>
38    </div>
39
40    <!-- USER NAME -->
41    <div class="row mb-3">
42        <label class="col-sm-3 col-form-label" for="username">
43            <?= I18N::translate('Username') ?>
44        </label>
45        <div class="col-sm-9">
46            <input class="form-control" type="text" id="username" name="username" required="required" maxlength="32" value="<?= e($username) ?>" dir="auto">
47            <div class="form-text">
48                <?= I18N::translate('Usernames are case-insensitive and ignore accented letters, so that “chloe”, “chloë”, and “Chloe” are considered to be the same.') ?>
49            </div>
50        </div>
51    </div>
52
53    <!-- PASSWORD -->
54    <div class="row mb-3">
55        <label class="col-sm-3 col-form-label" for="password">
56            <?= I18N::translate('Password') ?>
57        </label>
58        <div class="col-sm-9">
59            <input class="form-control" type="password" id="password" name="password" pattern = ".{8,}" placeholder="<?= I18N::plural('Use at least %s character.', 'Use at least %s characters.', 8, I18N::number(8)) ?>" required="required" autocomplete="new-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')) ?>">
60            <div class="form-text">
61                <?= I18N::translate('Passwords must be at least 8 characters long and are case-sensitive, so that “secret” is different from “SECRET”.') ?>
62            </div>
63        </div>
64    </div>
65
66    <!-- EMAIL ADDRESS -->
67    <div class="row mb-3">
68        <label class="col-sm-3 col-form-label" for="email">
69            <?= I18N::translate('Email address') ?>
70        </label>
71        <div class="col-sm-9">
72            <input class="form-control" type="email" id="email" name="email" required="required" maxlength="64" value="<?= e($email) ?>">
73            <div class="form-text">
74                <?= 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.') ?>
75            </div>
76        </div>
77    </div>
78
79    <div class="row mb-3">
80        <div class="offset-sm-3 col-sm-9">
81            <button type="submit" class="btn btn-primary">
82                <?= I18N::translate('save') ?>
83            </button>
84        </div>
85    </div>
86
87    <?= csrf_field() ?>
88</form>
89
90<?php View::push('javascript') ?>
91<script>
92  function regex_quote(str) {
93    return str.replace(/[\\.?+*()[\]{}|]/g, "\\$&");
94  }
95</script>
96<?php View::endpush() ?>
97