forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd_user.php
More file actions
131 lines (126 loc) · 4.95 KB
/
add_user.php
File metadata and controls
131 lines (126 loc) · 4.95 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
<!-- Begin toolbar -->
<div class="toolbar">
<div class="toolbar-inner">
<div class="toolbar-buttons">
<a class="button button-secondary" id="btn-back" href="/list/user/">
<i class="fas fa-arrow-left status-icon blue"></i><?= _("Back") ?>
</a>
</div>
<div class="toolbar-buttons">
<button class="button" type="submit" form="vstobjects">
<i class="fas fa-floppy-disk status-icon purple"></i><?= _("Save") ?>
</button>
</div>
</div>
</div>
<!-- End toolbar -->
<div class="container animate__animated animate__fadeIn">
<form
x-data="{
sendWelcomeMail: <?= $v_login_disabled == "yes" ? "true" : "false" ?>
}"
id="vstobjects"
name="v_add_user"
method="post"
>
<input type="hidden" name="token" value="<?=$_SESSION['token']?>">
<input type="hidden" name="ok" value="Add">
<div class="form-container">
<h1 class="form-title"><?= _("Adding User") ?></h1>
<?php show_alert_message($_SESSION);?>
<div class="u-mb10">
<label for="v_username" class="form-label"><?= _("Username") ?></label>
<input type="text" class="form-control" name="v_username" id="v_username" value="<?=htmlentities(trim($v_username, "'"))?>" tabindex="1">
</div>
<div class="u-mb10">
<label for="v_name" class="form-label"><?= _("Contact") ?></label>
<input type="text" class="form-control" name="v_name" id="v_name" value="<?=htmlentities(trim($v_name, "'"))?>" tabindex="2">
</div>
<div class="u-mb10">
<label for="v_email" class="form-label"><?= _("Email") ?></label>
<input type="email" class="form-control" name="v_email" id="v_email" value="<?=htmlentities(trim($v_email, "'"))?>" tabindex="3">
</div>
<div class="u-mb10">
<label for="v_password" class="form-label">
<?= _("Password") ?>
<a href="javascript:applyRandomString();" title="<?= _("generate") ?>" class="u-ml5"><i class="fas fa-arrows-rotate status-icon green icon-large"></i></a>
</label>
<div class="u-pos-relative u-mb10">
<input type="text" class="form-control js-password-input" name="v_password" id="v_password" value="<?=htmlentities(trim($v_password, "'"))?>" tabindex="4">
<meter max="4" class="password-meter"></meter>
</div>
</div>
<p class="u-mb10"><?= _("Your password must have at least") ?>:</p>
<ul class="u-list-bulleted u-mb10">
<li><?= _("8 characters long") ?></li>
<li><?= _("1 uppercase & 1 lowercase character") ?></li>
<li><?= _("1 number") ?></li>
</ul>
<div class="form-check u-mb10">
<input x-model="sendWelcomeMail" class="form-check-input" type="checkbox" name="v_login_disabled" id="v_login_disabled">
<label for="v_login_disabled">
<?= _("Do not allow user to log in to Control Panel") ?>
</label>
</div>
<div x-cloak x-show="sendWelcomeMail" id="send-welcome">
<div class="form-check u-mb10">
<input class="form-check-input" type="checkbox" name="v_email_notice" id="v_email_notify" tabindex="5">
<label for="v_email_notify">
<?= _("Send welcome email") ?>
</label>
</div>
</div>
<div class="u-mb10">
<label for="v_language" class="form-label"><?= _("Language") ?></label>
<select class="form-select" name="v_language" id="v_language" tabindex="6">
<?php
foreach ($languages as $key => $value) {
echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".htmlentities($key)."\"";
if (( $key == $_SESSION['LANGUAGE'] ) && (empty($v_language))){
echo ' selected' ;
}
if (isset($v_language)){
if ( htmlentities($key) == trim($v_language,"'") ){
echo ' selected' ;
}
}
echo ">".htmlentities($value)."</option>\n";
}
?>
</select>
</div>
<div class="u-mb10">
<label for="v_role" class="form-label"><?= _("Role") ?></label>
<select class="form-select" name="v_role" id="v_role">
<option value="user"><?= _("User") ?>
<option value="admin" <?php if($v_role == "admin" ){ echo "selected"; } ?>><?= _("Administrator") ?>
<option value="dns-cluster" <?php if($v_role == "dns-cluster" ){ echo "selected"; } ?>><?= _("DNS Sync user") ?>
</select>
</div>
<div class="u-mb10">
<label for="v_package" class="form-label"><?= _("Package") ?></label>
<select class="form-select" name="v_package" id="v_package" tabindex="8">
<?php
foreach ($data as $key => $value) {
echo "\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"".htmlentities($key)."\"";
if ((!empty($v_package)) && ( $key == $_POST['v_package'])){
echo 'selected' ;
} else {
if ( $key == 'default'){
echo 'selected' ;
}
}
echo ">".htmlentities($key)."</option>\n";
}
?>
</select>
</div>
<div class="u-mb10">
<label for="v_notify" class="form-label">
<?= _("Send login credentials to email address") ?>
</label>
<input type="email" class="form-control" name="v_notify" id="v_notify" value="<?=htmlentities(trim($v_notify, "'"))?>" tabindex="8">
</div>
</div>
</form>
</div>