Skip to content

Commit 63d49d4

Browse files
author
Kristan Kenney
committed
Discourage use of admin account for web domains
1 parent fc177d6 commit 63d49d4

File tree

1 file changed

+59
-43
lines changed

1 file changed

+59
-43
lines changed

web/templates/admin/add_web.html

Lines changed: 59 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/web/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
55
</div>
66
<div class="l-unit-toolbar__buttonstrip float-right">
7-
<a href="#" class="ui-button" title="<?=_('Save')?>" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
7+
<? if (($user == 'admin') && (($_GET['accept'] === "true")) || ($user !== "admin")) {?>
8+
<a href="#" class="ui-button" title="<?=_('Save')?>" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
9+
<?}?>
810
</div>
911
</div>
1012
</div>
@@ -51,57 +53,71 @@
5153
}
5254
?>
5355
</span>
54-
<?php if ($user == 'admin') { ?>
56+
</td>
57+
</tr>
58+
<? if (($user == 'admin') && (($_GET['accept'] !== "true"))) {?>
59+
<tr>
60+
<td class="step-top">
5561
<span class="alert alert-danger alert-with-icon">
5662
<i class="fas fa-exclamation"></i>
5763
<?=_('Avoid adding web domains on admin account')?>
5864
</span>
59-
<?php } ?>
60-
</td>
61-
</tr>
62-
<tr>
63-
<td class="vst-text step-top">
64-
<?php print _('Domain');?>
65-
</td>
66-
</tr>
67-
<tr>
68-
<td>
69-
<input type="text" size="20" class="vst-input" name="v_domain" id="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>">
70-
</td>
71-
</tr>
72-
<tr>
73-
<td class="vst-text input-label">
74-
<?php print _('IP address');?>
75-
</td>
76-
</tr>
77-
<tr>
78-
<td>
79-
<select class="vst-list" name="v_ip">
80-
<?php
81-
foreach ($ips as $ip => $value) {
82-
$display_ip = htmlentities(empty($value['NAT']) ? $ip : "{$value['NAT']}");
83-
$ip_selected = (!empty($v_ip) && $ip == $_POST['v_ip']) ? 'selected' : '';
84-
echo "\t\t\t\t<option value=\"{$ip}\" {$ip_selected}>{$display_ip}</option>\n";
85-
}
86-
?>
87-
</select>
8865
</td>
8966
</tr>
90-
<tr><td class="input-label"></td></tr>
91-
<?php if ((isset($_SESSION['DNS_SYSTEM'])) && (!empty($_SESSION['DNS_SYSTEM']))) {?>
92-
<?php if($panel[$user]['DNS_DOMAINS'] != "0") { ?><tr>
93-
<td class="vst-text input-label">
94-
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_dns" <?php if (empty($v_dns)&&$panel[$user]['DNS_DOMAINS'] != "0") ?>><?php print _('DNS Support');?></label>
95-
</td>
96-
</tr><?php } ?>
9767
<?php } ?>
98-
<?php if ((isset($_SESSION['IMAP_SYSTEM'])) && (!empty($_SESSION['IMAP_SYSTEM']))) {?>
99-
<?php if($panel[$user]['MAIL_DOMAINS'] != "0") { ?><tr>
68+
<? if (($user == 'admin') && (empty($_GET['accept']))) {?>
69+
<tr>
70+
<td class="step-top">
71+
<span><a href="/add/user/" class="vst-advanced" style="padding-left: 67px !important;padding-right: 67px !important;"><?=_('Add User')?></a></span>
72+
<span><a href="/add/web/?accept=true" class="vst-advanced" style="padding-left: 67px !important;padding-right: 67px !important;"><?=_('Continue')?></a> </span>
73+
</td>
74+
</tr>
75+
<? } ?>
76+
<? if (($user == 'admin') && (($_GET['accept'] === "true")) || ($user !== "admin")) {?>
77+
<tr>
78+
<td class="vst-text step-top">
79+
<?php print _('Domain');?>
80+
</td>
81+
</tr>
82+
<tr>
83+
<td>
84+
<input type="text" size="20" class="vst-input" name="v_domain" id="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>">
85+
</td>
86+
</tr>
87+
<tr>
10088
<td class="vst-text input-label">
101-
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_mail" <?php if (empty($v_mail)&&$panel[$user]['MAIL_DOMAINS'] != "0") ?>><?php print _('Mail Support');?></label>
89+
<?php print _('IP address');?>
10290
</td>
103-
</tr><?php } ?>
104-
<?php } ?>
91+
</tr>
92+
<tr>
93+
<td>
94+
<select class="vst-list" name="v_ip">
95+
<?php
96+
foreach ($ips as $ip => $value) {
97+
$display_ip = htmlentities(empty($value['NAT']) ? $ip : "{$value['NAT']}");
98+
$ip_selected = (!empty($v_ip) && $ip == $_POST['v_ip']) ? 'selected' : '';
99+
echo "\t\t\t\t<option value=\"{$ip}\" {$ip_selected}>{$display_ip}</option>\n";
100+
}
101+
?>
102+
</select>
103+
</td>
104+
</tr>
105+
<tr><td class="input-label"></td></tr>
106+
<?php if ((isset($_SESSION['DNS_SYSTEM'])) && (!empty($_SESSION['DNS_SYSTEM']))) {?>
107+
<?php if($panel[$user]['DNS_DOMAINS'] != "0") { ?><tr>
108+
<td class="vst-text input-label">
109+
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_dns" <?php if (empty($v_dns)&&$panel[$user]['DNS_DOMAINS'] != "0") ?>><?php print _('DNS Support');?></label>
110+
</td>
111+
</tr><?php } ?>
112+
<?php } ?>
113+
<?php if ((isset($_SESSION['IMAP_SYSTEM'])) && (!empty($_SESSION['IMAP_SYSTEM']))) {?>
114+
<?php if($panel[$user]['MAIL_DOMAINS'] != "0") { ?><tr>
115+
<td class="vst-text input-label">
116+
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_mail" <?php if (empty($v_mail)&&$panel[$user]['MAIL_DOMAINS'] != "0") ?>><?php print _('Mail Support');?></label>
117+
</td>
118+
</tr><?php } ?>
119+
<?php } ?>
120+
<? } ?>
105121
<!--
106122
<tr>
107123
<td class="step-top vst-text" style="/*padding: 32px 0 20px 0;*/">

0 commit comments

Comments
 (0)