forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd_web.html
More file actions
399 lines (389 loc) · 25.3 KB
/
add_web.html
File metadata and controls
399 lines (389 loc) · 25.3 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
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
<div class="l-center edit">
<div class="l-sort clearfix">
<div class="l-unit-toolbar__buttonstrip">
<a class="ui-button cancel" id="btn-back" href="/list/web/"><i class="fas fa-arrow-left status-icon blue"></i> <?=__('Back')?></a>
</div>
<div class="l-unit-toolbar__buttonstrip float-right">
<a href="#" class="ui-button" title="<?=__('Save')?>" 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>
<!-- /.l-separator -->
<div class="l-center animated fadeIn">
<?php
$back = $_SESSION['back'];
if (empty($back)) {
$back = "location.href='/list/web/'";
} else {
$back = "location.href='".$back."'";
}
?>
<form id="vstobjects" name="v_add_web" method="post">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="ok" value="Add" />
<table class="data mode-add">
<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"><?=__('Add Web Domain')?></span>
<br>
<span>
<?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>";
}
}
?>
</span>
<?php if ($user == 'admin') { ?>
<span class="alert alert-danger alert-with-icon">
<i class="fas fa-exclamation"></i>
<?=__('Avoid adding web domains on admin account')?>
</span>
<?php } ?>
</td>
</tr>
<tr>
<td class="vst-text step-top">
<?php print __('Domain');?>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_domain" id="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>">
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('IP address');?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_ip">
<?php
foreach ($ips as $ip => $value) {
$display_ip = htmlentities(empty($value['NAT']) ? $ip : "{$value['NAT']}");
$ip_selected = (!empty($v_ip) && $ip == $_POST['v_ip']) ? 'selected' : '';
echo "\t\t\t\t<option value=\"{$ip}\" {$ip_selected}>{$display_ip}</option>\n";
}
?>
</select>
</td>
</tr>
<?php if ((isset($_SESSION['DNS_SYSTEM'])) && (!empty($_SESSION['DNS_SYSTEM']))) {?>
<?php if($panel[$user]['DNS_DOMAINS'] != "0") { ?><tr>
<td class="vst-text input-label">
<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>
</td>
</tr><?php } ?>
<?php } ?>
<?php if ((isset($_SESSION['IMAP_SYSTEM'])) && (!empty($_SESSION['IMAP_SYSTEM']))) {?>
<?php if($panel[$user]['MAIL_DOMAINS'] != "0") { ?><tr>
<td class="vst-text input-label">
<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>
</td>
</tr><?php } ?>
<?php } ?>
<tr>
<td class="step-top vst-text" style="/*padding: 32px 0 20px 0;*/">
<a href="javascript:elementHideShow('advtable');" class="vst-advanced"><?php print __('Advanced options');?> <i class="fas fa-arrow-circle-right"></i></a>
</td>
</tr>
</table>
<table class="data-col2" width="600px" style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="advtable">
<tr>
<td class="vst-text input-label">
<?php print __('Aliases');?>
</td>
</tr>
<tr>
<td>
<textarea size="20" class="vst-textinput short" name="v_aliases" id="v_aliases" ><?=htmlentities(trim($v_aliases, "'"))?></textarea>
</td>
</tr>
<?php if (!empty($_SESSION['PROXY_SYSTEM'])) { echo ""; ?>
<tr>
<td class="vst-text step-top" >
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_proxy" <?php if ($v_proxy !== 'off') echo "checked=yes" ?> onclick="javascript:elementHideShow('proxytable');"> <?php print __('Proxy Support');?></label>
</td>
</tr>
<tr>
<td>
<table style="display:<?php if ($v_proxy == 'off') { echo 'none';} else {echo 'block';}?>;" id="proxytable" >
<tr>
<td class="vst-text input-label step-left">
<?php print __('Proxy Extensions');?>
</td>
</tr>
<tr>
<td class="step-left">
<textarea size="20" class="vst-textinput short" name="v_proxy_ext"><?php if (!empty($v_proxy_ext)) { echo htmlentities(trim($v_proxy_ext, "'"));} else { echo 'jpeg, jpg, png, gif, bmp, ico, svg, tif, tiff, css, js, htm, html, ttf, otf, webp, woff, txt, csv, rtf, doc, docx, xls, xlsx, ppt, pptx, odf, odp, ods, odt, pdf, psd, ai, eot, eps, ps, zip, tar, tgz, gz, rar, bz2, 7z, aac, m4a, mp3, mp4, ogg, wav, wma, 3gp, avi, flv, m4v, mkv, mov, mp4, mpeg, mpg, wmv, exe, iso, dmg, swf'; } ?></textarea>
</td>
</tr>
</table>
</td>
</tr>
<?php echo ""; }?>
<tr>
<td class="vst-text step-top">
<?php print __('Web Statistics');?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_stats">
<?php
foreach ($stats as $key => $value) {
$svalue = "'".$value."'";
echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
if (empty($v_stats)) $v_stats = 'none';
if (( $value == $v_stats ) || ($svalue == $v_stats )){
echo ' selected' ;
}
echo ">" . htmlentities(__($value)) . "</option>\n";
}
?>
</select>
</td>
</tr>
<tr class="stats-auth" style="<? if (trim($v_stats, "'") == 'none') { ?>display:none<? } ?>">
<td class="step-left vst-text input-label">
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_stats_auth" <?php if (!empty($v_stats_user)) echo "checked=yes" ?>
onclick="javascript:elementHideShow('statstable');"> <?=__('Statistics Authorization')?></label>
</td>
</tr>
<tr>
<td class="step-left">
<table style="display:<?php if (empty($v_stats_user)) { echo 'none';} else {echo 'block';}?> ;" id="statstable" name="v-add-web-domain-stats-user">
<tr>
<td class="vst-text input-label">
<?php print __('Username');?>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_stats_user" value="<?=htmlentities(trim($v_stats_user, "'"))?>">
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('Password');?> / <a href="javascript:WEBrandom();" class="generate"><?php print __('generate');?></a>
</td>
</tr>
<tr>
<td>
<input type="text" size="20" class="vst-input password" name="v_stats_password" value="<?=htmlentities(trim($v_stats_password, "'"))?>" id="v_password">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="step-top vst-text">
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl" <?php if($v_ssl == 'yes' || $v_ssl == 'on') echo "checked=yes" ?> onclick="javascript:elementHideShow('ssltable');"> <?php print __('SSL Support');?></label>
</td>
</tr>
<tr>
<td>
<table style="display:<?php if (empty($v_ssl)) { echo 'none';} else {echo 'block';}?>;" id="ssltable">
<tr>
<td class="step-left input-label vst-text">
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_letsencrypt" <?php if($v_letsencrypt == 'yes' || $v_letsencrypt == 'on') echo "checked=yes" ?> onclick="App.Actions.WEB.toggle_letsencrypt(this)"> <?php print __('Lets Encrypt Support');?></label>
</td>
</tr>
<tr>
<td class="vst-text input-label lets-encrypt-note step-left" >
<?= __('Your certificate will be automatically issued in 5 minutes')?>
</td>
</tr>
<tr>
<td class="vst-text input-label step-left">
<?php print __('SSL Certificate');?>
<span id="generate-csr"> / <a class="generate" target="_blank" href="/generate/ssl/?domain=<?=htmlentities(trim($v_domain, "'")) ?>"><?php print __('Generate CSR') ?></a></span>
</td>
</tr>
<tr>
<td class="step-left">
<textarea size="20" class="vst-textinput short" name="v_ssl_crt"><?=htmlentities(trim($v_ssl_crt, "'"))?></textarea>
</td>
</tr>
<tr>
<td class="vst-text input-label step-left">
<?php print __('SSL Key');?>
</td>
</tr>
<tr>
<td class="step-left">
<textarea size="20" class="vst-textinput short" name="v_ssl_key"><?=htmlentities(trim($v_ssl_key, "'"))?></textarea>
</td>
</tr>
<tr>
<td class="vst-text input-label step-left">
<?php print __('SSL Certificate Authority / Intermediate');?> <span class="optional">(<?php print __('optional');?>)</span>
</td>
</tr>
<tr>
<td class="step-left">
<textarea size="20" class="vst-textinput short" name="v_ssl_ca"><?=htmlentities(trim($v_ssl_ca, "'"))?></textarea>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="vst-text step-top">
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ftp" <?php if (!empty($v_ftp) && count($v_ftp_users)) echo "checked=yes" ?> onclick="App.Actions.WEB.toggle_additional_ftp_accounts(this)"> <?php print __('Additional FTP Account');?></label>
</td>
</tr>
<tr>
<td>
<?php foreach ($v_ftp_users as $i => $ftp_user): ?>
<?php
$v_ftp_user = $ftp_user['v_ftp_user'];
$v_ftp_password = $ftp_user['v_ftp_password'];
$v_ftp_path = $ftp_user['v_ftp_path'];
$v_ftp_email = $ftp_user['v_ftp_email'];
$v_ftp_pre_path = $ftp_user['v_ftp_pre_path'];
?>
<table <?php echo (!empty($v_ftp)) ? "style='display: block'" : "style='display:none;'" ?> class="ftptable ftptable-nrm" name="v_add_domain_ftp">
<tr>
<td class="vst-text input-label">
<?php print __('FTP') ?> #<span class="ftp-user-number"><?php print $i + 1; ?></span> <a class="ftp-remove-user additional-control do_delete" onCLick="App.Actions.WEB.remove_ftp_user(this)">(<?php print __('delete') ?>)</a>
<input type="hidden" class="v-ftp-user-deleted" name="v_ftp_user[<?php print $i ?>][delete]" value="0" />
<input type="hidden" class="v-ftp-user-is-new" name="v_ftp_user[<?php print $i ?>][is_new]" value="<?php print htmlentities($ftp_user['is_new']) ?>" />
</td>
</tr>
<tr>
<td class="vst-text step-left input-label">
<?php print __('Username');?><br>
<span style="font-size: 10pt; color:#777;"><?php print __('Prefix will be automaticaly added to username',$user."_");?></span>
</td>
</tr>
<tr>
<td class="step-left">
<input type="text" size="20" class="vst-input v-ftp-user" <?php print $ftp_user['is_new'] != 1 ? 'disabled="disabled"' : '' ?> name="v_ftp_user[<?php print $i ?>][v_ftp_user]" value="<?=htmlentities(trim($v_ftp_user, "'"))?>">
<small class="hint"></small>
</td>
</tr>
<tr>
<td class="vst-text step-left input-label">
<?php print __('Password');?> / <a href="javascript:void(0);" onClick="FTPrandom(this)"; class="generate" ><?php print __('generate');?></a>
</td>
</tr>
<tr>
<td class="step-left">
<input type="text" class="vst-input v-ftp-user-psw password" name="v_ftp_user[<?php print $i ?>][v_ftp_password]" value="<?=htmlentities(trim($v_ftp_password, "'"))?>">
</td>
</tr>
<tr>
<td class="vst-text step-left input-label">
<?php print __('Path');?>
</td>
</tr>
<tr>
<td class="step-left">
<input type="hidden" class="vst-input v-ftp-pre-path" name="v_ftp_pre_path" value="<?php print !empty($v_ftp_pre_path) ? htmlentities(trim($v_ftp_pre_path, "'")) : '/'; ?>">
<input type="text" class="vst-input v-ftp-path" name="v_ftp_user[<?php print $i ?>][v_ftp_path]" value=".htmlentities(trim($v_ftp_path, "'"))?>">
<br /><span class="ftp-path-prefix"><?=htmlentities(trim($v_ftp_pre_path, "'"))?></span><span class="ftp-path-value v-ftp-path-hint"></span>
</td>
</tr>
<tr>
<td class="vst-text step-left input-label">
<?php print __('Send FTP credentials to email');?>
</td>
</tr>
<tr>
<td class="step-left">
<input type="text" class="vst-input" name="v_ftp_user[<?php print $i ?>][v_ftp_email]" value="<?=htmlentities(trim($v_ftp_email, "'"))?>">
</td>
</tr>
</table>
<?php endforeach; ?>
</td>
</tr>
<tr>
<td class="vst-text step-top v-add-new-user step-bottom" style="display: none;">
<a class="additional-control" onClick="App.Actions.WEB.add_ftp_user_form()"><?=__('Add one more FTP Account')?></a>
</td>
</tr>
</table>
<table class="data-col2">
</table>
</td>
</tr>
</table>
</form>
<div id="templates" class="hidden">
<table class="ftptable ftptable-nrm" name="v_add_domain_ftp">
<tr>
<td class="vst-text input-label">
<?php print __('FTP') ?> #<span class="ftp-user-number"></span> <a class="ftp-remove-user additional-control do_delete" onCLick="App.Actions.WEB.remove_ftp_user(this)">(<?=__('delete')?>)</a>
<input type="hidden" class="v-ftp-user-deleted" name="v_ftp_user[%INDEX%][delete]" value="0" />
<input type="hidden" class="v-ftp-user-is-new" name="v_ftp_user[%INDEX%][is_new]" value="1" />
</td>
</tr>
<tr>
<td class="vst-text step-left input-label">
<?php print __('Username');?><br>
<span style="font-size: 10pt; color:#777;"><?php print __('Prefix will be automaticaly added to username',$user."_");?></span>
</td>
</tr>
<tr>
<td class="step-left">
<input type="text" size="20" class="vst-input v-ftp-user" name="v_ftp_user[%INDEX%][v_ftp_user]" value="">
<small class="hint"></small>
</td>
</tr>
<tr>
<td class="vst-text step-left input-label">
<?php print __('Password');?> / <a href="javascript:void(0);" onClick="FTPrandom(this)"; class="generate" ><?php print __('generate');?></a>
</td>
</tr>
<tr>
<td class="step-left">
<input type="text" class="vst-input v-ftp-user-psw password" name="v_ftp_user[%INDEX%][v_ftp_password]" value="">
</td>
</tr>
<tr>
<td class="vst-text step-left input-label">
<?php print __('Path');?>
</td>
</tr>
<tr>
<td class="step-left">
<input type="hidden" class="vst-input v-ftp-pre-path" name="v_ftp_pre_path" value="">
<input type="text" class="vst-input v-ftp-path" name="v_ftp_user[%INDEX%][v_ftp_path]" value="">
<br /><span class="ftp-path-prefix"><?=htmlentities(trim($v_ftp_pre_path_new_user, "'")) ?></span><span class="ftp-path-value v-ftp-path-hint"></span>
</td>
</tr>
<tr>
<td class="vst-text step-left input-label">
<?php print __('Send FTP credentials to email');?>
</td>
</tr>
<tr>
<td class="step-left">
<input type="text" class="vst-input" name="v_ftp_user[%INDEX%][v_ftp_email]" value="">
</td>
</tr>
</table>
</div>
</div>
<script>
GLOBAL.FTP_USER_PREFIX = <?=json_encode($user.'_')?>;
GLOBAL.FTP_USER_PREPATH = <?=json_encode($v_ftp_user_prepath)?>;
</script>