Skip to content

Commit f808cc9

Browse files
author
Kristan Kenney
committed
Add option to Add User screen, minor toolbar adjustments
1 parent 2a702e6 commit f808cc9

File tree

11 files changed

+36
-21
lines changed

11 files changed

+36
-21
lines changed

web/add/user/index.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,16 @@
8585
unset($output);
8686
}
8787

88+
// Set login restriction
89+
if (empty($_SESSION['error_msg'])) {
90+
if ($_POST['v_login_disabled']) {
91+
if ($_POST['v_login_disabled'] == 'on') { $_POST['v_login_disabled'] = 'yes'; } else { $_POST['v_login_disabled'] = 'no'; }
92+
exec (HESTIA_CMD."v-change-user-config-value ".$v_username." LOGIN_DISABLED ".escapeshellarg($_POST['v_login_disabled']), $output, $return_var);
93+
check_return_code($return_var,$output);
94+
unset($output);
95+
}
96+
}
97+
8898
// Send email to the new user
8999
if ((empty($_SESSION['error_msg'])) && (!empty($v_notify))) {
90100
$to = $_POST['v_notify'];

web/templates/pages/add_user.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,12 @@
102102
</ul>
103103
</td>
104104
</tr>
105-
<tr>
105+
<tr>
106+
<td>
107+
<label><input type="checkbox" size="20" class="vst-checkbox" onclick="javascript:elementHideShow('send-welcome');" name="v_login_disabled" <?php if ($data[$user]['LOGIN_DISABLED'] == "yes") echo "checked=yes" ?>><?php print _('Do not allow user to log in to Control Panel');?></label>
108+
</td>
109+
</tr>
110+
<tr id="send-welcome">
106111
<td class="vst-text input-label">
107112
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_email_notice" id='v_email_notify' value="" tabindex="5" /><?php print _('Send welcome email');?></label>
108113
</td>

web/templates/pages/edit_user.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,11 @@
129129
<meter max="4" id="meter"></meter>
130130
</td>
131131
</tr>
132-
<? if ($_SESSION['userContext'] === 'admin') {?>
133-
<tr>
134-
<td>
135-
<label><input type="checkbox" size="20" class="vst-checkbox" onclick="javascript:elementHideShow('password-details')" name="v_login_disabled" <?php if ($data[$user]['LOGIN_DISABLED'] == "yes") echo "checked=yes" ?>><?php print _('Do not allow user to log in to Control Panel');?></label>
136-
</td>
137-
</tr>
138-
<? } ?>
139132
<tr>
140133
<td>
141-
<table id="password-details" style="<?php if ($data[$user]['LOGIN_DISABLED'] == "yes") { echo 'display: none;'; } else { echo 'display: table-cell;'; }?>">
134+
<table id="password-details">
142135
<tr>
143-
<td class="vst-text step-top">
136+
<td class="vst-text">
144137
<?php print _('Your password must have at least');?>:
145138
<ul>
146139
<li><?php print _('8 characters long');?></li>
@@ -149,8 +142,15 @@
149142
</ul>
150143
</td>
151144
</tr>
145+
<? if ($_SESSION['userContext'] === 'admin') {?>
146+
<tr>
147+
<td>
148+
<label><input type="checkbox" size="20" class="vst-checkbox" onclick="javascript:elementHideShow('password-options');elementHideShow('password-options-ip');" name="v_login_disabled" <?php if ($data[$user]['LOGIN_DISABLED'] == "yes") echo "checked=yes" ?>><?php print _('Do not allow user to log in to Control Panel');?></label>
149+
</td>
150+
</tr>
151+
<? } ?>
152152
<tr>
153-
<td>
153+
<td id="password-options" style="<?php if ($data[$user]['LOGIN_DISABLED'] == "yes") { echo 'display: none;'; } else { echo 'display: table-cell;'; }?>">
154154
<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>
155155
<?php if (!empty($v_twofa)) { ?>
156156
<p><?php echo _('2FA Reset Code:').' '.$v_twofa; ?></br></p>
@@ -160,7 +160,7 @@
160160
</td>
161161
</tr>
162162
<tr>
163-
<td>
163+
<td id="password-options-ip" style="<?php if ($data[$user]['LOGIN_DISABLED'] == "yes") { echo 'display: none;'; } else { echo 'display: table-cell;'; }?>">
164164
<label><input type="checkbox" size="20" class="vst-checkbox" onclick="javascript:elementHideShow('ip-allowlist')" name="v_login_use_iplist" <?php if ($data[$user]['LOGIN_USE_IPLIST'] === "yes") echo "checked=yes" ?>><?php print _('Use IP address allow list for login attempts');?></label>
165165
</td>
166166
</tr>

web/templates/pages/list_cron.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<?=_('sort by');?>: <span>
2424
<b>
2525
<? if ($_SESSION['userSortOrder'] === 'name') { $label = 'Command'; } else { $label = 'Date'; } ?>
26-
<?=_($label)?><i class="fas fa-sort-alpha-down"></i>
26+
<?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
2727
</b>
2828
</span>
2929
</td>

web/templates/pages/list_db.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<?=_('sort by');?>: <span>
4242
<b>
4343
<? if ($_SESSION['userSortOrder'] === 'name') { $label = 'Name'; } else { $label = 'Date'; } ?>
44-
<?=_($label)?><i class="fas fa-sort-alpha-down"></i>
44+
<?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
4545
</b>
4646
</span>
4747
</td>

web/templates/pages/list_dns.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<?=_('sort by');?>: <span>
2222
<b>
2323
<? if ($_SESSION['userSortOrder'] === 'name') { $label = 'Name'; } else { $label = 'Date'; } ?>
24-
<?=_($label)?><i class="fas fa-sort-alpha-down"></i>
24+
<?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
2525
</b>
2626
</span>
2727
</td>

web/templates/pages/list_dns_rec.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<?=_('sort by');?>: <span>
2424
<b>
2525
<? if ($_SESSION['userSortOrder'] === 'name') { $label = 'Record'; } else { $label = 'Date'; } ?>
26-
<?=_($label)?><i class="fas fa-sort-alpha-down"></i>
26+
<?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
2727
</b>
2828
</span>
2929
</td>

web/templates/pages/list_mail.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<?=_('sort by');?>: <span>
2121
<b>
2222
<? if ($_SESSION['userSortOrder'] === 'name') { $label = 'Name'; } else { $label = 'Date'; } ?>
23-
<?=_($label)?><i class="fas fa-sort-alpha-down"></i>
23+
<?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
2424
</b>
2525
</span>
2626
</td>

web/templates/pages/list_mail_acc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<?=_('sort by');?>: <span>
2727
<b>
2828
<? if ($_SESSION['userSortOrder'] === 'name') { $label = 'Name'; } else { $label = 'Date'; } ?>
29-
<?=_($label)?><i class="fas fa-sort-alpha-down"></i>
29+
<?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
3030
</b>
3131
</span>
3232
</td>

web/templates/pages/list_user.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
<td class="sort-by" title="<?=_('Sort items');?>">
2323
<?=_('sort by');?>: <span>
2424
<b>
25-
<? if ($_SESSION['userSortOrder'] === 'name') { $label = 'Domain'; } else { $label = 'Date'; } ?>
26-
<?=_($label)?><i class="fas fa-sort-alpha-down"></i>
25+
<? if ($_SESSION['userSortOrder'] === 'name') { $label = 'Name'; } else { $label = 'Date'; } ?>
26+
<?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
2727
</b>
2828
</span>
2929
</td>

0 commit comments

Comments
 (0)