aboutsummaryrefslogtreecommitdiff
path: root/app/views/settings/account/index.php
blob: eaa2631a387e6b21771058ca7e97471499a044e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<?php
$genders = [
        _('unbekannt'),
        _('männlich'),
        _('weiblich'),
        _('divers'),
];
?>

<? if ($user->auth_plugin !== 'standard'): ?>
    <?= MessageBox::info(Config::get()->PERSONAL_DETAILS_INFO_TEXT) ?>
<? endif; ?>

<? if ($locked_info): ?>
    <?= MessageBox::info(formatLinks($locked_info)) ?>
<? endif; ?>

<form id="edit_userdata" method="post" name="pers" class="default"
      action="<?= $controller->link_for('settings/account/store') ?>"
        <? if (!$restricted) echo 'data-validate="true"'; ?>>
    <?= CSRFProtection::tokenTag() ?>
    <input type="hidden" name="studip_ticket" value="<?= get_ticket() ?>">
    <fieldset>
        <legend>
            <?= _('Persönliche Angaben bearbeiten') ?>
        </legend>
        <label for="new_username">
               <span class="required">
                    <?= _('Nutzername') ?>
               </span>
            <? if ($restricted) : ?>
                <?= tooltipIcon('Dieses Feld dürfen Sie nicht ändern, Adminzugriff ist hier nicht erlaubt!') ?>
            <? endif ?>
            <input required type="text" name="new_username" id="new_username"
                   pattern="<?= htmlReady(trim($validator->username_regular_expression, '/i^$()')) ?>"
                   data-message="<?= _('Der Benutzername ist unzulässig. Er muss mindestens 4 Zeichen lang sein und darf keine Sonderzeichen oder Leerzeichen enthalten.') ?>"
                   value="<?= $user['username'] ?>"
                   autocorrect="off" autocapitalize="off"
                    <? if ($restricted || !$controller->shallChange('auth_user_md5.username')) echo 'disabled'; ?>>
        </label>
        <label class="col-3">
            <span class="required">
                <?= _('Vorname') ?>
            </span>
            <? if ($restricted) : ?>
                <?= tooltipIcon('Dieses Feld dürfen Sie nicht ändern, Adminzugriff ist hier nicht erlaubt!') ?>
            <? endif ?>
            <input required type="text" name="vorname"
                   pattern="<?= htmlReady(trim($validator->name_regular_expression, '/i^$()')) ?>"
                   value="<?= htmlReady($user['Vorname']) ?>"
                    <? if ($restricted || !$controller->shallChange('auth_user_md5.Vorname', 'name')) echo 'disabled'; ?>>
        </label>
        <label class="col-3">
            <span class="required">
                <?= _('Nachname') ?>
            </span>
            <? if ($restricted) : ?>
                <?= tooltipIcon('Dieses Feld dürfen Sie nicht ändern, Adminzugriff ist hier nicht erlaubt!') ?>
            <? endif ?>
            <input required type="text" name="nachname"
                   pattern="<?= htmlReady(trim($validator->name_regular_expression, '/i^$()')) ?>"
                   data-message="<?= _('Bitte geben Sie Ihren tatsächlichen Nachnamen an.') ?>"
                   value="<?= htmlReady($user['Nachname']) ?>"
                    <? if ($restricted || !$controller->shallChange('auth_user_md5.Nachname', 'name')) echo 'disabled'; ?>>
        </label>
        <label class="col-3">
            <?= _('Titel') ?>
            <select id="title_front_chooser" name="title_front_chooser"
                    aria-label="<?= _('Titel auswählen') ?>"
                    data-target="#title_front"
                    <? if (!$controller->shallChange('user_info.title_front', 'title')) echo 'disabled'; ?>>
                <? foreach ($GLOBALS['TITLE_FRONT_TEMPLATE'] as $title): ?>
                    <option <? if ($user['title_front'] == $title) echo 'selected'; ?>>
                        <?= htmlReady($title) ?>
                    </option>
                <? endforeach; ?>
            </select>
        </label>
        <label class="col-3">
            <?= _('Titel eingeben') ?>
            <input type="text" name="title_front" id="title_front"
                   data-target="#title_front_chooser"
                   value="<?= htmlReady($user['title_front']) ?>"
                    <? if (!$controller->shallChange('user_info.title_front', 'title')) echo 'disabled'; ?>>
        </label>
        <label class="col-3">
            <?= _('Titel nachgest.') ?>
            <select name="title_rear_chooser" id="title_rear_chooser"
                    aria-label="<?= _('Titel nachgestellt auswählen') ?>"
                    data-target="#title_rear"
                    <? if (!$controller->shallChange('user_info.title_rear', 'title')) echo 'disabled'; ?>>
                <? foreach ($GLOBALS['TITLE_REAR_TEMPLATE'] as $title): ?>
                    <option <? if ($user['title_rear'] == $title) echo 'selected'; ?>>
                        <?= htmlReady($title) ?>
                    </option>
                <? endforeach; ?>
            </select>
        </label>
        <label class="col-3">
            <?= _('Titel nachgest. eingeben') ?>
            <input type="text" name="title_rear" id="title_rear"
                   data-target="#title_rear_chooser"
                   value="<?= htmlReady($user['title_rear']) ?>"
                    <? if (!$controller->shallChange('user_info.title_rear', 'title')) echo 'disabled'; ?>>
        </label>
    </fieldset>
    <fieldset>
        <legend>
            <?= _('E-Mail') ?>
            <? if ($restricted) : ?>
                <?= tooltipIcon('Dieses Feld dürfen Sie nicht ändern, Adminzugriff ist hier nicht erlaubt!') ?>
            <? endif ?>
        </legend>
        <label class="col-3">
            <span class="required"><?= _('E-Mail') ?></span>
            <input required type="email" name="email1" id="email1"
                   value="<?= htmlReady($user['Email']) ?>"
                    <? if ($restricted || !$controller->shallChange('auth_user_md5.Email')) echo 'disabled'; ?>>
        </label>
        <label class="col-3">
            <span class="required"><?= _('E-Mail Wiederholung') ?></span>
            <input required type="email" name="email2" id="email2"
                   value="<?= htmlReady($user['Email']) ?>"
                   data-must-equal="#email1"
                    <? if ($restricted || !$controller->shallChange('auth_user_md5.Email')) echo 'disabled'; ?>>
        </label>

        <? if (!$is_sso && !$restricted && $controller->shallChange('auth_user_md5.Email')): ?>
            <label class="divider email-change-confirm">

                        <span id="email-change-confirm">
                            <?= _('Falls Sie Ihre E-Mail-Adresse ändern, muss diese Änderung durch die Eingabe '
                                  . 'Ihres Passworts bestätigt werden:') ?>
                        </span>
                <input type="text" name="disable_autofill" style="display: none;">
                <input type="password" name="password" aria-labelledby="email-change-confirm">
            </label>
        <? endif; ?>

    </fieldset>
    <fieldset>
        <legend>
            <?= _('Geschlecht') ?>
        </legend>

        <? foreach ($genders as $index => $gender): ?>
            <label>
                <input type="radio" name="geschlecht" value="<?= $index ?>"
                        <? if ($user['geschlecht'] == $index) echo 'checked'; ?>
                        <? if (!$controller->shallChange('user_info.geschlecht', 'gender')) echo 'disabled'; ?>>
                <?= htmlReady($gender) ?>
            </label>
        <? endforeach; ?>
    </fieldset>

    <footer>
        <?= Studip\Button::create(_('Übernehmen'), 'store', ['title' => _('Änderungen übernehmen')]) ?>
    </footer>
</form>