forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit_user.html
More file actions
339 lines (329 loc) · 21.1 KB
/
edit_user.html
File metadata and controls
339 lines (329 loc) · 21.1 KB
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
<div class="l-center edit">
<div class="l-sort clearfix">
<div class="l-unit-toolbar__buttonstrip">
<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/user/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
<? if (($_SESSION['user'] == $v_username) || (isset($_SESSION['look']))) {?>
<a href="/list/key/" id="btn-create" class="ui-button cancel" dir="ltr" title="<?=_('Manage SSH keys');?>"><i class="fas fa-key status-icon orange"></i><?=_('Manage SSH keys')?></a>
<a href="/list/log/" id="btn-create" class="ui-button cancel" dir="ltr" title="<?=_('Logs');?>"><i class="fas fa-history status-icon maroon"></i><?=_('Logs')?></a>
<? } ?>
</div>
<div class="l-unit-toolbar__buttonstrip float-right">
<? if (($_SESSION['user'] == $v_username) || (isset($_SESSION['look']))) {?>
<!-- Do not show delete button for currently logged in user-->
<?} else {?>
<a href="/login/?loginas=<?=$v_username?>&token=<?=$_SESSION['token']?>" id="btn-create" class="ui-button cancel" dir="ltr" title="<?=_('login as')?>"><i class="fas fa-sign-in-alt status-icon maroon"></i><?=_('login as')?></a>
<div class="actions-panel display-inline-block" key-action="js">
<a class="data-controls do_delete ui-button danger cancel">
<i class="do_delete fas fa-times-circle status-icon red"></i>
<?=_('Delete')?>
<input type="hidden" name="delete_url" value="/delete/user/?user=<?=$v_username?>&token=<?=$_SESSION['token']?>" />
<div class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
<p class="confirmation"><?=sprintf(_('DELETE_USER_CONFIRMATION'),$v_username)?></p>
</div>
</a>
</div>
<? } ?>
<a href="#" class="ui-button" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i> <?=_('Save')?></a>
</div>
</div>
</div>
<div class="l-separator"></div>
<div class="l-center animated fadeIn">
<?php
$back = $_SESSION['back'];
if (empty($back)) {
$back = "location.href='/list/user/'";
} else {
$back = "location.href='".$back."'";
}
?>
<form id="vstobjects" method="post" name="v_edit_user" class="<?=$v_status?>">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="save" value="save" />
<table class='data'>
<tr class="data-add">
<td class="data-dotted">
<table class="data-col1">
<tr>
<td>
</td>
</tr>
</table>
</td>
<td class="data-dotted">
<table class="data-col2">
<tr>
<td class="step-top">
<span class="page-title"><?=_('Editing User')?></span>
</td>
</tr>
<tr>
<td>
<?php
if (!empty($_SESSION['error_msg'])) {
echo "<span class=\"vst-error\"> <i class=\"fas fa-exclamation-circle status-icon red\"></i> ".htmlentities($_SESSION['error_msg'])."</span>";
} else {
if (!empty($_SESSION['ok_msg'])) {
echo "<span class=\"vst-ok\"> <i class=\"fas fa-check-circle status-icon green\"></i> ".$_SESSION['ok_msg']."</span>";
}
}
?>
</td>
</tr>
<tr>
<td class="vst-text step-top">
<?php print _('Username');?>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_user" value="<?=htmlentities(trim($v_username, "'"))?>" disabled>
<input type="hidden" name="v_username" value="<?=htmlentities(trim($v_username, "'"))?>">
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print _('Contact');?>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_name" value="<?=htmlentities(trim($v_name, "'"))?>">
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print _('Email');?>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_email" value="<?=htmlentities(trim($v_email, "'"))?>">
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print _('Password');?> <a href="javascript:randomString();" title="<?php print _('generate');?>"><i class="fas fa-sync status-icon green icon-large"></i></a>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input password" name="v_password" value="<?=htmlentities(trim($v_password, "'"))?>"><br />
<meter max="4" id="meter"></meter>
</td>
</tr>
<tr>
<td class="vst-text">
<?php print _('Your password must have at least');?>:
<ul>
<li><?php print _('8 characters long');?></li>
<li><?php print _('1 uppercase & 1 lowercase character');?></li>
<li><?php print _('1 number');?></li>
</ul>
</td>
</tr>
<tr>
<td>
<label><input type="checkbox" class="vst-checkbox password-option" name="v_twofa" <?php if(!empty($v_twofa)) echo "checked=yes" ?>><?php print _('Enable 2FA');?></label>
<?php if (!empty($v_twofa)) { ?>
<p><?php echo _('2FA Reset Code:').' '.$v_twofa; ?></br></p>
<p><?php echo _('Please scan the code below in your 2FA application:'); ?></p>
<div><img class="qr-code" src="<?php echo $v_qrcode; ?>"></div>
<?php } ?>
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print _('Language');?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_language">
<?php
foreach ($languages as $key => $value) {
echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".$key."\"";
$skey = "'".$key."'";
if (( $key == $v_language ) || ( $skey == $v_language)){
echo 'selected' ;
}
if (( $key == detect_user_language() ) && (empty($v_language))){
echo 'selected' ;
}
echo ">".htmlentities($value)."</option>\n";
}
?>
</select>
</td>
</tr>
<?php if ($v_username == 'admin') {?>
<!-- Hide option to change 'admin' user's role-->
<? } else { ?>
<? if (($_SESSION['userContext'] === 'admin') && ($_SESSION['user'] != $v_username)) {?>
<tr>
<td class="vst-text input-label">
<?php print _('Role');?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_role">
<option value="user"><?php print _('User');?>
<option value="admin" <?php if($v_role == "admin" ){ echo "selected"; } ?> ><?php print _('Administrator');?>
</select>
</td>
</tr>
<? } ?>
<? } ?>
<tr>
<td class="vst-text input-label">
<?php print _('Package');?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_package">
<?php
foreach ($packages as $key => $value) {
echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".htmlentities($key)."\"";
$skey = "'".$key."'";
if (( $key == $v_package ) || ( $skey == $v_package)){
echo 'selected' ;
}
echo ">".htmlentities($key)."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td class="step-top vst-text" style="/*padding: 32px 0 20px 0;*/">
<a href="javascript:elementHideShow('advanced-opts');" class="vst-advanced"><?php print _('Advanced options');?></a>
</td>
</tr>
<tr>
<td class="step-top">
<table id="advanced-opts" style="display: none;">
<tr>
<td class="vst-text input-label">
<?php print _('SSH Access');?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_shell">
<?php
foreach ($shells as $key => $value) {
echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
$svalue = "'".$value."'";
if (( $value == $v_shell ) || ($svalue == $v_shell )){
echo 'selected' ;
}
echo ">".htmlentities($value)."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print _('PHP CLI Version');?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_phpcli">
<?php
foreach ($php_versions as $key => $value) {
$php = explode('-',$value);
echo "\t\t\t\t<option value=\"".$value."\"";
$svalue = "'".$value."'";
if ((!empty($v_phpcli)) && ( $value == $v_phpcli ) || ($svalue == $v_phpcli)){
echo ' selected' ;
}
if ((empty($v_phpcli)) && ($value == DEFAULT_PHP_VERSION)){
echo ' selected' ;
}
echo ">".htmlentities($value)."</option>\n";
}
?>
</select>
</td>
</tr>
<?php if ((isset($_SESSION['DNS_SYSTEM'])) && (!empty($_SESSION['DNS_SYSTEM']))) {?>
<tr>
<td class="vst-text input-label">
<?php print _('Default Name Servers');?>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_ns1" value="<?=htmlentities(trim($v_ns1, "'"))?>">
<span class="remove-ns additional-control delete vst-advanced button danger"><?=_('delete')?></span>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_ns2" value="<?=htmlentities(trim($v_ns2, "'"))?>">
<span class="remove-ns additional-control delete vst-advanced button danger"><?=_('delete')?></span>
</td>
</tr>
<? if($v_ns3)
echo '<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_ns3" value="'.htmlentities(trim($v_ns3, "'")).'">
<span class="remove-ns additional-control delete vst-advanced button danger">'._('delete').'</span>
</td>
</tr>';
if($v_ns4)
echo '<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_ns4" value="'.htmlentities(trim($v_ns4, "'")).'">
<span class="remove-ns additional-control delete vst-advanced button danger">'._('delete').'</span>
</td>
</tr>';
if($v_ns5)
echo '<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_ns5" value="'.htmlentities(trim($v_ns5, "'")).'">
<span class="remove-ns additional-control delete vst-advanced button danger">'._('delete').'</span>
</td>
</tr>';
if($v_ns6)
echo '<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_ns6" value="'.htmlentities(trim($v_ns6, "'")).'">
<span class="remove-ns additional-control delete vst-advanced button danger">'._('delete').'</span>
</td>
</tr>';
if($v_ns7)
echo '<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_ns7" value="'.htmlentities(trim($v_ns7, "'")).'">
<span class="remove-ns additional-control delete vst-advanced button danger">'._('delete').'</span>
</td>
</tr>';
if($v_ns8)
echo '<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_ns8" value="'.htmlentities(trim($v_ns8, "'")).'">
<span class="remove-ns additional-control delete vst-advanced button danger">'._('delete').'</span>
</td>
</tr>';
?>
<tr class="add-ns" <? if($v_ns8) echo 'style="display:none;"'; ?> >
<td class="step-top-small">
<span class="add-ns-button vst-advanced button"><?=_('Add one more Name Server')?></span>
</td>
</tr>
<?php } ?>
</table>
</td>
</tr>
</table>
<table class="data-col2"></table>
</td>
</tr>
</table>
</form>
</div>