Browse Source

Merge branch 'refactor/html' into feature/user-roles

Kristan Kenney 5 years ago
parent
commit
6ea314ad8a
84 changed files with 13878 additions and 13884 deletions
  1. 3 1
      web/inc/main.php
  2. 8 8
      web/list/server/index.php
  3. 23 23
      web/templates/footer.html
  4. 1 1
      web/templates/header.html
  5. 10 9
      web/templates/includes/css.html
  6. 43 43
      web/templates/includes/end_js.html
  7. 146 117
      web/templates/includes/panel.html
  8. 1 1
      web/templates/includes/title.html
  9. 418 437
      web/templates/pages/add_cron.html
  10. 241 238
      web/templates/pages/add_db.html
  11. 232 228
      web/templates/pages/add_dns.html
  12. 148 138
      web/templates/pages/add_dns_rec.html
  13. 137 135
      web/templates/pages/add_firewall.html
  14. 89 87
      web/templates/pages/add_firewall_banlist.html
  15. 178 176
      web/templates/pages/add_firewall_ipset.html
  16. 155 153
      web/templates/pages/add_ip.html
  17. 70 69
      web/templates/pages/add_key.html
  18. 186 184
      web/templates/pages/add_mail.html
  19. 248 217
      web/templates/pages/add_mail_acc.html
  20. 452 450
      web/templates/pages/add_package.html
  21. 191 189
      web/templates/pages/add_user.html
  22. 544 539
      web/templates/pages/add_web.html
  23. 21 21
      web/templates/pages/debug_panel.html
  24. 100 99
      web/templates/pages/edit_backup_exclusions.html
  25. 417 428
      web/templates/pages/edit_cron.html
  26. 140 143
      web/templates/pages/edit_db.html
  27. 144 143
      web/templates/pages/edit_dns.html
  28. 155 154
      web/templates/pages/edit_dns_rec.html
  29. 139 139
      web/templates/pages/edit_firewall.html
  30. 149 149
      web/templates/pages/edit_ip.html
  31. 307 308
      web/templates/pages/edit_mail.html
  32. 257 235
      web/templates/pages/edit_mail_acc.html
  33. 456 450
      web/templates/pages/edit_package.html
  34. 1292 1278
      web/templates/pages/edit_server.html
  35. 82 80
      web/templates/pages/edit_server_bind9.html
  36. 153 155
      web/templates/pages/edit_server_dovecot.html
  37. 76 74
      web/templates/pages/edit_server_httpd.html
  38. 142 140
      web/templates/pages/edit_server_mysql.html
  39. 197 195
      web/templates/pages/edit_server_nginx.html
  40. 82 80
      web/templates/pages/edit_server_pgsql.html
  41. 161 159
      web/templates/pages/edit_server_php.html
  42. 73 72
      web/templates/pages/edit_server_service.html
  43. 429 428
      web/templates/pages/edit_user.html
  44. 672 675
      web/templates/pages/edit_web.html
  45. 130 132
      web/templates/pages/generate_ssl.html
  46. 134 137
      web/templates/pages/list_backup.html
  47. 252 310
      web/templates/pages/list_backup_detail.html
  48. 65 64
      web/templates/pages/list_backup_exclusions.html
  49. 159 162
      web/templates/pages/list_cron.html
  50. 188 193
      web/templates/pages/list_db.html
  51. 159 161
      web/templates/pages/list_dns.html
  52. 140 141
      web/templates/pages/list_dns_rec.html
  53. 147 146
      web/templates/pages/list_firewall.html
  54. 97 97
      web/templates/pages/list_firewall_banlist.html
  55. 111 113
      web/templates/pages/list_firewall_ipset.html
  56. 111 111
      web/templates/pages/list_ip.html
  57. 62 62
      web/templates/pages/list_key.html
  58. 96 95
      web/templates/pages/list_log.html
  59. 86 85
      web/templates/pages/list_log_auth.html
  60. 231 246
      web/templates/pages/list_mail.html
  61. 209 222
      web/templates/pages/list_mail_acc.html
  62. 78 86
      web/templates/pages/list_mail_dns.html
  63. 227 227
      web/templates/pages/list_packages.html
  64. 64 67
      web/templates/pages/list_rrd.html
  65. 156 155
      web/templates/pages/list_search.html
  66. 36 33
      web/templates/pages/list_server_info.html
  67. 59 58
      web/templates/pages/list_server_preview.html
  68. 188 190
      web/templates/pages/list_services.html
  69. 89 90
      web/templates/pages/list_ssl.html
  70. 240 256
      web/templates/pages/list_stats.html
  71. 92 96
      web/templates/pages/list_updates.html
  72. 192 187
      web/templates/pages/list_user.html
  73. 239 240
      web/templates/pages/list_web.html
  74. 50 49
      web/templates/pages/list_webapps.html
  75. 31 29
      web/templates/pages/list_weblog.html
  76. 57 56
      web/templates/pages/login/login.html
  77. 66 65
      web/templates/pages/login/login_1.html
  78. 62 61
      web/templates/pages/login/login_2.html
  79. 67 66
      web/templates/pages/login/login_a.html
  80. 77 76
      web/templates/pages/login/reset2fa.html
  81. 62 61
      web/templates/pages/login/reset_1.html
  82. 57 56
      web/templates/pages/login/reset_2.html
  83. 65 64
      web/templates/pages/login/reset_3.html
  84. 79 91
      web/templates/pages/setup_webapp.html

+ 3 - 1
web/inc/main.php

@@ -181,7 +181,9 @@ function top_panel($user, $TAB) {
     }
 
     // Set preferred sort order
-    $_SESSION['userSortOrder'] = $panel[$user]['PREF_UI_SORT'];
+    if (!isset($_SESSION['look'])) {
+        $_SESSION['userSortOrder'] = $panel[$user]['PREF_UI_SORT'];
+    }
     
     // Set home location URLs
     if (($_SESSION['userContext'] === 'admin') && (!isset($_SESSION['look']))) {

+ 8 - 8
web/list/server/index.php

@@ -19,7 +19,7 @@ if (isset($_GET['cpu'])) {
     foreach($output as $file) {
         echo $file . "\n";
     }
-    echo "  </pre>\n</div>\n</body>\n</html>\n";
+    echo "    </pre>\n</div>\n</body>\n</html>\n";
     exit();
 }
 
@@ -31,7 +31,7 @@ if (isset($_GET['mem'])) {
     foreach($output as $file) {
         echo $file . "\n";
     }
-    echo "  </pre>\n</div>\n</body>\n</html>\n";
+    echo "    </pre>\n</div>\n</body>\n</html>\n";
     exit();
 }
 
@@ -43,7 +43,7 @@ if (isset($_GET['disk'])) {
     foreach($output as $file) {
         echo $file . "\n";
     }
-    echo "  </pre>\n</div>\n</body>\n</html>\n";
+    echo "    </pre>\n</div>\n</body>\n</html>\n";
     exit();
 }
 
@@ -55,7 +55,7 @@ if (isset($_GET['net'])) {
     foreach($output as $file) {
         echo $file . "\n";
     }
-    echo "  </pre>\n</div>\n</body>\n</html>\n";
+    echo "    </pre>\n</div>\n</body>\n</html>\n";
     exit();
 }
 
@@ -71,7 +71,7 @@ if (isset($_GET['web'])) {
 
         echo $file . "\n";
     }
-    echo "  </pre>\n</div>\n</body>\n</html>\n";
+    echo "    </pre>\n</div>\n</body>\n</html>\n";
     exit();
 }
 
@@ -83,7 +83,7 @@ if (isset($_GET['dns'])) {
     foreach($output as $file) {
         echo $file . "\n";
     }
-    echo "  </pre>\n</div>\n</body>\n</html>\n";
+    echo "    </pre>\n</div>\n</body>\n</html>\n";
     exit();
 }
 
@@ -97,7 +97,7 @@ if (isset($_GET['mail'])) {
             echo $file . "\n";
         }
     }
-    echo "  </pre>\n</div>\n</body>\n</html>\n";
+    echo "    </pre>\n</div>\n</body>\n</html>\n";
     exit();
 }
 
@@ -111,7 +111,7 @@ if (isset($_GET['db'])) {
             echo $file . "\n";
         }
     }
-    echo "  </pre>\n</div>\n</body>\n</html>\n";
+    echo "    </pre>\n</div>\n</body>\n</html>\n";
     exit();
 }
 

+ 23 - 23
web/templates/footer.html

@@ -1,48 +1,48 @@
   </div>
-  <? if (($_SESSION['userContext'] === 'admin') && ($_SESSION['POLICY_SYSTEM_HIDE_SERVICES'] !== 'yes')) {?>
-    <? if ($_SESSION['UPDATE_AVAILABLE'] === 'yes') { ?>
+  <?php if (($_SESSION['userContext'] === 'admin') && ($_SESSION['POLICY_SYSTEM_HIDE_SERVICES'] !== 'yes')) {?>
+    <?php if ($_SESSION['UPDATE_AVAILABLE'] === 'yes') { ?>
       <div class="footer-banner updates" id="banner">
         <div>
           <b>New updates are available!</b> To upgrade your server now, run <span style="font-family:'Courier New', Courier, monospace">apt update && apt upgrade</span> from a shell session.
         </div>
         <div style="margin-top: 4px;"></div><a href="javascript:elementHideShow('banner');">Hide</a></div>
       </div>
-    <?}?>
-  <?}?>
-  <div title="<?=_('Confirmation')?>" class="confirmation-text-redirect hidden">
-    <p class="confirmation"><?=_('LEAVE_PAGE_CONFIRMATION')?></p>
+    <?php } ?>
+  <?php } ?>
+  <div title="<?=_('Confirmation');?>" class="confirmation-text-redirect hidden">
+    <p class="confirmation"><?=_('LEAVE_PAGE_CONFIRMATION');?></p>
   </div>
 
   <div class="shortcuts animated fadeIn" style="display:none">
     <div class="header">
-      <div class="title"><?=_('Shortcuts')?></div>
+      <div class="title"><?=_('Shortcuts');?></div>
       <div class="close text-center">
         <i class="fas fa-times"></i>
       </div>
 
     </div>
     <ul>
-      <li><span class="key">a</span><?=_('Add New object')?></li>
-      <li><span class="key">Ctrl + Enter</span><?=_('Save Form')?></li>
-      <li><span class="key">Ctrl + Backspace</span><?=_('Cancel saving form')?></li>
+      <li><span class="key">a</span><?=_('Add New object');?></li>
+      <li><span class="key">Ctrl + Enter</span><?=_('Save Form');?></li>
+      <li><span class="key">Ctrl + Backspace</span><?=_('Cancel saving form');?></li>
 
-      <li class="step-top"><span class="key">1</span><?=_('Go to WEB list')?></li>
-      <li><span class="key">2</span><?=_('Go to DNS list')?></li>
-      <li><span class="key">3</span><?=_('Go to MAIL list')?></li>
-      <li><span class="key">4</span><?=_('Go to DB list')?></li>
-      <li><span class="key">5</span><?=_('Go to CRON list')?></li>
-      <li><span class="key">6</span><?=_('Go to BACKUP list')?></li>
+      <li class="step-top"><span class="key">1</span><?=_('Go to WEB list');?></li>
+      <li><span class="key">2</span><?=_('Go to DNS list');?></li>
+      <li><span class="key">3</span><?=_('Go to MAIL list');?></li>
+      <li><span class="key">4</span><?=_('Go to DB list');?></li>
+      <li><span class="key">5</span><?=_('Go to CRON list');?></li>
+      <li><span class="key">6</span><?=_('Go to BACKUP list');?></li>
     </ul>
     <ul>
-      <li><span class="key">f</span><?=_('Focus on search')?></li>
-      <li class="step-top"><span class="key">h</span><?=_('Display/Close shortcuts')?></li>
+      <li><span class="key">f</span><?=_('Focus on search');?></li>
+      <li class="step-top"><span class="key">h</span><?=_('Display/Close shortcuts');?></li>
 
-      <li class="step-top"><span class="key bigger">&larr;</span><?=_('Move backward through top menu')?></li>
-      <li><span class="key bigger">&rarr;</span><?=_('Move forward through top menu')?></li>
-      <li><span class="key">Enter</span><?=_('Enter focused element')?></li>
+      <li class="step-top"><span class="key bigger">&larr;</span><?=_('Move backward through top menu');?></li>
+      <li><span class="key bigger">&rarr;</span><?=_('Move forward through top menu');?></li>
+      <li><span class="key">Enter</span><?=_('Enter focused element');?></li>
 
-      <li class="step-top"><span class="key bigger">&uarr;</span><?=_('Move up through elements list')?></li>
-      <li><span class="key bigger">&darr;</span><?=_('Move down through elements list')?></li>
+      <li class="step-top"><span class="key bigger">&uarr;</span><?=_('Move up through elements list');?></li>
+      <li><span class="key bigger">&darr;</span><?=_('Move down through elements list');?></li>
     </ul>
   </div>
 </body>

+ 1 - 1
web/templates/header.html

@@ -1,5 +1,5 @@
 <!doctype html>
-<html lang="<?php echo $_SESSION['LANGUAGE'];?>">
+<html lang="<?=$_SESSION['LANGUAGE'];?>">
 
 <head>
   <?php require ''.$_SERVER['HESTIA'].'/web/templates/includes/title.html'; ?>

+ 10 - 9
web/templates/includes/css.html

@@ -1,18 +1,19 @@
 <link rel="icon" href="/images/favicon.ico" type="image/x-icon">
 <link type="text/css" rel="stylesheet" href="/css/themes/default.min.css?<?=JS_LATEST_UPDATE?>" rel="preload" />
-<? if (!empty($_SESSION['userTheme'])) {
-      $selected_theme = $_SESSION['userTheme']; 
-   } else {
-      $selected_theme = $_SESSION['THEME'];
-   } 
+<?php 
+	if (!empty($_SESSION['userTheme'])) {
+		$selected_theme = $_SESSION['userTheme']; 
+	} else {
+		$selected_theme = $_SESSION['THEME'];
+	} 
 ?>
 <!-- Load custom theme -->
-<? if ($selectedTheme !== 'default') {?>
+<?php if ($selectedTheme !== 'default') {?>
   <!-- Load HestiaCP-shipped themes (minified, updated/overwritten with updates) - ($HESTIA/web/css/themes/*.min.css) -->
-  <link type="text/css" rel="stylesheet" href="/css/themes/<?php echo $selected_theme; ?>.min.css?<?php echo rand(); ?>" rel="preload" />
+  <link type="text/css" rel="stylesheet" href="/css/themes/<?=$selected_theme; ?>.min.css?<?=rand(); ?>" rel="preload" />
   <!-- Load custom theme files ($HESTIA/web/css/themes/custom/*.css) -->
-  <link type="text/css" rel="stylesheet" href="/css/themes/custom/<?php echo $selected_theme; ?>.css?<?php echo rand(); ?>" rel="preload" />
-<? } ?>
+  <link type="text/css" rel="stylesheet" href="/css/themes/custom/<?=$selected_theme; ?>.css?<?=rand(); ?>" rel="preload" />
+<?php } ?>
 <link type="text/css" href="/css/dependencies/animate.min.css?<?=JS_LATEST_UPDATE?>" rel="stylesheet" rel="preload" />
 <link type="text/css" href="/css/dependencies/jquery-custom-dialogs.css?<?=JS_LATEST_UPDATE?>" rel="stylesheet" rel="preload" />
 <link type="text/css" href="/css/dependencies/fontawesome.min.css?<?=JS_LATEST_UPDATE?>" rel="stylesheet" rel="preload" />

+ 43 - 43
web/templates/includes/end_js.html

@@ -1,47 +1,47 @@
-  <script type="text/javascript" src="/js/jquery/jquery-1.7.2.min.js?<?=JS_LATEST_UPDATE?>"></script>
-  <script type="text/javascript" src="/js/jquery/jquery.cookie.js?<?=JS_LATEST_UPDATE?>"></script>
-  <script type="text/javascript" src="/js/jquery/jquery-ui-1.8.20.custom.min.js?<?=JS_LATEST_UPDATE?>"></script>
-  <script type="text/javascript" src="/js/jquery/jquery.finder.js?<?=JS_LATEST_UPDATE?>"></script>
-  <script type="text/javascript" src="/js/hotkeys.js?<?=JS_LATEST_UPDATE?>"></script>
-  <script type="text/javascript" src="/js/events.js?<?=JS_LATEST_UPDATE?>"></script>
-  <script type="text/javascript" src="/js/app.js?<?=JS_LATEST_UPDATE?>"></script>
-  <script type="text/javascript" src="/js/init.js?<?=JS_LATEST_UPDATE?>"></script>
-  <script type="text/javascript" src="/js/i18n.js.php?<?=JS_LATEST_UPDATE?>"></script>
-  <script type="text/javascript" src="/js/templates.js?<?=JS_LATEST_UPDATE?>"></script>
-  <script>
-    $(function() {
-      hover_menu();
-    });
-  </script>
+<script type="text/javascript" src="/js/jquery/jquery-1.7.2.min.js?<?=JS_LATEST_UPDATE?>"></script>
+<script type="text/javascript" src="/js/jquery/jquery.cookie.js?<?=JS_LATEST_UPDATE?>"></script>
+<script type="text/javascript" src="/js/jquery/jquery-ui-1.8.20.custom.min.js?<?=JS_LATEST_UPDATE?>"></script>
+<script type="text/javascript" src="/js/jquery/jquery.finder.js?<?=JS_LATEST_UPDATE?>"></script>
+<script type="text/javascript" src="/js/hotkeys.js?<?=JS_LATEST_UPDATE?>"></script>
+<script type="text/javascript" src="/js/events.js?<?=JS_LATEST_UPDATE?>"></script>
+<script type="text/javascript" src="/js/app.js?<?=JS_LATEST_UPDATE?>"></script>
+<script type="text/javascript" src="/js/init.js?<?=JS_LATEST_UPDATE?>"></script>
+<script type="text/javascript" src="/js/i18n.js.php?<?=JS_LATEST_UPDATE?>"></script>
+<script type="text/javascript" src="/js/templates.js?<?=JS_LATEST_UPDATE?>"></script>
+<script>
+	$(function() {
+		hover_menu();
+	});
+</script>
 
 <?php
-if (!empty($_SESSION['error_msg'])):
-?>
-  <div>
-    <script>
-      $(function() {
-        $('#dialog:ui-dialog').dialog('destroy');
-        $('#dialog-message').dialog({
-          modal: true,
-          buttons: {
-            Ok: function() {
-              $(this).dialog('close');
-            }
-          },
-          create: function() {
-            $(this)
-            .closest('.ui-dialog')
-            .find('.ui-button:first')
-            .addClass('submit');
-          }
-        });
-      });
-    </script>
-    <div id="dialog-message" title="">
-      <p><?=htmlentities($_SESSION['error_msg'])?></p>
-    </div>
-  </div>
+	if (!empty($_SESSION['error_msg'])):
+	?>
+	<div>
+		<script>
+			$(function() {
+				$('#dialog:ui-dialog').dialog('destroy');
+				$('#dialog-message').dialog({
+					modal: true,
+					buttons: {
+						Ok: function() {
+							$(this).dialog('close');
+						}
+					},
+					create: function() {
+						$(this)
+						.closest('.ui-dialog')
+						.find('.ui-button:first')
+						.addClass('submit');
+					}
+				});
+			});
+		</script>
+		<div id="dialog-message" title="">
+			<p><?=htmlentities($_SESSION['error_msg'])?></p>
+		</div>
+	</div>
 <?php
-  unset($_SESSION['error_msg']);
-endif;
+	unset($_SESSION['error_msg']);
+	endif;
 ?>

+ 146 - 117
web/templates/includes/panel.html

@@ -1,180 +1,209 @@
 <div class="hidden" id="token" token="<?=$_SESSION['token']?>"></div>
-<a href="#" class="to-top" title="<?=_('Top')?>">
+<a href="#" class="to-top" title="<?=_('Top');?>">
 	<i class="fas fa-arrow-up"></i>
 </a>
-<a href="#" class="to-shortcuts" title="<?=_('Shortcuts')?>">
+<a href="#" class="to-shortcuts" title="<?=_('Shortcuts');?>">
 	<i class="fas fa-keyboard"></i>
 </a>
 
 <div class="l-header">
 	<div class="l-center">
+		<!-- Logo / Home Button -->
 		<a href="<?=htmlspecialchars($home_url)?>" class="l-logo" title="<?=_('Hestia Control Panel');?>"></a>
+
+		<!-- Left Menu -->
 		<div class="l-menu clearfix noselect">
-			<div class="l-menu__item <?php if($TAB == 'WEB' ) echo 'l-menu__item--active' ?> <?php if($TAB == 'DNS' ) echo 'l-menu__item--active' ?> <?php if($TAB == 'MAIL' ) echo 'l-menu__item--active' ?> <?php if($TAB == 'DB' ) echo 'l-menu__item--active' ?> <?php if($TAB == 'BACKUP' ) echo 'l-menu__item--active' ?> <?php if($TAB == 'CRON' ) echo 'l-menu__item--active' ?><?php if($TAB == 'PACKAGE' ) echo 'l-menu__item--active' ?> <?php if($TAB == 'USER' ) echo 'l-menu__item--active' ?><?php if($TAB == 'LOG' ) echo 'l-menu__item--active' ?>"><a href="<?=htmlspecialchars($home_url)?>"><i class="fas fa-tasks panel-icon"></i><?=_('Records')?></a></div>
+			<!-- Records tab -->
+			<div class="l-menu__item <?php if($TAB == 'WEB') echo 'l-menu__item--active' ?> <?php if($TAB == 'DNS') echo 'l-menu__item--active' ?> <?php if($TAB == 'MAIL') echo 'l-menu__item--active' ?> <?php if($TAB == 'DB') echo 'l-menu__item--active' ?> <?php if($TAB == 'BACKUP') echo 'l-menu__item--active' ?> <?php if($TAB == 'CRON') echo 'l-menu__item--active' ?><?php if($TAB == 'PACKAGE') echo 'l-menu__item--active' ?> <?php if($TAB == 'USER') echo 'l-menu__item--active' ?><?php if($TAB == 'LOG') echo 'l-menu__item--active' ?>"><a href="<?=htmlspecialchars($home_url)?>"><i class="fas fa-tasks panel-icon"></i><?=_('Records');?></a></div>
+			
+			<!-- File Manager tab -->
 			<?php if ((isset($_SESSION['FILE_MANAGER'])) && (!empty($_SESSION['FILE_MANAGER'])) && ($_SESSION['FILE_MANAGER'] == "true")) {?>
-				<? if (($_SESSION['userContext'] === 'admin') && (isset($_SESSION['look']) && ($_SESSION['look'] === 'admin') && ($_SESSION['POLICY_SYSTEM_PROTECTED_ADMIN'] == 'yes'))) {?>
+				<?php if (($_SESSION['userContext'] === 'admin') && (isset($_SESSION['look']) && ($_SESSION['look'] === 'admin') && ($_SESSION['POLICY_SYSTEM_PROTECTED_ADMIN'] == 'yes'))) {?>
 						<!-- Hide file manager when impersonating admin-->
-					<? } else { ?>
-						<div class="l-menu__item <?php if($TAB == 'FM' ) echo 'l-menu__item--active' ?>"><a href="/fm/"><i class="fas fa-folder-open panel-icon"></i><?=_('Files')?></a></div>
-				<? } ?>
+					<?php } else { ?>
+						<div class="l-menu__item <?php if($TAB == 'FM') echo 'l-menu__item--active' ?>"><a href="/fm/"><i class="fas fa-folder-open panel-icon"></i><?=_('Files');?></a></div>
+				<?php } ?>
 			<?php } ?>
-			<div class="l-menu__item <?php if($TAB == 'STATS' ) echo 'l-menu__item--active' ?>"><a href="/list/stats/"><i class="fas fa-chart-line panel-icon"></i><?=_('Statistics')?></a></div>
+			
+			<!-- Statistics tab-->
+			<div class="l-menu__item <?php if($TAB == 'STATS') echo 'l-menu__item--active' ?>"><a href="/list/stats/"><i class="fas fa-chart-line panel-icon"></i><?=_('Statistics');?></a></div>
 		</div>
+
+		<!-- Right Menu -->
 		<div class="l-profile noselect">
 			<div class="l-menu__item">
+				<!-- Logged in as / Usage Statistics Overview -->
 				<span class="pill usage">
-					<span class="label-space-right"><i class="fas 
-					<? if (isset($_SESSION['look'])) {?>
-						fa-binoculars
-					<? } else if ($_SESSION['userContext'] === 'admin') { ?>
-						fa-user-tie
-					<? } else { ?>
-						fa-user
-					<? } ?> icon-pad-right" title="<?=_('Statistics')?>: <?=htmlspecialchars($panel[$user]['NAME'])?>"></i><b><?=htmlspecialchars($user)?></b></span>
-					<span class="label-space-right"><i class="fas fa-hdd icon-pad-right" title="<?=_('Disk')?>: <?=humanize_usage_size($panel[$user]['U_DISK'])?> <?=humanize_usage_measure($panel[$user]['U_DISK'])?>"></i><b><?=humanize_usage_size($panel[$user]['U_DISK'])?></b> <?=humanize_usage_measure($panel[$user]['U_DISK'])?></span>
-					<span><i class="fas fa-exchange-alt icon-pad-right" title="<?=_('Bandwidth')?>: <?=humanize_usage_size($panel[$user]['U_DISK'])?> <?=humanize_usage_measure($panel[$user]['U_DISK'])?>"></i><b><?=humanize_usage_size($panel[$user]['U_BANDWIDTH'])?></b> <?=humanize_usage_measure($panel[$user]['U_BANDWIDTH'])?></span>
+					<?php
+						if (isset($_SESSION['look'])) {
+							$user_icon = 'fa-binoculars';
+						} else if ($_SESSION['userContext'] === 'admin') {
+							$user_icon = 'fa-user-tie';
+						} else {
+							$user_icon = 'fa-user';
+						}
+					?>
+					<span class="label-space-right"><i class="fas <?=$user_icon;?> icon-pad-right" title="<?=_('Logged in as');?>: <?=htmlspecialchars($panel[$user]['NAME'])?>"></i><b><?=htmlspecialchars($user)?></b></span>
+					<span class="label-space-right"><i class="fas fa-hdd icon-pad-right" title="<?=_('Disk');?>: <?=humanize_usage_size($panel[$user]['U_DISK'])?> <?=humanize_usage_measure($panel[$user]['U_DISK'])?>"></i><b><?=humanize_usage_size($panel[$user]['U_DISK'])?></b> <?=humanize_usage_measure($panel[$user]['U_DISK'])?></span>
+					<span><i class="fas fa-exchange-alt icon-pad-right" title="<?=_('Bandwidth');?>: <?=humanize_usage_size($panel[$user]['U_DISK'])?> <?=humanize_usage_measure($panel[$user]['U_DISK'])?>"></i><b><?=humanize_usage_size($panel[$user]['U_BANDWIDTH'])?></b> <?=humanize_usage_measure($panel[$user]['U_BANDWIDTH'])?></span>
 				</span>
 			</div>
-			<!-- Show update notifier for administrators 
-			<? if (($_SESSION['userContext'] === 'admin') && ($_SESSION['UPDATE_AVAILABLE'])) {?>
-				<div class="l-menu__item <?php if($TAB == 'UPDATES' ) echo 'l-menu__item--active' ?>"><a href="/list/updates/" title="<?_('Updates')?>" class="l-profile__username "><i class="fas fa-star status-icon orange"></i></a></div>
-			<?}?>-->
-			<? if (($_SESSION['userContext'] === 'admin') && (isset($_SESSION['look']) && ($user == 'admin'))) {?>
+
+			<!-- Notifications -->
+			<?php if (($_SESSION['userContext'] === 'admin') && (isset($_SESSION['look']) && ($user == 'admin'))) {?>
 				<!-- Do not show notifications panel when impersonating 'admin' user -->
-			<? } else { ?>
+			<?php } else { ?>
 				<div class="l-menu__item">
-					<a title="<?=_('Notifications')?>" class="l-profile__notifications <? if($panel[$user]['NOTIFICATIONS'] == 'yes') echo " updates"; ?>">
-						<i class="fas fa-bell <?if($panel[$user]['NOTIFICATIONS'] == 'yes') echo " animated extended swing status-icon orange"; ?>"></i>
+					<a title="<?=_('Notifications');?>" class="l-profile__notifications <?php if ($panel[$user]['NOTIFICATIONS'] == 'yes') echo " updates"; ?>">
+						<i class="fas fa-bell <?php if ($panel[$user]['NOTIFICATIONS'] == 'yes') echo " animated extended swing status-icon orange"; ?>"></i>
 					</a>
 				</div>
-			<? } ?>
+			<?php } ?>
 
-			<? if (($_SESSION['userContext'] === 'admin') && ($_SESSION['POLICY_SYSTEM_HIDE_SERVICES'] !== 'yes') || ($_SESSION['user'] === 'admin')) {?>
-				<? if (($_SESSION['userContext'] === 'admin') && (!empty($_SESSION['look']))) {?>
+			<!-- Server Settings -->
+			<?php if (($_SESSION['userContext'] === 'admin') && ($_SESSION['POLICY_SYSTEM_HIDE_SERVICES'] !== 'yes') || ($_SESSION['user'] === 'admin')) {?>
+				<?php if (($_SESSION['userContext'] === 'admin') && (!empty($_SESSION['look']))) {?>
 					<!-- Hide 'Server Settings' button when impersonating 'admin' or other users -->
-				<? } else { ?>				
-					<div class="l-menu__item <?php if($TAB == 'SERVER' ) echo 'l-menu__item--active' ?> <?php if($TAB == 'IP' ) echo 'l-menu__item--active' ?> <?php if($TAB == 'RRD' ) echo 'l-menu__item--active' ?> <?php if($TAB == 'FIREWALL' ) echo 'l-menu__item--active' ?>"><a href="/list/server/" class="l-profile__serversettings" title="<?=_('Server')?>"><i class="fas fa-cog"></i></a></div>
-				<? } ?>
-			<? } ?>
-			<? if (($_SESSION['userContext'] === 'admin') && (isset($_SESSION['look']) && ($user == 'admin'))) {?>
+				<?php } else { ?>				
+					<div class="l-menu__item <?php if($TAB == 'SERVER') echo 'l-menu__item--active' ?> <?php if($TAB == 'IP') echo 'l-menu__item--active' ?> <?php if($TAB == 'RRD') echo 'l-menu__item--active' ?> <?php if($TAB == 'FIREWALL') echo 'l-menu__item--active' ?>"><a href="/list/server/" class="l-profile__serversettings" title="<?=_('Server');?>"><i class="fas fa-cog"></i></a></div>
+				<?php } ?>
+			<?php } ?>
+
+			<!-- Edit User -->
+			<?php if (($_SESSION['userContext'] === 'admin') && (isset($_SESSION['look']) && ($user == 'admin'))) {?>
 				<!-- Hide 'edit user' entry point from other administrators for default 'admin' account-->
-				<div class="l-menu__item"><a href="/list/log/" title="<?_('Logs')?>" class="l-profile__username"><i class="fas fa-history"></i></a></div>
-			<? } else { ?>
-				<? if ($panel[$user]['SUSPENDED'] === 'no') {?>
-					<div class="l-menu__item"><a href="/edit/user/?user=<?php echo $user; ?>&token=<?=$_SESSION['token']?>" title="<?=htmlspecialchars($user)?> (<?=htmlspecialchars($panel[$user]['NAME'])?>)" class="l-profile__username"><i class="fas fa-user-circle"></i></a></div>
-				<? } ?>
-			<? } ?>
-			<div class="l-menu__item"><a href="https://docs.hestiacp.com/" rel="noopener" title="<?=_('Help')?>" class="l-profile__help" target="_blank"><i class="fas fa-question-circle"></i></a></div>
-			<? if(isset($_SESSION['look']) && (!empty($_SESSION['look']))){ ?>
-				<div class="l-menu__item"><a href="/logout/" title="<?=_('Log out')?> (<?=$user?>)" class="l-profile__logout"><i class="fas fa-arrow-alt-circle-up"></i></a></div>
-			<? } else {?>
-				<div class="l-menu__item"><a href="/logout/" title="<?=_('Log out')?>" class="l-profile__logout"><i class="fas fa-sign-out-alt"></i></a></div>
-			<? } ?>
+				<div class="l-menu__item"><a href="/list/log/" title="<?_('Logs');?>" class="l-profile__username"><i class="fas fa-history"></i></a></div>
+			<?php } else { ?>
+				<?php if ($panel[$user]['SUSPENDED'] === 'no') {?>
+					<div class="l-menu__item"><a href="/edit/user/?user=<?=$user; ?>&token=<?=$_SESSION['token']?>" title="<?=htmlspecialchars($user)?> (<?=htmlspecialchars($panel[$user]['NAME'])?>)" class="l-profile__username"><i class="fas fa-user-circle"></i></a></div>
+				<?php } ?>
+			<?php } ?>
+
+			<!-- Help / Documentation-->
+			<div class="l-menu__item"><a href="https://docs.hestiacp.com/" rel="noopener" title="<?=_('Help');?>" class="l-profile__help" target="_blank"><i class="fas fa-question-circle"></i></a></div>
+			
+			<!-- Logout -->
+			<?php if (isset($_SESSION['look']) && (!empty($_SESSION['look']))) { ?>
+				<div class="l-menu__item"><a href="/logout/" title="<?=_('Log out');?> (<?=$user?>)" class="l-profile__logout"><i class="fas fa-arrow-alt-circle-up"></i></a></div>
+			<?php } else { ?>
+				<div class="l-menu__item"><a href="/logout/" title="<?=_('Log out');?>" class="l-profile__logout"><i class="fas fa-sign-out-alt"></i></a></div>
+			<?php } ?>
 		</div>
 	</div>
 </div>
+
 <ul class="notification-container hidden animated fadeIn"></ul>
 
 <div class="l-content">
 	<div class="l-center">
 		<div class="l-stat">
+			<!-- Users tab -->
 			<?php if (($_SESSION['userContext'] === 'admin') && (!isset($_SESSION['look']))) {?>
-			<div class="l-stat__col <?php if($TAB == 'USER' ) echo 'l-stat__col--active' ?><?php if($TAB == 'LOG' ) echo 'l-stat__col--active' ?>">
-				<a href="/list/user/">
-					<div class="l-stat__col-title"><?=_('USER')?>&nbsp;&nbsp;<i class="fas fa-users"></i></div>
-					<ul>
-						<li><?=_('users')?>: <span>
-							<? if (($_SESSION['user'] !== 'admin') && ($_SESSION['POLICY_SYSTEM_HIDE_ADMIN'] === 'yes')) {
-								$user_count = $panel[$user]['U_USERS'] - 1;
-							} else {
-								$user_count = $panel[$user]['U_USERS'];
-							} ?>
-							<?=htmlspecialchars($user_count);?></span></li>
-						<li><?=_('spnd');?>: <span><?=$panel[$user]['SUSPENDED_USERS']?></span></li>
-					</ul>
-				</a>
-			</div>
+				<?php 
+					if (($_SESSION['user'] !== 'admin') && ($_SESSION['POLICY_SYSTEM_HIDE_ADMIN'] === 'yes')) {
+						$user_count = $panel[$user]['U_USERS'] - 1;
+					} else {
+						$user_count = $panel[$user]['U_USERS'];
+					} 
+				?>
+				<div class="l-stat__col <?php if($TAB == 'USER') echo 'l-stat__col--active' ?><?php if($TAB == 'LOG') echo 'l-stat__col--active' ?>">
+					<a href="/list/user/"  title="<?=_('Users');?>: <?=$user_count;?>&#13;<?=_('Suspended');?>: <?=$panel[$user]['SUSPENDED_USERS']?>">
+						<div class="l-stat__col-title"><?=_('USER');?>&nbsp;&nbsp;<i class="fas fa-users"></i></div>
+						<ul>
+							<li><?=_('users');?>: <span><?=htmlspecialchars($user_count);?></span></li>
+							<li><?=_('spnd');?>: <span><?=$panel[$user]['SUSPENDED_USERS']?></span></li>
+						</ul>
+					</a>
+				</div>
 			<?php } ?>
-	<?php if ((isset($_SESSION['WEB_SYSTEM'])) && (!empty($_SESSION['WEB_SYSTEM']))) {?>
-		<?php if($panel[$user]['WEB_DOMAINS'] != "0") { ?>
-					<div class="l-stat__col <?php if($TAB == 'WEB' ) echo 'l-stat__col--active' ?>">
-						<a href="/list/web/">
-							<div class="l-stat__col-title"><?=_('WEB')?>&nbsp;&nbsp;<i class="fas fa-globe-americas"></i></div>
+
+			<!-- Web tab -->
+			<?php if ((isset($_SESSION['WEB_SYSTEM'])) && (!empty($_SESSION['WEB_SYSTEM']))) {?>
+				<?php if($panel[$user]['WEB_DOMAINS'] != "0") { ?>
+					<div class="l-stat__col <?php if($TAB == 'WEB') echo 'l-stat__col--active' ?>">
+						<a href="/list/web/" title="<?=_('Domains');?>: <?=$panel[$user]['U_WEB_DOMAINS']?>&#13;<?=_('Aliases');?>: <?=$panel[$user]['U_WEB_ALIASES']?>&#13;<?=_('Limit')?>: <?=$panel[$user]['WEB_DOMAINS']=='unlimited' ? "∞" : $panel[$user]['WEB_DOMAINS']?>&#13;<?=_('Suspended');?>: <?=$panel[$user]['SUSPENDED_WEB']?>">
+							<div class="l-stat__col-title"><?=_('WEB');?>&nbsp;&nbsp;<i class="fas fa-globe-americas"></i></div>
 							<ul>
-								<li><?=_('domains')?>: <span><?=$panel[$user]['U_WEB_DOMAINS']?> / <?=$panel[$user]['WEB_DOMAINS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['WEB_DOMAINS']?> (<?=$panel[$user]['SUSPENDED_WEB']?>)</span></li>
-								<li><?=_('aliases')?>: <span><?=$panel[$user]['U_WEB_ALIASES']?> / <?=$panel[$user]['WEB_ALIASES']=='unlimited' ? "<b>∞</b>" : $panel[$user]['WEB_ALIASES'] * $panel[$user]['WEB_DOMAINS']?></span></li>
+								<li><?=_('domains');?>: <span><?=$panel[$user]['U_WEB_DOMAINS']?> / <?=$panel[$user]['WEB_DOMAINS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['WEB_DOMAINS']?> (<?=$panel[$user]['SUSPENDED_WEB']?>)</span></li>
+								<li><?=_('aliases');?>: <span><?=$panel[$user]['U_WEB_ALIASES']?> / <?=$panel[$user]['WEB_ALIASES']=='unlimited' ? "<b>∞</b>" : $panel[$user]['WEB_ALIASES'] * $panel[$user]['WEB_DOMAINS']?></span></li>
 							</ul>
 						</a>
 					</div>
-		<?php } ?>
-	<?php } ?>
-
-	<?php if ((isset($_SESSION['DNS_SYSTEM'])) && (!empty($_SESSION['DNS_SYSTEM']))) {?>
-		<?php if($panel[$user]['DNS_DOMAINS'] != "0") { ?>
-					<div class="l-stat__col <?php if($TAB == 'DNS' ) echo 'l-stat__col--active' ?>">
-						<a href="/list/dns/">
-							<div class="l-stat__col-title"><?=_('DNS')?>&nbsp;&nbsp;<i class="fas fa-atlas"></i></div>
+				<?php } ?>
+			<?php } ?>
+
+			<!-- DNS tab -->
+			<?php if ((isset($_SESSION['DNS_SYSTEM'])) && (!empty($_SESSION['DNS_SYSTEM']))) {?>
+				<?php if($panel[$user]['DNS_DOMAINS'] != "0") { ?>
+					<div class="l-stat__col <?php if($TAB == 'DNS') echo 'l-stat__col--active' ?>">
+						<a href="/list/dns/" title="<?=_('Domains');?>: <?=$panel[$user]['U_DNS_DOMAINS']?>&#13;<?=_('Limit')?>: <?=$panel[$user]['DNS_DOMAINS']=='unlimited' ? "∞" : $panel[$user]['DNS_DOMAINS']?>&#13;<?=_('Suspended');?>: <?=$panel[$user]['SUSPENDED_DNS']?>">
+							<div class="l-stat__col-title"><?=_('DNS');?>&nbsp;&nbsp;<i class="fas fa-atlas"></i></div>
 							<ul>
-								<li><?=_('zones')?>: <span><?=$panel[$user]['U_DNS_DOMAINS']?> / <?=$panel[$user]['DNS_DOMAINS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['DNS_DOMAINS']?> (<?=$panel[$user]['SUSPENDED_DNS']?>)</span></li>
-								<li><?=_('records')?>: <span><?=$panel[$user]['U_DNS_RECORDS']?> / <?=$panel[$user]['DNS_RECORDS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['DNS_RECORDS'] * $panel[$user]['DNS_DOMAINS']?></span></li>
+								<li><?=_('zones');?>: <span><?=$panel[$user]['U_DNS_DOMAINS']?> / <?=$panel[$user]['DNS_DOMAINS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['DNS_DOMAINS']?> (<?=$panel[$user]['SUSPENDED_DNS']?>)</span></li>
+								<li><?=_('records');?>: <span><?=$panel[$user]['U_DNS_RECORDS']?> / <?=$panel[$user]['DNS_RECORDS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['DNS_RECORDS'] * $panel[$user]['DNS_DOMAINS']?></span></li>
 							</ul>
 						</a>
 					</div>
-		<?php } ?>
-	<?php } ?>
-
-	<?php if ((isset($_SESSION['MAIL_SYSTEM'])) && (!empty($_SESSION['MAIL_SYSTEM']))) {?>
-		<?php if($panel[$user]['MAIL_DOMAINS'] != "0") { ?>
-					<div class="l-stat__col <?php if($TAB == 'MAIL' ) echo 'l-stat__col--active' ?>">
-						<a href="/list/mail/">
-							<div class="l-stat__col-title"><?=_('MAIL')?>&nbsp;&nbsp;<i class="fas fa-mail-bulk"></i></div>
+				<?php } ?>
+			<?php } ?>
+
+			<!-- Mail tab -->
+			<?php if ((isset($_SESSION['MAIL_SYSTEM'])) && (!empty($_SESSION['MAIL_SYSTEM']))) {?>
+				<?php if($panel[$user]['MAIL_DOMAINS'] != "0") { ?>
+					<div class="l-stat__col <?php if($TAB == 'MAIL') echo 'l-stat__col--active' ?>">
+						<a href="/list/mail/"  title="<?=_('Domains');?>: <?=$panel[$user]['U_MAIL_DOMAINS']?>&#13;<?=_('Limit')?>: <?=$panel[$user]['MAIL_DOMAINS']=='unlimited' ? "∞" : $panel[$user]['MAIL_DOMAINS']?>&#13;<?=_('Suspended');?>: <?=$panel[$user]['SUSPENDED_MAIL']?>">
+							<div class="l-stat__col-title"><?=_('MAIL');?>&nbsp;&nbsp;<i class="fas fa-mail-bulk"></i></div>
 							<ul>
-								<li><?=_('domains')?>: <span><?=$panel[$user]['U_MAIL_DOMAINS']?> / <?=$panel[$user]['MAIL_DOMAINS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['MAIL_DOMAINS']?> (<?=$panel[$user]['SUSPENDED_MAIL']?>)</span></li>
-								<li><?=_('accounts')?>: <span><?=$panel[$user]['U_MAIL_ACCOUNTS']?> / <?=$panel[$user]['MAIL_ACCOUNTS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['MAIL_ACCOUNTS'] * $panel[$user]['MAIL_DOMAINS']?></span></li>
+								<li><?=_('domains');?>: <span><?=$panel[$user]['U_MAIL_DOMAINS']?> / <?=$panel[$user]['MAIL_DOMAINS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['MAIL_DOMAINS']?> (<?=$panel[$user]['SUSPENDED_MAIL']?>)</span></li>
+								<li><?=_('accounts');?>: <span><?=$panel[$user]['U_MAIL_ACCOUNTS']?> / <?=$panel[$user]['MAIL_ACCOUNTS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['MAIL_ACCOUNTS'] * $panel[$user]['MAIL_DOMAINS']?></span></li>
 							</ul>
 						</a>
 					</div>
-		<?php } ?>
-	<?php } ?>
-
-	<?php if ((isset($_SESSION['DB_SYSTEM'])) && (!empty($_SESSION['DB_SYSTEM']))) {?>
-		<?php if($panel[$user]['DATABASES'] != "0") { ?>
-					<div class="l-stat__col <?php if($TAB == 'DB' ) echo 'l-stat__col--active' ?>">
-						<a href="/list/db/">
-							<div class="l-stat__col-title"><?=_('DB')?>&nbsp;&nbsp;<i class="fas fa-database"></i></div>
+				<?php } ?>
+			<?php } ?>
+
+			<!-- Databases tab -->
+			<?php if ((isset($_SESSION['DB_SYSTEM'])) && (!empty($_SESSION['DB_SYSTEM']))) {?>
+				<?php if($panel[$user]['DATABASES'] != "0") { ?>
+					<div class="l-stat__col <?php if($TAB == 'DB') echo 'l-stat__col--active' ?>">
+						<a href="/list/db/" title="<?=_('Databases');?>: <?=$panel[$user]['U_DATABASES']?>&#13;<?=_('Limit')?>: <?=$panel[$user]['DATABASES']=='unlimited' ? "∞" : $panel[$user]['DATABASES']?>&#13;<?=_('Suspended');?>: <?=$panel[$user]['SUSPENDED_DB']?>">
+							<div class="l-stat__col-title"><?=_('DB');?>&nbsp;&nbsp;<i class="fas fa-database"></i></div>
 							<ul>
-								<li><?=_('databases')?>: <span><?=$panel[$user]['U_DATABASES']?> / <?=$panel[$user]['DATABASES']=='unlimited' ? "<b>∞</b>" : $panel[$user]['DATABASES']?> (<?=$panel[$user]['SUSPENDED_DB']?>)</span></li>
+								<li><?=_('databases');?>: <span><?=$panel[$user]['U_DATABASES']?> / <?=$panel[$user]['DATABASES']=='unlimited' ? "<b>∞</b>" : $panel[$user]['DATABASES']?> (<?=$panel[$user]['SUSPENDED_DB']?>)</span></li>
 							</ul>
 						</a>
 					</div>
-		<?php } ?>
-	<?php } ?>
-
-	<?php if ((isset($_SESSION['CRON_SYSTEM'])) && (!empty($_SESSION['CRON_SYSTEM']))) {?>
-		<?php if($panel[$user]['CRON_JOBS'] != "0") { ?>
-					<div class="l-stat__col <?php if($TAB == 'CRON' ) echo 'l-stat__col--active' ?>">
-						<a href="/list/cron/">
-							<div class="l-stat__col-title"><?=_('CRON')?>&nbsp;&nbsp;<i class="fas fa-clock"></i></div>
+				<?php } ?>
+			<?php } ?>
+
+			<!-- Cron tab -->
+			<?php if ((isset($_SESSION['CRON_SYSTEM'])) && (!empty($_SESSION['CRON_SYSTEM']))) {?>
+				<?php if($panel[$user]['CRON_JOBS'] != "0") { ?>
+					<div class="l-stat__col <?php if($TAB == 'CRON') echo 'l-stat__col--active' ?>">
+						<a href="/list/cron/" title="<?=_('Jobs');?>: <?=$panel[$user]['U_WEB_DOMAINS']?>&#13;<?=_('Limit')?>: <?=$panel[$user]['CRON_JOBS']=='unlimited' ? "∞" : $panel[$user]['CRON_JOBS']?>&#13;<?=_('Suspended');?>: <?=$panel[$user]['SUSPENDED_CRON']?>">
+							<div class="l-stat__col-title"><?=_('CRON');?>&nbsp;&nbsp;<i class="fas fa-clock"></i></div>
 							<ul>
-								<li><?=_('jobs')?>: <span><?=$panel[$user]['U_CRON_JOBS']?> / <?=$panel[$user]['CRON_JOBS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['CRON_JOBS']?> (<?=$panel[$user]['SUSPENDED_CRON']?>)</span></li>
+								<li><?=_('jobs');?>: <span><?=$panel[$user]['U_CRON_JOBS']?> / <?=$panel[$user]['CRON_JOBS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['CRON_JOBS']?> (<?=$panel[$user]['SUSPENDED_CRON']?>)</span></li>
 							</ul>
 						</a>
 					</div>
-		<?php } ?>
-	<?php } ?>
-
-	<?php if ((isset($_SESSION['BACKUP_SYSTEM'])) && (!empty($_SESSION['BACKUP_SYSTEM']))) {?>
-		<?php if($panel[$user]['BACKUPS'] != "0") { ?>
-					<div class="l-stat__col <?php if($TAB == 'BACKUP' ) echo 'l-stat__col--active' ?>">
-						<a href="/list/backup/">
-							<div class="l-stat__col-title"><?=_('BACKUP')?>&nbsp;&nbsp;<i class="fas fa-file-archive"></i></div>
+				<?php } ?>
+			<?php } ?>
+
+			<!-- Backups tab -->
+			<?php if ((isset($_SESSION['BACKUP_SYSTEM'])) && (!empty($_SESSION['BACKUP_SYSTEM']))) {?>
+				<?php if($panel[$user]['BACKUPS'] != "0") { ?>
+					<div class="l-stat__col <?php if($TAB == 'BACKUP') echo 'l-stat__col--active' ?>">
+						<a href="/list/backup/" title="<?=_('Backups');?>: <?=$panel[$user]['U_BACKUPS']?>&#13;<?=_('Limit')?>: <?=$panel[$user]['BACKUPS']=='unlimited' ? "∞" : $panel[$user]['BACKUPS']?>">
+							<div class="l-stat__col-title"><?=_('BACKUP');?>&nbsp;&nbsp;<i class="fas fa-file-archive"></i></div>
 							<ul>
-								<li><?=_('backups')?>: <span><?=$panel[$user]['U_BACKUPS']?> / <?=$panel[$user]['BACKUPS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['BACKUPS']?></span></li>
+								<li><?=_('backups');?>: <span><?=$panel[$user]['U_BACKUPS']?> / <?=$panel[$user]['BACKUPS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['BACKUPS']?></span></li>
 							</ul>
 						</a>
 					</div>
-		<?php } ?>
-	<?php } ?>
+				<?php } ?>
+			<?php } ?>
 		</div>
 	</div>
+
 	<div class="l-separator"></div>

+ 1 - 1
web/templates/includes/title.html

@@ -1,2 +1,2 @@
 <meta charset="utf-8">
-<title><?php echo $_SERVER['HTTP_HOST']; ?> - <?=_($TAB)?> - <?=_('Hestia Control Panel');?></title>
+<title><?=$_SERVER['HTTP_HOST']; ?> - <?=_($TAB)?> - <?=_('Hestia Control Panel');?></title>

+ 418 - 437
web/templates/pages/add_cron.html

@@ -1,446 +1,427 @@
+<!-- Begin toolbar -->
 <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/cron/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/cron/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
-    <!-- /.l-separator -->
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-          $back = $_SESSION['back'];
-          if (empty($back)) {
-            $back = "location.href='/list/cron/'";
-          } else {
-            $back = "location.href='".$back."'";
-          }
-        ?>
+<div class="l-center animated fadeIn">
 
-                                <div class="vst-text step-top helper-container">
-                                    <div id="tabs"  class="cron-helper-tabs">
-                                      <ul>
-                                        <li><a href="#tabs-1"><?=_('Minutes')?></a></li>
-                                        <li><a href="#tabs-2"><?=_('Hourly')?></a></li>
-                                        <li><a href="#tabs-3"><?=_('Daily')?></a></li>
-                                        <li><a href="#tabs-4"><?=_('Weekly')?></a></li>
-                                        <li><a href="#tabs-5"><?=_('Monthly')?></a></li>
-                                      </ul>
-                                      <div id="tabs-1">
-                                        <form>
-                                            <input type="hidden" name="h_hour" value="*" />
-                                            <input type="hidden" name="h_day" value="*" />
-                                            <input type="hidden" name="h_month" value="*" />
-                                            <input type="hidden" name="h_wday" value="*" />
-                                            <p><span class="first"><?=_('Run Command')?>:</span>
-                                                <select name="h_min" class="vst-list">
-                                                    <option value="*"  selected="selected"><?=_('every minute')?></option>
-                                                    <option value="*/2"><?=_('every two minutes')?></option>
-                                                    <option value="*/5"><?=_('every')?> 5</option>
-                                                    <option value="*/10"><?=_('every')?> 10</option>
-                                                    <option value="*/15"><?=_('every')?> 15</option>
-                                                    <option value="*/30"><?=_('every')?> 30</option>
-                                                </select>
-                                            </p>
-                                            <p class="step-top">
-                                                <input type="submit" value="<?=_('generate')?>" class="button">
-                                            </p>
-                                        </form>
-                                      </div>
+	<div class="vst-text step-top helper-container">
+		<div id="tabs" class="cron-helper-tabs">
+			<ul>
+				<li><a href="#tabs-1"><?=_('Minutes');?></a></li>
+				<li><a href="#tabs-2"><?=_('Hourly');?></a></li>
+				<li><a href="#tabs-3"><?=_('Daily');?></a></li>
+				<li><a href="#tabs-4"><?=_('Weekly');?></a></li>
+				<li><a href="#tabs-5"><?=_('Monthly');?></a></li>
+			</ul>
+			<div id="tabs-1">
+				<form>
+					<input type="hidden" name="h_hour" value="*" />
+					<input type="hidden" name="h_day" value="*" />
+					<input type="hidden" name="h_month" value="*" />
+					<input type="hidden" name="h_wday" value="*" />
+					<p><span class="first"><?=_('Run Command');?>:</span>
+						<select name="h_min" class="vst-list">
+							<option value="*" selected="selected"><?=_('every minute');?></option>
+							<option value="*/2"><?=_('every two minutes');?></option>
+							<option value="*/5"><?=_('every');?> 5</option>
+							<option value="*/10"><?=_('every');?> 10</option>
+							<option value="*/15"><?=_('every');?> 15</option>
+							<option value="*/30"><?=_('every');?> 30</option>
+						</select>
+					</p>
+					<p class="step-top">
+						<input type="submit" value="<?=_('generate');?>" class="button">
+					</p>
+				</form>
+			</div>
 
+			<div id="tabs-2">
+				<form>
+					<input type="hidden" name="h_day" value="*" />
+					<input type="hidden" name="h_month" value="*" />
+					<input type="hidden" name="h_wday" value="*" />
+					<p><span class="first"><?=_('Run Command');?>:</span>
+						<select name="h_hour" class="vst-list">
+							<option value="*" selected="selected"><?=_('every hour');?></option>
+							<option value="*/2"><?=_('every two hours');?></option>
+							<option value="*/6"><?=_('every');?> 6</option>
+							<option value="*/12"><?=_('every');?> 12</option>
+						</select>
+					</p>
+					<p><span class="first"><?=_('Minute');?>:</span>
+						<select name="h_min" class="vst-list short">
+							<option value="0" selected="selected">00</option>
+							<option value="15">15</option>
+							<option value="30">30</option>
+							<option value="45">45</option>
+						</select>
+					</p>
+					<p class="step-top">
+						<input type="submit" value="<?=_('generate');?>" class="button">
+					</p>
+				</form>
+			</div>
 
-                                      <div id="tabs-2">
-                                        <form>
-                                            <input type="hidden" name="h_day" value="*" />
-                                            <input type="hidden" name="h_month" value="*" />
-                                            <input type="hidden" name="h_wday" value="*" />
-                                            <p><span class="first"><?=_('Run Command')?>:</span>
-                                                <select name="h_hour" class="vst-list">
-                                                    <option value="*" selected="selected"><?=_('every hour')?></option>
-                                                    <option value="*/2"><?=_('every two hours')?></option>
-                                                    <option value="*/6"><?=_('every')?> 6</option>
-                                                    <option value="*/12"><?=_('every')?> 12</option>
-                                                </select>
-                                            </p>
+			<div id="tabs-3">
+				<form>
+					<input type="hidden" name="h_month" value="*" />
+					<input type="hidden" name="h_wday" value="*" />
+					<p><span class="first"><?=_('Run Command');?>:</span>
+						<select name="h_day" class="vst-list">
+							<option value="*" selected="selected"><?=_('every day');?></option>
+							<option value="1-31/2"><?=_('every odd day');?></option>
+							<option value="*/2"><?=_('every even day');?></option>
+							<option value="*/3"><?=_('every');?> 3</option>
+							<option value="*/5"><?=_('every');?> 5</option>
+							<option value="*/10"><?=_('every');?> 10</option>
+							<option value="*/15"><?=_('every');?> 15</option>
+						</select>
+					</p>
+					<p><span class="first"><?=_('Hour');?>:</span>
+						<select name="h_hour" class="vst-list short">
+							<option value="0">00</option>
+							<option value="1">01</option>
+							<option value="2">02</option>
+							<option value="3">03</option>
+							<option value="4">04</option>
+							<option value="5">05</option>
+							<option value="6">06</option>
+							<option value="7">07</option>
+							<option value="8">08</option>
+							<option value="9">09</option>
+							<option value="10">10</option>
+							<option value="11">11</option>
+							<option value="12" selected="selected">12</option>
+							<option value="13">13</option>
+							<option value="14">14</option>
+							<option value="15">15</option>
+							<option value="16">16</option>
+							<option value="17">17</option>
+							<option value="18">18</option>
+							<option value="19">19</option>
+							<option value="20">20</option>
+							<option value="21">21</option>
+							<option value="22">22</option>
+							<option value="23">23</option>
+						</select>
+						<span><?=_('Minute');?>:</span>
+						<select name="h_min" class="vst-list  short">
+							<option value="0" selected="selected">00</option>
+							<option value="1">01</option>
+							<option value="2">02</option>
+							<option value="5">05</option>
+							<option value="10">10</option>
+							<option value="15">15</option>
+							<option value="20">20</option>
+							<option value="25">25</option>
+							<option value="30">30</option>
+							<option value="35">35</option>
+							<option value="40">40</option>
+							<option value="45">45</option>
+							<option value="50">50</option>
+							<option value="55">55</option>
+						</select>
+					</p>
+					<p class="step-top">
+						<input type="submit" value="<?=_('generate');?>" class="button">
+					</p>
+				</form>
+			</div>
 
-                                            <p><span class="first"><?=_('Minute')?>:</span>
-                                                <select name="h_min" class="vst-list short">
-                                                    <option value="0" selected="selected">00</option>
-                                                    <option value="15">15</option>
-                                                    <option value="30">30</option>
-                                                    <option value="45">45</option>
-                                                </select>
-                                            </p>
+			<div id="tabs-4">
+				<form>
+					<input type="hidden" name="h_month" value="*" />
+					<input type="hidden" name="h_day" value="*" />
+					<p><span class="first"><?=_('Run Command');?>:</span>
+						<select name="h_wday" class="vst-list">
+							<option value="*" selected="selected"><?=_('every day');?></option>
+							<option value="1,2,3,4,5"><?=_('weekdays (5 days)');?></option>
+							<option value="0,6"><?=_('weekend (2 days)');?></option>
+							<option value="1"><?=_('Monday');?></option>
+							<option value="2"><?=_('Tuesday');?></option>
+							<option value="3"><?=_('Wednesday');?></option>
+							<option value="4"><?=_('Thursday');?></option>
+							<option value="5"><?=_('Friday');?></option>
+							<option value="6"><?=_('Saturday');?></option>
+							<option value="0"><?=_('Sunday');?></option>
+						</select>
+					</p>
+					<p><span class="first"><?=_('Hour');?>:</span>
+						<select name="h_hour" class="vst-list short">
+							<option value="0">00</option>
+							<option value="1">01</option>
+							<option value="2">02</option>
+							<option value="3">03</option>
+							<option value="4">04</option>
+							<option value="5">05</option>
+							<option value="6">06</option>
+							<option value="7">07</option>
+							<option value="8">08</option>
+							<option value="9">09</option>
+							<option value="10">10</option>
+							<option value="11">11</option>
+							<option value="12" selected="selected">12</option>
+							<option value="13">13</option>
+							<option value="14">14</option>
+							<option value="15">15</option>
+							<option value="16">16</option>
+							<option value="17">17</option>
+							<option value="18">18</option>
+							<option value="19">19</option>
+							<option value="20">20</option>
+							<option value="21">21</option>
+							<option value="22">22</option>
+							<option value="23">23</option>
+						</select>
+						<span><?=_('Minute');?>:</span>
+						<select name="h_min" class="vst-list short">
+							<option value="0" selected="selected">00</option>
+							<option value="1">01</option>
+							<option value="2">02</option>
+							<option value="5">05</option>
+							<option value="10">10</option>
+							<option value="15">15</option>
+							<option value="20">20</option>
+							<option value="25">25</option>
+							<option value="30">30</option>
+							<option value="35">35</option>
+							<option value="40">40</option>
+							<option value="45">45</option>
+							<option value="50">50</option>
+							<option value="55">55</option>
+						</select>
+					</p>
+					<p class="step-top">
+						<input type="submit" value="<?=_('generate');?>" class="button">
+					</p>
+				</form>
+			</div>
 
-                                            <p class="step-top">
-                                                <input type="submit" value="<?=_('generate')?>" class="button">
-                                            </p>
-                                        </form>
-                                      </div>
+			<div id="tabs-5">
+				<form>
+					<input type="hidden" name="h_wday" value="*" />
+					<p><span class="first"><?=_('Run Command');?>:</span>
+						<select name="h_month" class="vst-list">
+							<option value="*" selected="selected"><?=_('every month');?></option>
+							<option value="1-11/2"><?=_('every odd month');?></option>
+							<option value="*/2"><?=_('every even month');?></option>
+							<option value="*/3"><?=_('every');?> 3</option>
+							<option value="*/6"><?=_('every');?> 6</option>
+							<option value="1"><?=_('Jan');?></option>
+							<option value="2"><?=_('Feb');?></option>
+							<option value="3"><?=_('Mar');?></option>
+							<option value="4"><?=_('Apr');?></option>
+							<option value="5"><?=_('May');?></option>
+							<option value="6"><?=_('Jun');?></option>
+							<option value="7"><?=_('Jul');?></option>
+							<option value="8"><?=_('Aug');?></option>
+							<option value="9"><?=_('Sep');?></option>
+							<option value="10"><?=_('Oct');?></option>
+							<option value="11"><?=_('Nov');?></option>
+							<option value="12"><?=_('Dec');?></option>
+						</select>
+					</p>
+					<p><span class="first"><?=_('Date');?>:</span>
+						<select name="h_day" class="vst-list short">
+							<option value="1" selected="selected">1</option>
+							<option value="2">2</option>
+							<option value="3">3</option>
+							<option value="4">4</option>
+							<option value="5">5</option>
+							<option value="6">6</option>
+							<option value="7">7</option>
+							<option value="8">8</option>
+							<option value="9">9</option>
+							<option value="10">10</option>
+							<option value="11">11</option>
+							<option value="12">12</option>
+							<option value="13">13</option>
+							<option value="14">14</option>
+							<option value="15">15</option>
+							<option value="16">16</option>
+							<option value="17">17</option>
+							<option value="18">18</option>
+							<option value="19">19</option>
+							<option value="20">20</option>
+							<option value="21">21</option>
+							<option value="22">22</option>
+							<option value="23">23</option>
+							<option value="24">24</option>
+							<option value="25">25</option>
+							<option value="26">26</option>
+							<option value="27">27</option>
+							<option value="28">28</option>
+							<option value="29">29</option>
+							<option value="30">30</option>
+							<option value="31">31</option>
+						</select>
+						<span><?=_('Hour');?>:</span>
+						<select name="h_hour" class="vst-list short">
+							<option value="0">00</option>
+							<option value="1">01</option>
+							<option value="2">02</option>
+							<option value="3">03</option>
+							<option value="4">04</option>
+							<option value="5">05</option>
+							<option value="6">06</option>
+							<option value="7">07</option>
+							<option value="8">08</option>
+							<option value="9">09</option>
+							<option value="10">10</option>
+							<option value="11">11</option>
+							<option value="12" selected="selected">12</option>
+							<option value="13">13</option>
+							<option value="14">14</option>
+							<option value="15">15</option>
+							<option value="16">16</option>
+							<option value="17">17</option>
+							<option value="18">18</option>
+							<option value="19">19</option>
+							<option value="20">20</option>
+							<option value="21">21</option>
+							<option value="22">22</option>
+							<option value="23">23</option>
+						</select>
+						<span><?=_('Minute');?>:</span>
+						<select name="h_min" class="vst-list short">
+							<option value="0" selected="selected">00</option>
+							<option value="1">01</option>
+							<option value="2">02</option>
+							<option value="5">05</option>
+							<option value="10">10</option>
+							<option value="15">15</option>
+							<option value="20">20</option>
+							<option value="25">25</option>
+							<option value="30">30</option>
+							<option value="35">35</option>
+							<option value="40">40</option>
+							<option value="45">45</option>
+							<option value="50">50</option>
+							<option value="55">55</option>
+						</select>
+					</p>
+					<p class="step-top">
+						<input type="submit" value="<?=_('generate');?>" class="button">
+					</p>
+				</form>
+			</div>
+		</div>
+	</div>
 
-
-                                      <div id="tabs-3">
-                                        <form>
-                                            <input type="hidden" name="h_month" value="*" />
-                                            <input type="hidden" name="h_wday" value="*" />
-                                            <p><span class="first"><?=_('Run Command')?>:</span>
-                                                <select name="h_day" class="vst-list">
-                                                    <option value="*" selected="selected"><?=_('every day')?></option>
-                                                    <option value="1-31/2"><?=_('every odd day')?></option>
-                                                    <option value="*/2"><?=_('every even day')?></option>
-                                                    <option value="*/3"><?=_('every')?> 3</option>
-                                                    <option value="*/5"><?=_('every')?> 5</option>
-                                                    <option value="*/10"><?=_('every')?> 10</option>
-                                                    <option value="*/15"><?=_('every')?> 15</option>
-                                                </select>
-                                            </p>
-
-                                            <p><span class="first"><?=_('Hour')?>:</span>
-                                                <select name="h_hour" class="vst-list short">
-                                                    <option value="0">00</option>
-                                                    <option value="1">01</option>
-                                                    <option value="2">02</option>
-                                                    <option value="3">03</option>
-                                                    <option value="4">04</option>
-                                                    <option value="5">05</option>
-                                                    <option value="6">06</option>
-                                                    <option value="7">07</option>
-                                                    <option value="8">08</option>
-                                                    <option value="9">09</option>
-                                                    <option value="10">10</option>
-                                                    <option value="11">11</option>
-                                                    <option value="12"  selected="selected">12</option>
-                                                    <option value="13">13</option>
-                                                    <option value="14">14</option>
-                                                    <option value="15">15</option>
-                                                    <option value="16">16</option>
-                                                    <option value="17">17</option>
-                                                    <option value="18">18</option>
-                                                    <option value="19">19</option>
-                                                    <option value="20">20</option>
-                                                    <option value="21">21</option>
-                                                    <option value="22">22</option>
-                                                    <option value="23">23</option>
-                                                </select>
-
-                                                <span><?=_('Minute')?>:</span>
-                                                <select name="h_min" class="vst-list  short">
-                                                    <option value="0" selected="selected">00</option>
-                                                    <option value="1">01</option>
-                                                    <option value="2">02</option>
-                                                    <option value="5">05</option>
-                                                    <option value="10">10</option>
-                                                    <option value="15">15</option>
-                                                    <option value="20">20</option>
-                                                    <option value="25">25</option>
-                                                    <option value="30">30</option>
-                                                    <option value="35">35</option>
-                                                    <option value="40">40</option>
-                                                    <option value="45">45</option>
-                                                    <option value="50">50</option>
-                                                    <option value="55">55</option>
-                                                </select>
-                                            </p>
-                                            <p class="step-top">
-                                                <input type="submit" value="<?=_('generate')?>" class="button">
-                                            </p>
-                                        </form>
-                                      </div>
-
-
-                                      <div id="tabs-4">
-                                        <form>
-                                            <input type="hidden" name="h_month" value="*" />
-                                            <input type="hidden" name="h_day" value="*" />
-
-                                            <p><span class="first"><?=_('Run Command')?>:</span>
-                                                <select name="h_wday" class="vst-list">
-                                                    <option value="*" selected="selected"><?=_('every day')?></option>
-                                                    <option value="1,2,3,4,5"><?=_('weekdays (5 days)')?></option>
-                                                    <option value="0,6"><?=_('weekend (2 days)')?></option>
-                                                    <option value="1"><?=_('Monday')?></option>
-                                                    <option value="2"><?=_('Tuesday')?></option>
-                                                    <option value="3"><?=_('Wednesday')?></option>
-                                                    <option value="4"><?=_('Thursday')?></option>
-                                                    <option value="5"><?=_('Friday')?></option>
-                                                    <option value="6"><?=_('Saturday')?></option>
-                                                    <option value="0"><?=_('Sunday')?></option>
-                                                </select>
-                                            </p>
-
-                                            <p><span class="first"><?=_('Hour')?>:</span>
-                                                <select name="h_hour" class="vst-list short">
-                                                    <option value="0">00</option>
-                                                    <option value="1">01</option>
-                                                    <option value="2">02</option>
-                                                    <option value="3">03</option>
-                                                    <option value="4">04</option>
-                                                    <option value="5">05</option>
-                                                    <option value="6">06</option>
-                                                    <option value="7">07</option>
-                                                    <option value="8">08</option>
-                                                    <option value="9">09</option>
-                                                    <option value="10">10</option>
-                                                    <option value="11">11</option>
-                                                    <option value="12"  selected="selected">12</option>
-                                                    <option value="13">13</option>
-                                                    <option value="14">14</option>
-                                                    <option value="15">15</option>
-                                                    <option value="16">16</option>
-                                                    <option value="17">17</option>
-                                                    <option value="18">18</option>
-                                                    <option value="19">19</option>
-                                                    <option value="20">20</option>
-                                                    <option value="21">21</option>
-                                                    <option value="22">22</option>
-                                                    <option value="23">23</option>
-                                                </select>
-
-                                                <span><?=_('Minute')?>:</span>
-                                                <select name="h_min" class="vst-list short">
-                                                    <option value="0" selected="selected">00</option>
-                                                    <option value="1">01</option>
-                                                    <option value="2">02</option>
-                                                    <option value="5">05</option>
-                                                    <option value="10">10</option>
-                                                    <option value="15">15</option>
-                                                    <option value="20">20</option>
-                                                    <option value="25">25</option>
-                                                    <option value="30">30</option>
-                                                    <option value="35">35</option>
-                                                    <option value="40">40</option>
-                                                    <option value="45">45</option>
-                                                    <option value="50">50</option>
-                                                    <option value="55">55</option>
-                                                </select>
-                                            </p>
-
-                                            <p class="step-top">
-                                                <input type="submit" value="<?=_('generate')?>" class="button">
-                                            </p>
-                                        </form>
-                                      </div>
-
-
-                                      <div id="tabs-5">
-                                        <form>
-                                            <input type="hidden" name="h_wday" value="*" />
-
-                                            <p><span class="first"><?=_('Run Command')?>:</span>
-                                                <select name="h_month" class="vst-list">
-                                                    <option value="*" selected="selected"><?=_('every month')?></option>
-                                                    <option value="1-11/2"><?=_('every odd month')?></option>
-                                                    <option value="*/2"><?=_('every even month')?></option>
-                                                    <option value="*/3"><?=_('every')?> 3</option>
-                                                    <option value="*/6"><?=_('every')?> 6</option>
-                                                    <option value="1"><?=_('Jan')?></option>
-                                                    <option value="2"><?=_('Feb')?></option>
-                                                    <option value="3"><?=_('Mar')?></option>
-                                                    <option value="4"><?=_('Apr')?></option>
-                                                    <option value="5"><?=_('May')?></option>
-                                                    <option value="6"><?=_('Jun')?></option>
-                                                    <option value="7"><?=_('Jul')?></option>
-                                                    <option value="8"><?=_('Aug')?></option>
-                                                    <option value="9"><?=_('Sep')?></option>
-                                                    <option value="10"><?=_('Oct')?></option>
-                                                    <option value="11"><?=_('Nov')?></option>
-                                                    <option value="12"><?=_('Dec')?></option>
-                                                </select>
-                                            </p>
-
-                                            <p><span class="first"><?=_('Date')?>:</span>
-                                                <select name="h_day" class="vst-list short">
-                                                    <option value="1" selected="selected">1</option>
-                                                    <option value="2">2</option>
-                                                    <option value="3">3</option>
-                                                    <option value="4">4</option>
-                                                    <option value="5">5</option>
-                                                    <option value="6">6</option>
-                                                    <option value="7">7</option>
-                                                    <option value="8">8</option>
-                                                    <option value="9">9</option>
-                                                    <option value="10">10</option>
-                                                    <option value="11">11</option>
-                                                    <option value="12">12</option>
-                                                    <option value="13">13</option>
-                                                    <option value="14">14</option>
-                                                    <option value="15">15</option>
-                                                    <option value="16">16</option>
-                                                    <option value="17">17</option>
-                                                    <option value="18">18</option>
-                                                    <option value="19">19</option>
-                                                    <option value="20">20</option>
-                                                    <option value="21">21</option>
-                                                    <option value="22">22</option>
-                                                    <option value="23">23</option>
-                                                    <option value="24">24</option>
-                                                    <option value="25">25</option>
-                                                    <option value="26">26</option>
-                                                    <option value="27">27</option>
-                                                    <option value="28">28</option>
-                                                    <option value="29">29</option>
-                                                    <option value="30">30</option>
-                                                    <option value="31">31</option>
-                                                </select>
-
-                                                <span><?=_('Hour')?>:</span>
-                                                <select name="h_hour" class="vst-list short">
-                                                    <option value="0">00</option>
-                                                    <option value="1">01</option>
-                                                    <option value="2">02</option>
-                                                    <option value="3">03</option>
-                                                    <option value="4">04</option>
-                                                    <option value="5">05</option>
-                                                    <option value="6">06</option>
-                                                    <option value="7">07</option>
-                                                    <option value="8">08</option>
-                                                    <option value="9">09</option>
-                                                    <option value="10">10</option>
-                                                    <option value="11">11</option>
-                                                    <option value="12"  selected="selected">12</option>
-                                                    <option value="13">13</option>
-                                                    <option value="14">14</option>
-                                                    <option value="15">15</option>
-                                                    <option value="16">16</option>
-                                                    <option value="17">17</option>
-                                                    <option value="18">18</option>
-                                                    <option value="19">19</option>
-                                                    <option value="20">20</option>
-                                                    <option value="21">21</option>
-                                                    <option value="22">22</option>
-                                                    <option value="23">23</option>
-                                                </select>
-
-                                                <span><?=_('Minute')?>:</span>
-                                                <select name="h_min" class="vst-list short">
-                                                    <option value="0" selected="selected">00</option>
-                                                    <option value="1">01</option>
-                                                    <option value="2">02</option>
-                                                    <option value="5">05</option>
-                                                    <option value="10">10</option>
-                                                    <option value="15">15</option>
-                                                    <option value="20">20</option>
-                                                    <option value="25">25</option>
-                                                    <option value="30">30</option>
-                                                    <option value="35">35</option>
-                                                    <option value="40">40</option>
-                                                    <option value="45">45</option>
-                                                    <option value="50">50</option>
-                                                    <option value="55">55</option>
-                                                </select>
-                                            </p>
-
-                                            <p class="step-top">
-                                                <input type="submit" value="<?=_('generate')?>" class="button">
-                                            </p>
-                                        </form>
-                                      </div>
-                                    </div>
-                                </div>
-
-        <form id="vstobjects" name="v_add_cron" 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" width="600px">
-                            <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Adding Cron Job')?></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 input-label">
-                                    <?php print _('Command');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="30" class="vst-input long" name="v_cmd" value="<?=htmlentities(trim($v_cmd, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text step-top">
-                                    <?php print _('Minute');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input short" name="v_min" value="<?=htmlentities(trim($v_min, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Hour');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input short" name="v_hour" value="<?=htmlentities(trim($v_hour, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Day');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input short" name="v_day" value="<?=htmlentities(trim($v_day, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Month');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input short" name="v_month" value="<?=htmlentities(trim($v_month, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Day of week');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input short" name="v_wday" value="<?=htmlentities(trim($v_wday, "'"))?>">
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2">
-                        </table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+	<form id="vstobjects" name="v_add_cron" 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" width="600px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Adding Cron Job');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Command');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="30" class="vst-input long" name="v_cmd" value="<?=htmlentities(trim($v_cmd, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Minute');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input short" name="v_min" value="<?=htmlentities(trim($v_min, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Hour');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input short" name="v_hour" value="<?=htmlentities(trim($v_hour, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Day');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input short" name="v_day" value="<?=htmlentities(trim($v_day, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Month');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input short" name="v_month" value="<?=htmlentities(trim($v_month, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Day of week');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input short" name="v_wday" value="<?=htmlentities(trim($v_wday, "'"))?>">
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2">
+					</table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 241 - 238
web/templates/pages/add_db.html

@@ -1,242 +1,245 @@
+<!-- Begin toolbar -->
 <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/db/"><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" 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-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/db/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-center animated fadeIn">
-        <?php
-          $back = $_SESSION['back'];
-          if (empty($back)) {
-            $back = "location.href='/list/db/'";
-          } else {
-            $back = "location.href='".$back."'";
-          }
-        ?>
-        <form id="vstobjects" name="v_add_db" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="ok" value="Add" />
+<div class="l-separator"></div>
 
-            <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" width="600px">
-                            <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Adding database')?></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>
-                            <? if (($user == 'admin') && (($_GET['accept'] !== "true")))  {?>
-                                <tr>
-                                    <td class="step-top">
-                                        <span class="alert alert-danger alert-with-icon">
-                                            <i class="fas fa-exclamation"></i>
-                                            <?=_('Avoid adding web domains on admin account')?>
-                                        </span>
-                                    </td>
-                                </tr>
-                            <?php } ?>
-                            <? if (($user == 'admin') && (empty($_GET['accept']))) {?>
-                                <tr>
-                                    <td class="step-top">
-                                        <span><a href="/add/user/" class="vst-advanced admin-warning-button"><?=_('Add User')?></a></span>
-                                        <span><a href="/add/db/?accept=true" class="vst-advanced button danger admin-warning-button"><?=_('Continue')?></a> </span>
-                                    </td>
-                                </tr>
-                            <? } ?>
-                            <? if (($user == 'admin') && (($_GET['accept'] === "true")) || ($user !== "admin"))  {?>
-                                <tr>
-                                    <td class="hint">
-                                        <?php print sprintf(_('Prefix %s will be automatically added to database name and database user'),'<b>'.$user.'_</b>'); ?>
-                                    </td>
-                                    </td>
-                                </tr>
-                                <tr>
-                                    <td class="vst-text step-top input-label">
-                                        <?php print _('Database');?>
-                                    </td>
-                                </tr>
-                                <tr>
-                                    <td>
-                                        <input type="text" size="20" class="vst-input" name="v_database" value="<?=htmlentities(trim($v_database, "'"))?>">
-                                        <small class="hint"></small>
-                                    </td>
-                                </tr>
-                                <tr>
-                                    <td class="vst-text input-label">
-                                        <?php print _('Type');?>
-                                    </td>
-                                </tr>
-                                <tr>
-                                    <td>
-                                        <select class="vst-list" name="v_type">
-                                            <?php
-                                                foreach ($db_types as $key => $value) {
-                                                    echo "\n\t\t\t\t\t\t\t\t\t\t<option value=\"".htmlentities($value)."\"";
-                                                    if ((!empty($v_type)) && ( $value == $v_type )) echo ' selected';
-                                                    echo ">".htmlentities($value)."</option>";
-                                                }
-                                            ?>
-                                        </select>
-                                    </td>
-                                </tr>
-                                <tr>
-                                    <td class="vst-text input-label">
-                                        <?php
-                                            print _('Username');
-                                            echo "&nbsp;&nbsp;&nbsp;&nbsp;<em><small>(".sprintf(_('maximum characters length, including prefix'), 32).")</small></em>";
-                                        ?>
-                                    </td>
-                                </tr>
-                                <tr>
-                                    <td>
-                                        <input type="text" size="20" class="vst-input" name="v_dbuser" value="<?=htmlentities(trim($v_dbuser, "'"))?>">
-                                        <small class="hint"></small>
-                                    </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"><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 class="vst-text input-label">
-                                        <?php print _('Send login credentials to email address') ?>
-                                    </td>
-                                </tr>
-                                <tr>
-                                    <td>
-                                        <input type="text"  class="vst-input" name="v_db_email" value="<?=htmlentities(trim($v_db_email, "'"))?>">
-                                    </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 _('Host');?>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td>
-                                                    <select class="vst-list" name="v_host">
-                                                        <?php
-                                                            foreach ($db_hosts as $value) {
-                                                                echo "\n\t\t\t\t\t\t\t\t\t\t<option value=\"".htmlentities($value)."\"";
-                                                                if ((!empty($v_host)) && ( $value == $v_host )) echo ' selected';
-                                                                echo ">".htmlentities($value)."</option>";
-                                                            }
-                                                        ?>
-                                                    </select>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td class="vst-text input-label">
-                                                    <?php print _('Charset');?>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td>
-                                                    <select class="vst-list" name="v_charset">
-                                                        <option value=big5 <?php if ((!empty($v_charset)) && ( $v_charset == 'big5')) echo 'selected';?> >big5</option>
-                                                        <option value=dec8 <?php if ((!empty($v_charset)) && ( $v_charset == 'dec8')) echo 'selected';?> >dec8</option>
-                                                        <option value=cp850 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp850')) echo 'selected';?> >cp850</option>
-                                                        <option value=hp8 <?php if ((!empty($v_charset)) && ( $v_charset == 'hp8')) echo 'selected';?> >hp8</option>
-                                                        <option value=koi8r <?php if ((!empty($v_charset)) && ( $v_charset == 'koi8r')) echo 'selected';?> >koi8r</option>
-                                                        <option value=latin1 <?php if ((!empty($v_charset)) && ( $v_charset == 'latin1')) echo 'selected';?> >latin1</option>
-                                                        <option value=latin2 <?php if ((!empty($v_charset)) && ( $v_charset == 'latin2')) echo 'selected';?> >latin2</option>
-                                                        <option value=swe7 <?php if ((!empty($v_charset)) && ( $v_charset == 'swe7')) echo 'selected';?> >swe7</option>
-                                                        <option value=ascii <?php if ((!empty($v_charset)) && ( $v_charset == 'ascii')) echo 'selected';?> >ascii</option>
-                                                        <option value=ujis <?php if ((!empty($v_charset)) && ( $v_charset == 'ujis')) echo 'selected';?> >ujis</option>
-                                                        <option value=sjis <?php if ((!empty($v_charset)) && ( $v_charset == 'sjis')) echo 'selected';?> >sjis</option>
-                                                        <option value=hebrew <?php if ((!empty($v_charset)) && ( $v_charset == 'hebrew')) echo 'selected';?> >hebrew</option>
-                                                        <option value=tis620 <?php if ((!empty($v_charset)) && ( $v_charset == 'tis620')) echo 'selected';?> >tis620</option>
-                                                        <option value=euckr <?php if ((!empty($v_charset)) && ( $v_charset == 'euckr')) echo 'selected';?> >euckr</option>
-                                                        <option value=koi8u <?php if ((!empty($v_charset)) && ( $v_charset == 'koi8u')) echo 'selected';?> >koi8u</option>
-                                                        <option value=gb2312 <?php if ((!empty($v_charset)) && ( $v_charset == 'gb2312')) echo 'selected';?> >gb2312</option>
-                                                        <option value=greek <?php if ((!empty($v_charset)) && ( $v_charset == 'greek')) echo 'selected';?> >greek</option>
-                                                        <option value=cp1250 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp1250')) echo 'selected';?> >cp1250</option>
-                                                        <option value=gbk <?php if ((!empty($v_charset)) && ( $v_charset == 'gbk')) echo 'selected';?> >gbk</option>
-                                                        <option value=latin5 <?php if ((!empty($v_charset)) && ( $v_charset == 'latin5')) echo 'selected';?> >latin5</option>
-                                                        <option value=armscii8 <?php if ((!empty($v_charset)) && ( $v_charset == 'armscii8')) echo 'selected';?> >armscii8</option>
-                                                        <option value=utf8 <?php if ((!empty($v_charset)) && ( $v_charset == 'utf8')) echo 'selected';?> <?php if (empty($v_charset)) echo 'selected';?> >utf8</option>
-                                                        <option value=utf8mb4 <?php if ((!empty($v_charset)) && ( $v_charset == 'utf8mb4')) echo 'selected';?> >utf8mb4</option>
-                                                        <option value=ucs2 <?php if ((!empty($v_charset)) && ( $v_charset == 'ucs2')) echo 'selected';?> >ucs2</option>
-                                                        <option value=cp866 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp866')) echo 'selected';?> >cp866</option>
-                                                        <option value=keybcs2 <?php if ((!empty($v_charset)) && ( $v_charset == 'keybcs2')) echo 'selected';?> >keybcs2</option>
-                                                        <option value=macce <?php if ((!empty($v_charset)) && ( $v_charset == 'macce')) echo 'selected';?> >macce</option>
-                                                        <option value=macroman <?php if ((!empty($v_charset)) && ( $v_charset == 'macroman')) echo 'selected';?> >macroman</option>
-                                                        <option value=cp852 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp852')) echo 'selected';?> >cp852</option>
-                                                        <option value=latin7 <?php if ((!empty($v_charset)) && ( $v_charset == 'latin7')) echo 'selected';?> >latin7</option>
-                                                        <option value=cp1251 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp1251')) echo 'selected';?> >cp1251</option>
-                                                        <option value=cp1256 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp1256')) echo 'selected';?> >cp1256</option>
-                                                        <option value=cp1257 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp1257')) echo 'selected';?> >cp1257</option>
-                                                        <option value=binary <?php if ((!empty($v_charset)) && ( $v_charset == 'binary')) echo 'selected';?> >binary</option>
-                                                        <option value=geostd8 <?php if ((!empty($v_charset)) && ( $v_charset == 'geostd8')) echo 'selected';?> >geostd8</option>
-                                                        <option value=cp932 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp932')) echo 'selected';?> >cp932</option>
-                                                        <option value=eucjpms <?php if ((!empty($v_charset)) && ( $v_charset == 'eucjpms')) echo 'selected';?> >eucjpms</option>
-                                                    </select>
-                                                </td>
-                                            </tr>
-                                        </table>
-                                    </td>
-                                </tr>
-                            </table>
-                            <table class="data-col2">
-                            </table>
-                        </td>
-                    </tr>
-                    <? } ?>
-            </table>
-        </form>
-    </div>
+<div class="l-center animated fadeIn">
 
-    <script>
-        GLOBAL.DB_USER_PREFIX = <?=json_encode($user.'_')?>;
-        GLOBAL.DB_DBNAME_PREFIX = <?=json_encode($user.'_')?>;
-    </script>
+	<form id="vstobjects" name="v_add_db" 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" width="600px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Adding database');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<?php if (($user == 'admin') && (($_GET['accept'] !== "true")))  {?>
+							<tr>
+								<td class="step-top">
+									<span class="alert alert-danger alert-with-icon">
+										<i class="fas fa-exclamation"></i>
+										<?=_('Avoid adding web domains on admin account');?>
+									</span>
+								</td>
+							</tr>
+						<?php } ?>
+						<?php if (($user == 'admin') && (empty($_GET['accept']))) {?>
+							<tr>
+								<td class="step-top">
+									<span><a href="/add/user/" class="vst-advanced admin-warning-button"><?=_('Add User');?></a></span>
+									<span><a href="/add/db/?accept=true" class="vst-advanced button danger admin-warning-button"><?=_('Continue');?></a> </span>
+								</td>
+							</tr>
+						<?php } ?>
+						<?php if (($user == 'admin') && (($_GET['accept'] === "true")) || ($user !== "admin"))  {?>
+							<tr>
+								<td class="hint">
+									<?=sprintf(_('Prefix %s will be automatically added to database name and database user'),'<b>'.$user.'_</b>'); ?>
+								</td>
+								</td>
+							</tr>
+							<tr>
+								<td class="vst-text step-top input-label">
+									<?=_('Database');?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<input type="text" size="20" class="vst-input" name="v_database" value="<?=htmlentities(trim($v_database, "'"))?>">
+									<small class="hint"></small>
+								</td>
+							</tr>
+							<tr>
+								<td class="vst-text input-label">
+									<?=_('Type');?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<select class="vst-list" name="v_type">
+										<?php
+											foreach ($db_types as $key => $value) {
+												echo "\n\t\t\t\t\t\t\t\t\t\t<option value=\"".htmlentities($value)."\"";
+												if ((!empty($v_type)) && ( $value == $v_type )) echo ' selected';
+												echo ">".htmlentities($value)."</option>";
+											}
+										?>
+									</select>
+								</td>
+							</tr>
+							<tr>
+								<td class="vst-text input-label">
+									<?php
+										print _('Username');
+										echo "&nbsp;&nbsp;&nbsp;&nbsp;<em><small>(".sprintf(_('maximum characters length, including prefix'), 32).")</small></em>";
+									?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<input type="text" size="20" class="vst-input" name="v_dbuser" value="<?=htmlentities(trim($v_dbuser, "'"))?>">
+									<small class="hint"></small>
+								</td>
+							</tr>
+							<tr>
+								<td class="vst-text input-label">
+									<?=_('Password');?> <a href="javascript:randomString();" title="<?=_('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"><br />
+									<meter max="4" id="meter"></meter>
+								</td>
+							</tr>
+							<tr>
+								<td class="vst-text">
+									<?=_('Your password must have at least');?>:
+									<ul>
+										<li><?=_('8 characters long');?></li>
+										<li><?=_('1 uppercase & 1 lowercase character');?></li>
+										<li><?=_('1 number');?></li>
+									</ul>
+								</td>
+							</tr>
+							<tr>
+								<td class="vst-text input-label">
+									<?=_('Send login credentials to email address') ?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<input type="text" class="vst-input" name="v_db_email" value="<?=htmlentities(trim($v_db_email, "'"))?>">
+								</td>
+							</tr>
+							<tr>
+								<td class="step-top vst-text" style="/*padding: 32px 0 20px 0;*/">
+									<a href="javascript:elementHideShow('advanced-opts');" class="vst-advanced"><?=_('Advanced options');?></a>
+								</td>
+							</tr>
+							<tr>
+								<td class="step-top">
+									<table id="advanced-opts" style="display: none;">
+										<tr>
+											<td class="vst-text input-label">
+												<?=_('Host');?>
+											</td>
+										</tr>
+										<tr>
+											<td>
+												<select class="vst-list" name="v_host">
+													<?php
+														foreach ($db_hosts as $value) {
+															echo "\n\t\t\t\t\t\t\t\t\t\t<option value=\"".htmlentities($value)."\"";
+															if ((!empty($v_host)) && ( $value == $v_host )) echo ' selected';
+															echo ">".htmlentities($value)."</option>";
+														}
+													?>
+												</select>
+											</td>
+										</tr>
+										<tr>
+											<td class="vst-text input-label">
+												<?=_('Charset');?>
+											</td>
+										</tr>
+										<tr>
+											<td>
+												<select class="vst-list" name="v_charset">
+													<option value=big5 <?php if ((!empty($v_charset)) && ( $v_charset == 'big5')) echo 'selected';?>>big5</option>
+													<option value=dec8 <?php if ((!empty($v_charset)) && ( $v_charset == 'dec8')) echo 'selected';?>>dec8</option>
+													<option value=cp850 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp850')) echo 'selected';?>>cp850</option>
+													<option value=hp8 <?php if ((!empty($v_charset)) && ( $v_charset == 'hp8')) echo 'selected';?>>hp8</option>
+													<option value=koi8r <?php if ((!empty($v_charset)) && ( $v_charset == 'koi8r')) echo 'selected';?>>koi8r</option>
+													<option value=latin1 <?php if ((!empty($v_charset)) && ( $v_charset == 'latin1')) echo 'selected';?>>latin1</option>
+													<option value=latin2 <?php if ((!empty($v_charset)) && ( $v_charset == 'latin2')) echo 'selected';?>>latin2</option>
+													<option value=swe7 <?php if ((!empty($v_charset)) && ( $v_charset == 'swe7')) echo 'selected';?>>swe7</option>
+													<option value=ascii <?php if ((!empty($v_charset)) && ( $v_charset == 'ascii')) echo 'selected';?>>ascii</option>
+													<option value=ujis <?php if ((!empty($v_charset)) && ( $v_charset == 'ujis')) echo 'selected';?>>ujis</option>
+													<option value=sjis <?php if ((!empty($v_charset)) && ( $v_charset == 'sjis')) echo 'selected';?>>sjis</option>
+													<option value=hebrew <?php if ((!empty($v_charset)) && ( $v_charset == 'hebrew')) echo 'selected';?>>hebrew</option>
+													<option value=tis620 <?php if ((!empty($v_charset)) && ( $v_charset == 'tis620')) echo 'selected';?>>tis620</option>
+													<option value=euckr <?php if ((!empty($v_charset)) && ( $v_charset == 'euckr')) echo 'selected';?>>euckr</option>
+													<option value=koi8u <?php if ((!empty($v_charset)) && ( $v_charset == 'koi8u')) echo 'selected';?>>koi8u</option>
+													<option value=gb2312 <?php if ((!empty($v_charset)) && ( $v_charset == 'gb2312')) echo 'selected';?>>gb2312</option>
+													<option value=greek <?php if ((!empty($v_charset)) && ( $v_charset == 'greek')) echo 'selected';?>>greek</option>
+													<option value=cp1250 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp1250')) echo 'selected';?>>cp1250</option>
+													<option value=gbk <?php if ((!empty($v_charset)) && ( $v_charset == 'gbk')) echo 'selected';?>>gbk</option>
+													<option value=latin5 <?php if ((!empty($v_charset)) && ( $v_charset == 'latin5')) echo 'selected';?>>latin5</option>
+													<option value=armscii8 <?php if ((!empty($v_charset)) && ( $v_charset == 'armscii8')) echo 'selected';?>>armscii8</option>
+													<option value=utf8 <?php if ((!empty($v_charset)) && ( $v_charset == 'utf8')) echo 'selected';?> <?php if (empty($v_charset)) echo 'selected';?>>utf8</option>
+													<option value=utf8mb4 <?php if ((!empty($v_charset)) && ( $v_charset == 'utf8mb4')) echo 'selected';?>>utf8mb4</option>
+													<option value=ucs2 <?php if ((!empty($v_charset)) && ( $v_charset == 'ucs2')) echo 'selected';?>>ucs2</option>
+													<option value=cp866 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp866')) echo 'selected';?>>cp866</option>
+													<option value=keybcs2 <?php if ((!empty($v_charset)) && ( $v_charset == 'keybcs2')) echo 'selected';?>>keybcs2</option>
+													<option value=macce <?php if ((!empty($v_charset)) && ( $v_charset == 'macce')) echo 'selected';?>>macce</option>
+													<option value=macroman <?php if ((!empty($v_charset)) && ( $v_charset == 'macroman')) echo 'selected';?>>macroman</option>
+													<option value=cp852 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp852')) echo 'selected';?>>cp852</option>
+													<option value=latin7 <?php if ((!empty($v_charset)) && ( $v_charset == 'latin7')) echo 'selected';?>>latin7</option>
+													<option value=cp1251 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp1251')) echo 'selected';?>>cp1251</option>
+													<option value=cp1256 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp1256')) echo 'selected';?>>cp1256</option>
+													<option value=cp1257 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp1257')) echo 'selected';?>>cp1257</option>
+													<option value=binary <?php if ((!empty($v_charset)) && ( $v_charset == 'binary')) echo 'selected';?>>binary</option>
+													<option value=geostd8 <?php if ((!empty($v_charset)) && ( $v_charset == 'geostd8')) echo 'selected';?>>geostd8</option>
+													<option value=cp932 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp932')) echo 'selected';?>>cp932</option>
+													<option value=eucjpms <?php if ((!empty($v_charset)) && ( $v_charset == 'eucjpms')) echo 'selected';?>>eucjpms</option>
+												</select>
+											</td>
+										</tr>
+									</table>
+								</td>
+							</tr>
+						</table>
+						<table class="data-col2">
+						</table>
+					</td>
+				</tr>
+			<?php } ?>
+		</table>
+	</form>
+</div>
+
+<script>
+	GLOBAL.DB_USER_PREFIX = <?php json_encode($user.'_') ?>;
+	GLOBAL.DB_DBNAME_PREFIX = <?php json_encode($user.'_') ?>;
+</script>

+ 232 - 228
web/templates/pages/add_dns.html

@@ -1,233 +1,237 @@
+<!-- Begin toolbar -->
 <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/dns/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/dns/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-          $back = $_SESSION['back'];
-          if (empty($back)) {
-            $back = "location.href='/list/dns/'";
-          } else {
-            $back = "location.href='".$back."'";
-          }
-        ?>
-        <form id="vstobjects" name="v_add_dns" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="ok" value="Add" />
+<div class="l-center animated fadeIn">
 
-            <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" width="600px">
-                            <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Adding DNS Domain')?></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>
-                            <? if (($user == 'admin') && (($_GET['accept'] !== "true")))  {?>
-                                <tr>
-                                    <td class="step-top">
-                                        <span class="alert alert-danger alert-with-icon">
-                                            <i class="fas fa-exclamation"></i>
-                                            <?=_('Avoid adding web domains on admin account')?>
-                                        </span>
-                                    </td>
-                                </tr>
-                            <?php } ?>
-                            <? if (($user == 'admin') && (empty($_GET['accept']))) {?>
-                                <tr>
-                                    <td class="step-top">
-                                        <span><a href="/add/user/" class="vst-advanced admin-warning-button"><?=_('Add User')?></a></span>
-                                        <span><a href="/add/dns/?accept=true" class="vst-advanced button danger admin-warning-button"><?=_('Continue')?></a> </span>
-                                    </td>
-                                </tr>
-                            <? } ?>
-                            <? if (($user == 'admin') && (($_GET['accept'] === "true")) || ($user !== "admin"))  {?>
-                                <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" 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" tabindex="-1" onchange="this.nextElementSibling.value=this.value">
-                                            <option value="">clear</option>
-                                            <?php
-                                                foreach ($v_ips as $ip => $value) {
-                                                    $display_ip = empty($value['NAT']) ? $ip : "{$value['NAT']}";
-                                                    echo "<option value='{$display_ip}'>" . htmlentities($display_ip) . "</option>\n";
-                                                }
-                                            ?>
-                                        </select>
-                                        <input type="text" size="20" class="vst-input vst-list-editor" name="v_ip" value="<?=htmlentities(trim($v_ip, "'"))?>">
-                                    </td>
-                                </tr>
-                                <? if (($_SESSION['userContext'] === 'admin') || ($_SESSION['userContext'] === 'user') && ($_SESSION['POLICY_USER_EDIT_DNS_TEMPLATES'] === 'yes')) { ?>
-                                <tr>
-                                    <td class="vst-text input-label">
-                                        <?php print _('Template') . "<span class='optional'>" . strtoupper($_SESSION['DNS_SYSTEM']) . "</span>";?>
-                                    </td>
-                                </tr>
-                                <tr>
-                                    <td>
-                                        <select class="vst-list" name="v_template">
-                                            <?php
-                                                foreach ($templates as $key => $value) {
-                                                    echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
-                                                    $svalue = "'".$value."'";
-                                                    if ((!empty($v_template)) && ( $value == $v_template ) || ($svalue == $v_template)){
-                                                        echo ' selected' ;
-                                                    }
-                                                    echo ">".htmlentities($value)."</option>\n";
-                                                }
-                                            ?>
-                                        </select>
-                                    </td>
-                                </tr>
-                                <? } ?>
-                                <tr>
-                                    <td class="vst-text input-label step-top">
-                                        <a href="javascript:elementHideShow('advtable');" class="vst-advanced"><?php print _('Advanced options');?></a>
-                                    </td>
-                                </tr>
-                                <tr>
-                                    <td class="vst-text step-top">
-                                    <table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="advtable">
-                                            <tr>
-                                                <td class="vst-text input-label">
-                                                    <?php print _('Expiration Date');?> <span class="optional">(<?=_('YYYY-MM-DD');?>)</span>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td>
-                                                    <input type="text" size="20" class="vst-input" name="v_exp" value="<?=htmlentities(trim($v_exp, "'"))?>">
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td class="vst-text input-label">
-                                                    TTL
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td>
-                                                    <input type="text" size="20" class="vst-input" name="v_ttl" value="<?=htmlentities(trim($v_ttl, "'"))?>">
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td class="vst-text input-label">
-                                                    <?php print _('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"><?=_('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"><?=_('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">'._('delete').'</span>
-                                            </td>
-                                        </tr>';
+	<form id="vstobjects" name="v_add_dns" method="post">
+		<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+		<input type="hidden" name="ok" value="Add" />
 
-                                        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">'._('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">'._('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">'._('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">'._('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">'._('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 additional-control add"><?=_('Add one more Name Server')?></span>
-                                        </td>
-                                    </tr>
-                                        </table>
-                                    </td>
-                                </tr>
-                            </table>
-                            <table class="data-col2"></table>
-                        </td>
-                    </tr>
-                <? } ?>
-            </table>
-        </form>
-    </div>
+		<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" width="600px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Adding DNS Domain');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<?php if (($user == 'admin') && (($_GET['accept'] !== "true")))  {?>
+							<tr>
+								<td class="step-top">
+									<span class="alert alert-danger alert-with-icon">
+										<i class="fas fa-exclamation"></i>
+										<?=_('Avoid adding web domains on admin account');?>
+									</span>
+								</td>
+							</tr>
+						<?php } ?>
+						<?php if (($user == 'admin') && (empty($_GET['accept']))) {?>
+							<tr>
+								<td class="step-top">
+									<span><a href="/add/user/" class="vst-advanced admin-warning-button"><?=_('Add User');?></a></span>
+									<span><a href="/add/dns/?accept=true" class="vst-advanced button danger admin-warning-button"><?=_('Continue');?></a> </span>
+								</td>
+							</tr>
+						<?php } ?>
+						<?php if (($user == 'admin') && (($_GET['accept'] === "true")) || ($user !== "admin"))  {?>
+							<tr>
+								<td class="vst-text step-top">
+									<?=_('Domain');?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<input type="text" size="20" class="vst-input" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>">
+								</td>
+							</tr>
+							<tr>
+								<td class="vst-text input-label">
+									<?=_('IP address');?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<select class="vst-list" tabindex="-1" onchange="this.nextElementSibling.value=this.value">
+										<option value="">clear</option>
+										<?php
+											foreach ($v_ips as $ip => $value) {
+												$display_ip = empty($value['NAT']) ? $ip : "{$value['NAT']}";
+												echo "<option value='{$display_ip}'>" . htmlentities($display_ip) . "</option>\n";
+											}
+										?>
+									</select>
+									<input type="text" size="20" class="vst-input vst-list-editor" name="v_ip" value="<?=htmlentities(trim($v_ip, "'"))?>">
+								</td>
+							</tr>
+							<?php if (($_SESSION['userContext'] === 'admin') || ($_SESSION['userContext'] === 'user') && ($_SESSION['POLICY_USER_EDIT_DNS_TEMPLATES'] === 'yes')) { ?>
+								<tr>
+									<td class="vst-text input-label">
+										<?=_('Template') . "<span class='optional'>" . strtoupper($_SESSION['DNS_SYSTEM']) . "</span>";?>
+									</td>
+								</tr>
+								<tr>
+									<td>
+										<select class="vst-list" name="v_template">
+											<?php
+												foreach ($templates as $key => $value) {
+													echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
+													$svalue = "'".$value."'";
+													if ((!empty($v_template)) && ( $value == $v_template ) || ($svalue == $v_template)){
+														echo ' selected' ;
+													}
+													echo ">".htmlentities($value)."</option>\n";
+												}
+											?>
+										</select>
+									</td>
+								</tr>
+							<?php } ?>
+							<tr>
+								<td class="vst-text input-label step-top">
+									<a href="javascript:elementHideShow('advtable');" class="vst-advanced"><?=_('Advanced options');?></a>
+								</td>
+							</tr>
+							<tr>
+								<td class="vst-text step-top">
+									<table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="advtable">
+										<tr>
+											<td class="vst-text input-label">
+												<?=_('Expiration Date');?> <span class="optional">(<?=_('YYYY-MM-DD');?>)</span>
+											</td>
+										</tr>
+										<tr>
+											<td>
+												<input type="text" size="20" class="vst-input" name="v_exp" value="<?=htmlentities(trim($v_exp, "'"))?>">
+											</td>
+										</tr>
+										<tr>
+											<td class="vst-text input-label">
+												<?=_('TTL');?>
+											</td>
+										</tr>
+										<tr>
+											<td>
+												<input type="text" size="20" class="vst-input" name="v_ttl" value="<?=htmlentities(trim($v_ttl, "'"))?>">
+											</td>
+										</tr>
+										<tr>
+											<td class="vst-text input-label">
+												<?=_('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"><?=_('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"><?=_('delete');?></span>
+											</td>
+										</tr>
+										<?php
+											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">'._('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">'._('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">'._('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">'._('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">'._('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">'._('delete').'</span>
+													</td>
+												</tr>';
+											}
+										?>
+										<tr class="add-ns" <?php if ($v_ns8) echo 'style="display:none;"' ; ?> >
+											<td class="step-top-small">
+												<span class="add-ns-button additional-control add"><?=_('Add one more Name Server');?></span>
+											</td>
+										</tr>
+									</table>
+								</td>
+							</tr>
+						</table>
+						<table class="data-col2"></table>
+					</td>
+				</tr>
+			<?php } ?>
+		</table>
+	</form>
+</div>

+ 148 - 138
web/templates/pages/add_dns_rec.html

@@ -1,143 +1,153 @@
+<!-- Begin toolbar -->
 <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/dns/?domain=<?=htmlentities(trim($v_domain, "'"))?>&token=<?=$_SESSION['token']?>"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/dns/?domain=<?=htmlentities(trim($v_domain, "'"))?>&token=<?=$_SESSION['token']?>"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
+<div class="l-center animated fadeIn">
 
-        <form id="vstobjects" name="v_add_dns_rec" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="ok_rec" 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" width="600px">
-                            <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Adding DNS Record')?></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 _('Domain');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>" disabled >
-                                    <input type="hidden" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Record');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_rec" value="<?=htmlentities(trim($v_rec, "'"))?>">
-                                    <small class="hint"></small>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Type');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <select class="vst-list" name="v_type">
-                                        <option value="A" <?php if ($v_type == 'A') echo selected; ?>>A</option>
-                                        <option value="AAAA" <?php if ($v_type == 'AAAA') echo selected; ?>>AAAA</option>
-                                        <option value="CAA" <?php if ($v_type == 'CAA') echo selected; ?>>CAA</option>
-                                        <option value="CNAME" <?php if ($v_type == 'CNAME') echo selected; ?>>CNAME</option>
-                                        <option value="DNSKEY" <?php if ($v_type == 'DNSKEY') echo selected; ?>>DNSKEY</option>
-                                        <option value="IPSECKEY" <?php if ($v_type == 'IPSECKEY') echo selected; ?>>IPSECKEY</option>
-                                        <option value="KEY" <?php if ($v_type == 'KEY') echo selected; ?>>KEY</option>
-                                        <option value="MX" <?php if ($v_type == 'MX') echo selected; ?>>MX</option>
-                                        <option value="NS" <?php if ($v_type == 'NS') echo selected; ?>>NS</option>
-                                        <option value="PTR" <?php if ($v_type == 'PTR') echo selected; ?>>PTR</option>
-                                        <option value="SPF" <?php if ($v_type == 'SPF') echo selected; ?>>SPF</option>
-                                        <option value="SRV" <?php if ($v_type == 'SRV') echo selected; ?>>SRV</option>
-                                        <option value="TLSA" <?php if ($v_type == 'TLSA') echo selected; ?>>TLSA</option>
-                                        <option value="TXT" <?php if ($v_type == 'TXT') echo selected; ?>>TXT</option>
-                                    </select>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('IP or Value');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <select class="vst-list" tabindex="-1" onchange="this.nextElementSibling.value=this.value">
-                                        <option value="">clear</option>
-                                        <?php
-                                            foreach ($v_ips as $ip => $value) {
-                                                $display_ip = empty($value['NAT']) ? $ip : "{$value['NAT']}";
-                                                echo "<option value='{$display_ip}'>" . htmlentities($display_ip) . "</option>\n";
-                                            }
-                                        ?>
-                                    </select>
-                                    <input type="text" size="20" class="vst-input vst-list-editor" name="v_val" value="<?=htmlentities(trim($v_val, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Priority');?> <span class="optional">(<?php print _('optional');?>)</span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_priority" value="<?=htmlentities(trim($v_priority, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('TTL');?> <span class="optional">(<?php print _('optional');?>)</span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_ttl" value="<?=htmlentities(trim($v_ttl, "'"))?>">
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2">
-                        </table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-      </div>
+	<form id="vstobjects" name="v_add_dns_rec" method="post">
+		<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+		<input type="hidden" name="ok_rec" 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" width="600px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Adding DNS Record');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Domain');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>" disabled>
+								<input type="hidden" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Record');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_rec" value="<?=htmlentities(trim($v_rec, "'"))?>">
+								<small class="hint"></small>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Type');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" name="v_type">
+									<option value="A" <?php if ($v_type == 'A') echo selected; ?>>A</option>
+									<option value="AAAA" <?php if ($v_type == 'AAAA') echo selected; ?>>AAAA</option>
+									<option value="CAA" <?php if ($v_type == 'CAA') echo selected; ?>>CAA</option>
+									<option value="CNAME" <?php if ($v_type == 'CNAME') echo selected; ?>>CNAME</option>
+									<option value="DNSKEY" <?php if ($v_type == 'DNSKEY') echo selected; ?>>DNSKEY</option>
+									<option value="IPSECKEY" <?php if ($v_type == 'IPSECKEY') echo selected; ?>>IPSECKEY</option>
+									<option value="KEY" <?php if ($v_type == 'KEY') echo selected; ?>>KEY</option>
+									<option value="MX" <?php if ($v_type == 'MX') echo selected; ?>>MX</option>
+									<option value="NS" <?php if ($v_type == 'NS') echo selected; ?>>NS</option>
+									<option value="PTR" <?php if ($v_type == 'PTR') echo selected; ?>>PTR</option>
+									<option value="SPF" <?php if ($v_type == 'SPF') echo selected; ?>>SPF</option>
+									<option value="SRV" <?php if ($v_type == 'SRV') echo selected; ?>>SRV</option>
+									<option value="TLSA" <?php if ($v_type == 'TLSA') echo selected; ?>>TLSA</option>
+									<option value="TXT" <?php if ($v_type == 'TXT') echo selected; ?>>TXT</option>
+								</select>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('IP or Value');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" tabindex="-1" onchange="this.nextElementSibling.value=this.value">
+									<option value="">&nbsp;</option>
+									<?php
+										foreach ($v_ips as $ip => $value) {
+											$display_ip = empty($value['NAT']) ? $ip : "{$value['NAT']}";
+											echo "<option value='{$display_ip}'>" . htmlentities($display_ip) . "</option>\n";
+										}
+									?>
+								</select>
+								<input type="text" size="20" class="vst-input vst-list-editor" name="v_val" value="<?=htmlentities(trim($v_val, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Priority');?> <span class="optional">(<?=_('optional');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_priority" value="<?=htmlentities(trim($v_priority, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('TTL');?> <span class="optional">(<?=_('optional');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_ttl" value="<?=htmlentities(trim($v_ttl, "'"))?>">
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2">
+					</table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>
 
-    <script>
-        GLOBAL.DNS_REC_PREFIX = <?=json_encode($_GET['domain'])?>;
-    </script>
+<script>
+	GLOBAL.DNS_REC_PREFIX = <?php json_encode($_GET['domain']) ?>;
+</script>

+ 137 - 135
web/templates/pages/add_firewall.html

@@ -1,143 +1,145 @@
+<!-- Begin toolbar -->
 <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/firewall/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/firewall/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-          $back = $_SESSION['back'];
-          if (empty($back)) {
-            $back = "location.href='/list/firewall/'";
-          } else {
-            $back = "location.href='".$back."'";
-          }
-        ?>
-        <form id="vstobjects" name="v_add_ip" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="ok" value="Add" />
+<div class="l-center animated fadeIn">
 
-            <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" width="600px">
-                            <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Adding Firewall Rule')?></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 _('Action') ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <select class="vst-list" name="v_action">
-                                        <option value="DROP" <?php if ((!empty($v_action)) && ( $v_action == "'DROP'" )) echo 'selected'?>><?=_('DROP')?></option>
-                                        <option value="ACCEPT" <?php if ((!empty($v_action)) && ( $v_action == "'ACCEPT'" )) echo 'selected'?>><?=_('ACCEPT')?></option>
-                                    </select>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Protocol') ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <select class="vst-list" name="v_protocol">
-                                        <option value="TCP" <?php if ((!empty($v_protocol)) && ( $v_protocol == "'TCP'" )) echo 'selected'?>><?=_('TCP')?></option>
-                                        <option value="UDP" <?php if ((!empty($v_protocol)) && ( $v_protocol == "'UDP'" )) echo 'selected'?>><?=_('UDP')?></option>
-                                        <option value="ICMP" <?php if ((!empty($v_protocol)) && ( $v_protocol == "'ICMP'" )) echo 'selected'?>><?=_('ICMP')?></option>
-                                    </select>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Port');?> <span class="optional">(<?php print _('Ranges and Lists are acceptable');?>)</span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_port" value="<?=htmlentities(trim($v_port, "'"))?>" placeholder="<?php print _('All ports: 0, Range: 80-82, List: 80,443,8080,8443');?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('IP address / IPset');?> <span class="optional">(<?php print _('CIDR format is supported');?>)</span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <select class="vst-list" tabindex="-1" id="quickips_list" onchange="this.nextElementSibling.value=this.value">
-                                        <option value="">&nbsp;</option>
-                                    </select>
-                                    <input type="text" size="20" class="vst-input vst-list-editor" name="v_ip" value="<?=htmlentities(trim($v_ip, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Comment');?> <span class="optional">(<?php print _('optional');?>)</span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_comment" maxlength="255" value="<?=htmlentities(trim($v_comment, "'"))?>">
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+	<form id="vstobjects" name="v_add_ip" method="post">
+		<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+		<input type="hidden" name="ok" value="Add" />
 
-    <script>
-        var iplists = JSON.parse('<?=$ipset_lists_json?>');
-        iplists.sort(function (a, b) {
-            return a.name > b.name;
-        });
+		<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" width="600px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Adding Firewall Rule');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Action') ?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" name="v_action">
+									<option value="DROP" <?php if ((!empty($v_action)) && ( $v_action == "'DROP'" )) echo 'selected'?>><?=_('DROP');?></option>
+									<option value="ACCEPT" <?php if ((!empty($v_action)) && ( $v_action == "'ACCEPT'" )) echo 'selected'?>><?=_('ACCEPT');?></option>
+								</select>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Protocol') ?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" name="v_protocol">
+									<option value="TCP" <?php if ((!empty($v_protocol)) && ( $v_protocol == "'TCP'" )) echo 'selected'?>><?=_('TCP');?></option>
+									<option value="UDP" <?php if ((!empty($v_protocol)) && ( $v_protocol == "'UDP'" )) echo 'selected'?>><?=_('UDP');?></option>
+									<option value="ICMP" <?php if ((!empty($v_protocol)) && ( $v_protocol == "'ICMP'" )) echo 'selected'?>><?=_('ICMP');?></option>
+								</select>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Port');?> <span class="optional">(<?=_('Ranges and Lists are acceptable');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_port" value="<?=htmlentities(trim($v_port, "'"))?>" placeholder="<?=_('All ports: 0, Range: 80-82, List: 80,443,8080,8443');?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('IP address / IPset');?> <span class="optional">(<?=_('CIDR format is supported');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" tabindex="-1" id="quickips_list" onchange="this.nextElementSibling.value=this.value">
+									<option value="">&nbsp;</option>
+								</select>
+								<input type="text" size="20" class="vst-input vst-list-editor" name="v_ip" value="<?=htmlentities(trim($v_ip, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Comment');?> <span class="optional">(<?=_('optional');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_comment" maxlength="255" value="<?=htmlentities(trim($v_comment, "'"))?>">
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>
 
-        $(function() {
-            var targetelement = document.getElementById('quickips_list');
+<script>
+	var iplists = JSON.parse('<?=$ipset_lists_json?>');
+	iplists.sort(function (a, b) {
+		return a.name > b.name;
+	});
 
-            var newEl = document.createElement("option");
-            newEl.text = "IP address lists:";
-            newEl.disabled = true;
-            targetelement.appendChild(newEl);
+	$(function () {
+		var targetelement = document.getElementById('quickips_list');
 
-            iplists.forEach(iplist => {
-                var newEl = document.createElement("option");
-                newEl.text = iplist.name;
-                newEl.value = "ipset:" + iplist.name;
-                targetelement.appendChild(newEl);
-            });
-        });
-    </script>
+		var newEl = document.createElement("option");
+		newEl.text = "IP address lists:";
+		newEl.disabled = true;
+		targetelement.appendChild(newEl);
+
+		iplists.forEach(iplist => {
+			var newEl = document.createElement("option");
+			newEl.text = iplist.name;
+			newEl.value = "ipset:" + iplist.name;
+			targetelement.appendChild(newEl);
+		});
+	});
+</script>

+ 89 - 87
web/templates/pages/add_firewall_banlist.html

@@ -1,91 +1,93 @@
+<!-- Begin toolbar -->
 <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/firewall/banlist/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/firewall/banlist/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-          $back = $_SESSION['back'];
-          if (empty($back)) {
-            $back = "location.href='/list/firewall/banlist/'";
-          } else {
-            $back = "location.href='".$back."'";
-          }
-        ?>
-        <form id="vstobjects" name="v_add_ip" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="ok" value="Add" />
+<div class="l-center animated fadeIn">
 
-            <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" width="600px">
-                            <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Adding IP Address to Banlist')?></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 input-label">
-                                    <?=_('IP address')?> <span class="optional">(<?=_('CIDR format is supported')?>)</span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_ip" value="<?=htmlentities(trim($v_ip, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text step-top">
-                                    <?php print _('Banlist') ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <select class="vst-list" name="v_chain">
-                                        <option value="SSH" <?php if ((!empty($v_chain)) && ( $v_chain == "'SSH'" )) echo 'selected'?>><?=_('SSH')?></option>
-                                        <option value="WEB" <?php if ((!empty($v_chain)) && ( $v_chain == "'WEB'" )) echo 'selected'?>><?=_('WEB')?></option>
-                                        <option value="FTP" <?php if ((!empty($v_chain)) && ( $v_chain == "'FTP'" )) echo 'selected'?>><?=_('FTP')?></option>
-                                        <option value="DNS" <?php if ((!empty($v_chain)) && ( $v_chain == "'DNS'" )) echo 'selected'?>><?=_('DNS')?></option>
-                                        <option value="MAIL" <?php if ((!empty($v_chain)) && ( $v_chain == "'MAIL'" )) echo 'selected'?>><?=_('MAIL')?></option>
-                                        <option value="DB" <?php if ((!empty($v_chain)) && ( $v_chain == "'DB'" )) echo 'selected'?>><?=_('DB')?></option>
-                                        <option value="HESTIA" <?php if ((!empty($v_chain)) && ( $v_chain == "'HESTIA'" )) echo 'selected'?>><?=_('HESTIA')?></option>
-                                    </select>
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2">
-                            <tr>
-                            </tr>
-                        </table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-      </div>
+	<form id="vstobjects" name="v_add_ip" 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" width="600px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Adding IP Address to Banlist');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('IP address');?> <span class="optional">(<?=_('CIDR format is supported');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_ip" value="<?=htmlentities(trim($v_ip, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Banlist') ?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" name="v_chain">
+									<option value="SSH" <?php if ((!empty($v_chain)) && ( $v_chain == "'SSH'" )) echo 'selected'?>><?=_('SSH');?></option>
+									<option value="WEB" <?php if ((!empty($v_chain)) && ( $v_chain == "'WEB'" )) echo 'selected'?>><?=_('WEB');?></option>
+									<option value="FTP" <?php if ((!empty($v_chain)) && ( $v_chain == "'FTP'" )) echo 'selected'?>><?=_('FTP');?></option>
+									<option value="DNS" <?php if ((!empty($v_chain)) && ( $v_chain == "'DNS'" )) echo 'selected'?>><?=_('DNS');?></option>
+									<option value="MAIL" <?php if ((!empty($v_chain)) && ( $v_chain == "'MAIL'" )) echo 'selected'?>><?=_('MAIL');?></option>
+									<option value="DB" <?php if ((!empty($v_chain)) && ( $v_chain == "'DB'" )) echo 'selected'?>><?=_('DB');?></option>
+									<option value="HESTIA" <?php if ((!empty($v_chain)) && ( $v_chain == "'HESTIA'" )) echo 'selected'?>><?=_('HESTIA');?></option>
+								</select>
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2">
+						<tr>
+						</tr>
+					</table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 178 - 176
web/templates/pages/add_firewall_ipset.html

@@ -1,190 +1,192 @@
+<!-- Begin toolbar -->
 <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/firewall/ipset/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/firewall/ipset/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-          $back = $_SESSION['back'];
-          if (empty($back)) {
-            $back = "location.href='/list/firewall/ipset/'";
-          } else {
-            $back = "location.href='".$back."'";
-          }
-        ?>
-        <form id="vstobjects" name="v_add_ipset" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="ok" value="Add" />
+<div class="l-center animated fadeIn">
 
-            <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" width="600px">
-                            <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Adding Firewall Ipset List')?></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 _('Ip List Name') ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_ipname" maxlength="255" value="<?=htmlentities(trim($v_ipname, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text step-top">
-                                    <?php print _('Data Source') ?> <span class="optional">(<?php print _('url, script or file');?>)</span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <select class="vst-list" tabindex="-1" id="datasource_list" onchange="this.nextElementSibling.value=this.value">
-                                        <option value="">clear</option>
-                                    </select>
-                                    <input type="text" size="20" class="vst-input vst-list-editor" name="v_datasource" maxlength="255" value="<?=htmlentities(trim($v_datasource, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text step-top">
-                                    <?php print _('Ip Version') ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <select class="vst-list" name="v_ipver">
-                                        <option value="v4" <?php if ((!empty($v_ipver)) && ( $v_ipver == "'v4'" )) echo 'selected'?>><?=_('ip v4')?></option>
-                                        <option value="v6" <?php if ((!empty($v_ipver)) && ( $v_ipver == "'v6'" )) echo 'selected'?>><?=_('ip v6')?></option>
-                                    </select>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text step-top">
-                                    <?php print _('Autoupdate') ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <select class="vst-list" name="v_autoupdate">
-                                        <option value="yes" <?php if ((!empty($v_autoupdate)) && ( $v_autoupdate == "'yes'" )) echo 'selected'?>><?=_('yes')?></option>
-                                        <option value="no" <?php if ((!empty($v_autoupdate)) && ( $v_autoupdate == "'no'" )) echo 'selected'?>><?=_('no')?></option>
-                                    </select>
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+	<form id="vstobjects" name="v_add_ipset" method="post">
+		<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+		<input type="hidden" name="ok" value="Add" />
 
-    <script>
-        var country_iplists = [
-            // Define IPv4 country lists
-            {name: "[IPv4] Country - Canada",         source:"http://ipverse.net/ipblocks/data/countries/ca.zone"},
-            {name: "[IPv4] Country - China",          source:"http://ipverse.net/ipblocks/data/countries/cn.zone"},
-            {name: "[IPv4] Country - France",         source:"http://ipverse.net/ipblocks/data/countries/fr.zone"},
-            {name: "[IPv4] Country - Germany",        source:"http://ipverse.net/ipblocks/data/countries/de.zone"},
-            {name: "[IPv4] Country - India",          source:"http://ipverse.net/ipblocks/data/countries/in.zone"},
-            {name: "[IPv4] Country - Netherlands",    source:"http://ipverse.net/ipblocks/data/countries/nl.zone"},
-            {name: "[IPv4] Country - Romania",        source:"http://ipverse.net/ipblocks/data/countries/ro.zone"},
-            {name: "[IPv4] Country - Russia",         source:"http://ipverse.net/ipblocks/data/countries/ru.zone"},
-            {name: "[IPv4] Country - Spain",          source:"http://ipverse.net/ipblocks/data/countries/es.zone"},
-            {name: "[IPv4] Country - Switzerland",    source:"http://ipverse.net/ipblocks/data/countries/ch.zone"},
-            {name: "[IPv4] Country - Ukraine",        source:"http://ipverse.net/ipblocks/data/countries/ua.zone"},
-            {name: "[IPv4] Country - United Kingdom", source:"http://ipverse.net/ipblocks/data/countries/gb.zone"},
-            {name: "[IPv4] Country - United States",  source:"http://ipverse.net/ipblocks/data/countries/us.zone"},
+		<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" width="600px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Adding Firewall Ipset List');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Ip List Name') ?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_ipname" maxlength="255" value="<?=htmlentities(trim($v_ipname, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Data Source') ?> <span class="optional">(<?=_('url, script or file');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" tabindex="-1" id="datasource_list" onchange="this.nextElementSibling.value=this.value">
+									<option value="">clear</option>
+								</select>
+								<input type="text" size="20" class="vst-input vst-list-editor" name="v_datasource" maxlength="255" value="<?=htmlentities(trim($v_datasource, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Ip Version') ?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" name="v_ipver">
+									<option value="v4" <?php if ((!empty($v_ipver)) && ( $v_ipver == "'v4'" )) echo 'selected'?>><?=_('ip v4');?></option>
+									<option value="v6" <?php if ((!empty($v_ipver)) && ( $v_ipver == "'v6'" )) echo 'selected'?>><?=_('ip v6');?></option>
+								</select>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Autoupdate') ?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" name="v_autoupdate">
+									<option value="yes" <?php if ((!empty($v_autoupdate)) && ( $v_autoupdate == "'yes'" )) echo 'selected'?>><?=_('yes');?></option>
+									<option value="no" <?php if ((!empty($v_autoupdate)) && ( $v_autoupdate == "'no'" )) echo 'selected'?>><?=_('no');?></option>
+								</select>
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>
 
-            // Define IPv6 country lists
-            /*
-            {name: "[IPv6] Country - China",          source:"http://ipverse.net/ipblocks/data/countries/cn-ipv6.zone"},
-            {name: "[IPv6] Country - Canada",         source:"http://ipverse.net/ipblocks/data/countries/ca-ipv6.zone"},
-            {name: "[IPv6] Country - France",         source:"http://ipverse.net/ipblocks/data/countries/fr-ipv6.zone"},
-            {name: "[IPv6] Country - Germany",        source:"http://ipverse.net/ipblocks/data/countries/de-ipv6.zone"},
-            {name: "[IPv6] Country - India",          source:"http://ipverse.net/ipblocks/data/countries/in-ipv6.zone"},
-            {name: "[IPv6] Country - Netherlands",    source:"http://ipverse.net/ipblocks/data/countries/nl-ipv6.zone"},
-            {name: "[IPv6] Country - Romania",        source:"http://ipverse.net/ipblocks/data/countries/ro-ipv6.zone"},
-            {name: "[IPv6] Country - Russia",         source:"http://ipverse.net/ipblocks/data/countries/ru-ipv6.zone"},
-            {name: "[IPv6] Country - Spain",          source:"http://ipverse.net/ipblocks/data/countries/es-ipv6.zone"},
-            {name: "[IPv6] Country - Switzerland",    source:"http://ipverse.net/ipblocks/data/countries/ch-ipv6.zone"},
-            {name: "[IPv6] Country - Ukraine",        source:"http://ipverse.net/ipblocks/data/countries/ua-ipv6.zone"},
-            {name: "[IPv6] Country - United Kingdom", source:"http://ipverse.net/ipblocks/data/countries/gb-ipv6.zone"},
-            {name: "[IPv6] Country - United States",  source:"http://ipverse.net/ipblocks/data/countries/us-ipv6.zone"},
-            */
-        ];
+<script>
+	var country_iplists = [
+		// Define IPv4 country lists
+		{ name: "[IPv4] Country - Canada", source: "http://ipverse.net/ipblocks/data/countries/ca.zone" },
+		{ name: "[IPv4] Country - China", source: "http://ipverse.net/ipblocks/data/countries/cn.zone" },
+		{ name: "[IPv4] Country - France", source: "http://ipverse.net/ipblocks/data/countries/fr.zone" },
+		{ name: "[IPv4] Country - Germany", source: "http://ipverse.net/ipblocks/data/countries/de.zone" },
+		{ name: "[IPv4] Country - India", source: "http://ipverse.net/ipblocks/data/countries/in.zone" },
+		{ name: "[IPv4] Country - Netherlands", source: "http://ipverse.net/ipblocks/data/countries/nl.zone" },
+		{ name: "[IPv4] Country - Romania", source: "http://ipverse.net/ipblocks/data/countries/ro.zone" },
+		{ name: "[IPv4] Country - Russia", source: "http://ipverse.net/ipblocks/data/countries/ru.zone" },
+		{ name: "[IPv4] Country - Spain", source: "http://ipverse.net/ipblocks/data/countries/es.zone" },
+		{ name: "[IPv4] Country - Switzerland", source: "http://ipverse.net/ipblocks/data/countries/ch.zone" },
+		{ name: "[IPv4] Country - Ukraine", source: "http://ipverse.net/ipblocks/data/countries/ua.zone" },
+		{ name: "[IPv4] Country - United Kingdom", source: "http://ipverse.net/ipblocks/data/countries/gb.zone" },
+		{ name: "[IPv4] Country - United States", source: "http://ipverse.net/ipblocks/data/countries/us.zone" },
 
-        var blacklist_iplists = [
-            {name: "[IPv4] Block Malicious IPs",       source:"script:/usr/local/hestia/install/deb/firewall/ipset/blacklist.sh"},
-            /*
-            {name: "[IPv6] Block Malicious IPs",       source:"script:/usr/local/hestia/install/deb/firewall/ipset/blacklist.ipv6.sh"},
-            */
-        ];
+		// Define IPv6 country lists
+		/*
+		{name: "[IPv6] Country - China",          source:"http://ipverse.net/ipblocks/data/countries/cn-ipv6.zone"},
+		{name: "[IPv6] Country - Canada",         source:"http://ipverse.net/ipblocks/data/countries/ca-ipv6.zone"},
+		{name: "[IPv6] Country - France",         source:"http://ipverse.net/ipblocks/data/countries/fr-ipv6.zone"},
+		{name: "[IPv6] Country - Germany",        source:"http://ipverse.net/ipblocks/data/countries/de-ipv6.zone"},
+		{name: "[IPv6] Country - India",          source:"http://ipverse.net/ipblocks/data/countries/in-ipv6.zone"},
+		{name: "[IPv6] Country - Netherlands",    source:"http://ipverse.net/ipblocks/data/countries/nl-ipv6.zone"},
+		{name: "[IPv6] Country - Romania",        source:"http://ipverse.net/ipblocks/data/countries/ro-ipv6.zone"},
+		{name: "[IPv6] Country - Russia",         source:"http://ipverse.net/ipblocks/data/countries/ru-ipv6.zone"},
+		{name: "[IPv6] Country - Spain",          source:"http://ipverse.net/ipblocks/data/countries/es-ipv6.zone"},
+		{name: "[IPv6] Country - Switzerland",    source:"http://ipverse.net/ipblocks/data/countries/ch-ipv6.zone"},
+		{name: "[IPv6] Country - Ukraine",        source:"http://ipverse.net/ipblocks/data/countries/ua-ipv6.zone"},
+		{name: "[IPv6] Country - United Kingdom", source:"http://ipverse.net/ipblocks/data/countries/gb-ipv6.zone"},
+		{name: "[IPv6] Country - United States",  source:"http://ipverse.net/ipblocks/data/countries/us-ipv6.zone"},
+		*/
+	];
 
-        country_iplists.sort(function (a, b) {
-            return a.name > b.name;
-        });
+	var blacklist_iplists = [
+		{ name: "[IPv4] Block Malicious IPs", source: "script:/usr/local/hestia/install/deb/firewall/ipset/blacklist.sh" },
+		/*
+		{name: "[IPv6] Block Malicious IPs",       source:"script:/usr/local/hestia/install/deb/firewall/ipset/blacklist.ipv6.sh"},
+		*/
+	];
 
-        blacklist_iplists.sort(function (a, b) {
-            return a.name > b.name;
-        });
+	country_iplists.sort(function (a, b) {
+		return a.name > b.name;
+	});
 
-        $(function() {
-            var targetelement = document.getElementById('datasource_list');
+	blacklist_iplists.sort(function (a, b) {
+		return a.name > b.name;
+	});
 
-            // Blacklist
-            var newEl = document.createElement("option");
-            newEl.text="<?php print _('BLACKLIST') ?>";
-            newEl.disabled=true;
-            targetelement.appendChild(newEl);
+	$(function () {
+		var targetelement = document.getElementById('datasource_list');
 
-            blacklist_iplists.forEach(iplist => {
-                var newEl = document.createElement("option");
-                newEl.text=iplist.name;
-                newEl.value=iplist.source;
-                targetelement.appendChild(newEl);
-            });
+		// Blacklist
+		var newEl = document.createElement("option");
+		newEl.text = "<?=_('BLACKLIST') ?>";
+		newEl.disabled = true;
+		targetelement.appendChild(newEl);
 
-            // IPVERSE
-            var newEl = document.createElement("option");
-            newEl.text="<?php print _('IPVERSE') ?>";
-            newEl.disabled=true;
-            targetelement.appendChild(newEl);
+		blacklist_iplists.forEach(iplist => {
+			var newEl = document.createElement("option");
+			newEl.text = iplist.name;
+			newEl.value = iplist.source;
+			targetelement.appendChild(newEl);
+		});
 
-            country_iplists.forEach(iplist => {
-                var newEl = document.createElement("option");
-                newEl.text=iplist.name;
-                newEl.value=iplist.source;
-                targetelement.appendChild(newEl);
-            });
-        });
-    </script>
+		// IPVERSE
+		var newEl = document.createElement("option");
+		newEl.text = "<?=_('IPVERSE') ?>";
+		newEl.disabled = true;
+		targetelement.appendChild(newEl);
+
+		country_iplists.forEach(iplist => {
+			var newEl = document.createElement("option");
+			newEl.text = iplist.name;
+			newEl.value = iplist.source;
+			targetelement.appendChild(newEl);
+		});
+	});
+</script>

+ 155 - 153
web/templates/pages/add_ip.html

@@ -1,157 +1,159 @@
+<!-- Begin toolbar -->
 <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/ip/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/ip/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-          $back = $_SESSION['back'];
-          if (empty($back)) {
-            $back = "location.href='/list/ip/'";
-          } else {
-            $back = "location.href='".$back."'";
-          }
-        ?>
-        <form id="vstobjects" name="v_add_ip" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="ok" value="Add" />
+<div class="l-center animated fadeIn">
 
-            <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" width="600px">
-                            <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Adding IP address')?></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 _('IP address') ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_ip" value="<?=htmlentities(trim($v_ip, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Netmask');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_netmask" value="<?=htmlentities(trim($v_netmask, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Interface');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <select class="vst-list" name="v_interface">
-                                        <?php
-                                            foreach ($interfaces as $key => $value) {
-                                                echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
-                                                if ((!empty($v_interface)) && ( $value == $v_interface )) echo ' selected';
-                                                echo ">".htmlentities($value)."</option>\n";
-                                            }
-                                        ?>
-                                    </select>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <label><input type="checkbox" size="20" class="vst-checkbox" name="v_shared" <?php if (empty($v_dedicated)) echo "checked=yes" ?> onclick="javascript:elementHideShow('usrtable');"><?php print _('Shared');?></label>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <table style="display:<?php if (empty($v_dedicated)) { echo 'none';} else {echo 'block';}?> ;" id="usrtable">
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Assigned user');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="step-bottom">
-                                                <select class="vst-list" name="v_owner">
-                                                    <?php
-                                                        foreach ($users as $key => $value) {
-                                                            echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
-                                                            if ((!empty($v_owner)) && ( $value == $v_owner )) echo ' selected';
-                                                            echo ">".htmlentities($value)."</option>\n";
-                                                        }
-                                                    ?>
-                                                </select>
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Assigned domain');?> <span class="optional">(<?php print _('optional');?>)</span>
-                                </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 _('NAT IP association');?> <span class="optional">(<?php print _('optional');?>)</span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_nat" value="<?=htmlentities(trim($v_nat, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr style="<?php if ($_SESSION['MAIL_SYSTEM'] != 'exim4') { echo 'display: none;';}?>">
-                                <td class="vst-text input-label">
-                                    <?php print _('HELO/SMTP Banner');?> <span class="optional">(<?php print _('optional');?>)</span>
-                                </td>
-                            </tr>
-                            <tr style="<?php if ($_SESSION['MAIL_SYSTEM'] != 'exim4') { echo 'display: none;';}?>">
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_helo" value="<?=htmlentities(trim($v_helo, "'"))?>">
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-      </div>
+	<form id="vstobjects" name="v_add_ip" 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" width="600px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Adding IP address');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('IP address') ?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_ip" value="<?=htmlentities(trim($v_ip, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Netmask');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_netmask" value="<?=htmlentities(trim($v_netmask, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Interface');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" name="v_interface">
+									<?php
+										foreach ($interfaces as $key => $value) {
+											echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
+											if ((!empty($v_interface)) && ( $value == $v_interface )) echo ' selected';
+											echo ">".htmlentities($value)."</option>\n";
+										}
+									?>
+								</select>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<label><input type="checkbox" size="20" class="vst-checkbox" name="v_shared" <?php if (empty($v_dedicated)) echo "checked=yes" ?> onclick="javascript:elementHideShow('usrtable');"><?=_('Shared');?></label>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<table style="display:<?php if (empty($v_dedicated)) { echo 'none';} else {echo 'block';}?> ;" id="usrtable">
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('Assigned user');?>
+										</td>
+									</tr>
+									<tr>
+										<td class="step-bottom">
+											<select class="vst-list" name="v_owner">
+												<?php
+													foreach ($users as $key => $value) {
+														echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
+														if ((!empty($v_owner)) && ( $value == $v_owner )) echo ' selected';
+														echo ">".htmlentities($value)."</option>\n";
+													}
+												?>
+											</select>
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Assigned domain');?> <span class="optional">(<?=_('optional');?>)</span>
+							</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">
+								<?=_('NAT IP association');?> <span class="optional">(<?=_('optional');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_nat" value="<?=htmlentities(trim($v_nat, "'"))?>">
+							</td>
+						</tr>
+						<tr style="<?php if ($_SESSION['MAIL_SYSTEM'] != 'exim4') { echo 'display: none;';}?>">
+							<td class="vst-text input-label">
+								<?=_('HELO/SMTP Banner');?> <span class="optional">(<?=_('optional');?>)</span>
+							</td>
+						</tr>
+						<tr style="<?php if ($_SESSION['MAIL_SYSTEM'] != 'exim4') { echo 'display: none;';}?>">
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_helo" value="<?=htmlentities(trim($v_helo, "'"))?>">
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 70 - 69
web/templates/pages/add_key.html

@@ -1,71 +1,72 @@
-	<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/key/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+<!-- Begin toolbar -->
+<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/key/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
-    <!-- /.l-separator -->
-	
-    <div class="l-center animated fadeIn">
-        <?php
-          $back = $_SESSION['back'];
-          if (empty($back)) {
-            $back = "location.href='/list/key/'";
-          } else {
-            $back = "location.href='".$back."'";
-          }
-        ?>
-        <form id="vstobjects" name="v_add_key" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="ok" value="Add" />
+<div class="l-separator"></div>
 
-            <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" width="600px">
-                            <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Add SSH Key')?></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 _('SSH KEY') ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput" name="v_key"><?=htmlentities(trim($v_key, "'"))?></textarea>
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-      </div>
+<div class="l-center animated fadeIn">
+
+	<form id="vstobjects" name="v_add_key" 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" width="600px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Add SSH Key');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('SSH KEY') ?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea class="vst-textinput" name="v_key"><?=htmlentities(trim($v_key, "'"))?></textarea>
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 186 - 184
web/templates/pages/add_mail.html

@@ -1,187 +1,189 @@
+<!-- Begin toolbar -->
 <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/mail/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/mail/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
-    <!-- /.l-separator -->
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-          $back = $_SESSION['back'];
-          if (empty($back)) {
-            $back = "location.href='/list/mail/'";
-          } else {
-            $back = "location.href='".$back."'";
-          }
-        ?>
-        <form id="vstobjects" name="v_add_mail" 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" width="600px">
-                            <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Adding Mail Domain')?></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>
-                            <? if (($user == 'admin') && (($_GET['accept'] !== "true")))  {?>
-                                <tr>
-                                    <td class="step-top">
-                                        <span class="alert alert-danger alert-with-icon">
-                                            <i class="fas fa-exclamation"></i>
-                                            <?=_('Avoid adding web domains on admin account')?>
-                                        </span>
-                                    </td>
-                                </tr>
-                                <?php } ?>
-                                <? if (($user == 'admin') && (empty($_GET['accept']))) {?>
-                                    <tr>
-                                        <td class="step-top">
-                                            <span><a href="/add/user/" class="vst-advanced admin-warning-button"><?=_('Add User')?></a></span>
-                                            <span><a href="/add/mail/?accept=true" class="vst-advanced button danger admin-warning-button"><?=_('Continue')?></a> </span>
-                                        </td>
-                                    </tr>
-                                <? } ?>
-                                <? if (($user == 'admin') && (($_GET['accept'] === "true")) || ($user !== "admin"))  {?>
-                                        <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" value="<?=htmlentities(trim($v_domain, "'"))?>">
-                                            </td>
-                                        </tr>
-                                        <?php if($_SESSION['WEBMAIL_SYSTEM']){?>                            
-                                            <tr>
-                                                <td class="vst-text step-top">
-                                                    <?php print _('Webmail Client');?>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td>
-                                                    <select class="vst-list" name="v_webmail" tabindex="6" >
-                                                        <?php foreach ($webmail_clients as $client){
-                                                        echo "\t\t\t\t<option value=\"".htmlentities($client)."\"";
-                                                        if ((!empty($v_webmail)) && ( $v_webmail == $client )) {
-                                                            echo ' selected' ;
-                                                        }
-                                                        echo ">".htmlentities(ucfirst($client))."</option>\n";
-                                                        }
-                                                        ?>
-                                                        <option value="" <?php if(empty($v_webmail)){ echo "selected";}?>><?php print _('Disabled');?></option>
-                                                    </select>
-                                                </td>
-                                            </tr>
-                                        <?php } ?>
-                                        <? if (!empty($_SESSION['ANTISPAM_SYSTEM'])) {?>
-                                        <tr>
-                                            <td class="vst-text input-label step-top">
-                                                <label><input type="checkbox" size="20" class="vst-checkbox" name="v_antispam" <?php if ((empty($v_antispam)) || ($v_antispam == 'yes')) echo "checked=yes"; ?>><?php print _('AntiSpam Support');?></label>
-                                            </td>
-                                        </tr>
-                                        <? } ?>
-                                        <? if (!empty($_SESSION['ANTIVIRUS_SYSTEM'])) {?>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <label><input type="checkbox" size="20" class="vst-checkbox" name="v_antivirus" <?php if ((empty($v_antivirus)) || ($v_antivirus == 'yes')) echo "checked=yes"; ?>><?php print _('AntiVirus Support');?></label>
-                                            </td>
-                                        </tr>
-                                        <? } ?>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <label><input type="checkbox" size="20" class="vst-checkbox" name="v_dkim" <?php if (isset($v_dkim)&&$v_dkim == 'yes') echo "checked=yes"; ?>><?php print _('DKIM Support');?></label>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <label><input type="checkbox" size="20" class="vst-checkbox" name="v_smtp_relay" <?php if ($v_smtp_relay == 'true') echo "checked=yes"; ?> onclick="javascript:elementHideShow('smtp_relay_table');"><?php print _('SMTP Relay');?></label>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="step-left">
-                                                <table style="display:<?php if ($v_smtp_relay == 'true'){echo 'block';} else {echo 'none';} ?>;" id="smtp_relay_table">
-                                                    <tr>
-                                                        <td class="input-label vst-text">
-                                                            <?php print _('Host');?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <input type="text" size="20" class="vst-input" name="v_smtp_relay_host" value="<?=htmlentities(trim($v_smtp_relay_host, "'"))?>">
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="input-label vst-text">
-                                                            <?php print _('Port');?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <input type="text" size="20" class="vst-input" name="v_smtp_relay_port" value="<?=htmlentities(trim($v_smtp_relay_port, "'"))?>">
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="input-label vst-text">
-                                                            <?php print _('Username');?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <input type="text" size="20" class="vst-input" name="v_smtp_relay_user" value="<?=htmlentities(trim($v_smtp_relay_user, "'"))?>">
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="input-label vst-text">
-                                                            <?php print _('Password');?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <input type="text" size="20" class="vst-input" name="v_smtp_relay_pass">
-                                                        </td>
-                                                    </tr>
-                                                </table>
-                                            </td>
-                                        </tr>
-                                <? } ?>
-                            <tr>
-                                <td>
-                                    <br>
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+<div class="l-center animated fadeIn">
+
+	<form id="vstobjects" name="v_add_mail" 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" width="600px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Adding Mail Domain');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<?php if (($user == 'admin') && (($_GET['accept'] !== "true")))  {?>
+							<tr>
+								<td class="step-top">
+									<span class="alert alert-danger alert-with-icon">
+										<i class="fas fa-exclamation"></i>
+										<?=_('Avoid adding web domains on admin account');?>
+									</span>
+								</td>
+							</tr>
+						<?php } ?>
+						<?php if (($user == 'admin') && (empty($_GET['accept']))) {?>
+							<tr>
+								<td class="step-top">
+									<span><a href="/add/user/" class="vst-advanced admin-warning-button"><?=_('Add User');?></a></span>
+									<span><a href="/add/mail/?accept=true" class="vst-advanced button danger admin-warning-button"><?=_('Continue');?></a> </span>
+								</td>
+							</tr>
+						<?php } ?>
+						<?php if (($user == 'admin') && (($_GET['accept'] === "true")) || ($user !== "admin"))  {?>
+							<tr>
+								<td class="vst-text step-top">
+									<?=_('Domain');?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<input type="text" size="20" class="vst-input" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>">
+								</td>
+							</tr>
+							<?php if($_SESSION['WEBMAIL_SYSTEM']){?>
+								<tr>
+									<td class="vst-text step-top">
+										<?=_('Webmail Client');?>
+									</td>
+								</tr>
+								<tr>
+									<td>
+										<select class="vst-list" name="v_webmail" tabindex="6">
+											<?php foreach ($webmail_clients as $client){
+												echo "\t\t\t\t<option value=\"".htmlentities($client)."\"";
+												if ((!empty($v_webmail)) && ( $v_webmail == $client )) {
+													echo ' selected' ;
+												}
+												echo ">".htmlentities(ucfirst($client))."</option>\n";
+												}
+											?>
+											<option value="" <?php if(empty($v_webmail)){ echo "selected";}?>><?=_('Disabled');?></option>
+										</select>
+									</td>
+								</tr>
+							<?php } ?>
+							<?php if (!empty($_SESSION['ANTISPAM_SYSTEM'])) {?>
+								<tr>
+									<td class="vst-text input-label step-top">
+										<label><input type="checkbox" size="20" class="vst-checkbox" name="v_antispam" <?php if ((empty($v_antispam)) || ($v_antispam == 'yes')) echo "checked=yes"; ?>><?=_('AntiSpam Support');?></label>
+									</td>
+								</tr>
+							<?php } ?>
+							<?php if (!empty($_SESSION['ANTIVIRUS_SYSTEM'])) {?>
+								<tr>
+									<td class="vst-text input-label">
+										<label><input type="checkbox" size="20" class="vst-checkbox" name="v_antivirus" <?php if ((empty($v_antivirus)) || ($v_antivirus == 'yes')) echo "checked=yes"; ?>><?=_('AntiVirus Support');?></label>
+									</td>
+								</tr>
+							<?php } ?>
+							<tr>
+								<td class="vst-text input-label">
+									<label><input type="checkbox" size="20" class="vst-checkbox" name="v_dkim" <?php if (isset($v_dkim)&&$v_dkim == 'yes') echo "checked=yes"; ?>><?=_('DKIM Support');?></label>
+								</td>
+							</tr>
+							<tr>
+								<td class="vst-text input-label">
+									<label><input type="checkbox" size="20" class="vst-checkbox" name="v_smtp_relay" <?php if ($v_smtp_relay == 'true') echo "checked=yes"; ?> onclick="javascript:elementHideShow('smtp_relay_table');"><?=_('SMTP Relay');?></label>
+								</td>
+							</tr>
+							<tr>
+								<td class="step-left">
+									<table style="display:<?php if ($v_smtp_relay == 'true'){echo 'block';} else {echo 'none';} ?>;" id="smtp_relay_table">
+										<tr>
+											<td class="input-label vst-text">
+												<?=_('Host');?>
+											</td>
+										</tr>
+										<tr>
+											<td>
+												<input type="text" size="20" class="vst-input" name="v_smtp_relay_host" value="<?=htmlentities(trim($v_smtp_relay_host, "'"))?>">
+											</td>
+										</tr>
+										<tr>
+											<td class="input-label vst-text">
+												<?=_('Port');?>
+											</td>
+										</tr>
+										<tr>
+											<td>
+												<input type="text" size="20" class="vst-input" name="v_smtp_relay_port" value="<?=htmlentities(trim($v_smtp_relay_port, "'"))?>">
+											</td>
+										</tr>
+										<tr>
+											<td class="input-label vst-text">
+												<?=_('Username');?>
+											</td>
+										</tr>
+										<tr>
+											<td>
+												<input type="text" size="20" class="vst-input" name="v_smtp_relay_user" value="<?=htmlentities(trim($v_smtp_relay_user, "'"))?>">
+											</td>
+										</tr>
+										<tr>
+											<td class="input-label vst-text">
+												<?=_('Password');?>
+											</td>
+										</tr>
+										<tr>
+											<td>
+												<input type="text" size="20" class="vst-input" name="v_smtp_relay_pass">
+											</td>
+										</tr>
+									</table>
+								</td>
+							</tr>
+						<?php } ?>
+						<tr>
+							<td>
+								<br>
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 248 - 217
web/templates/pages/add_mail_acc.html

@@ -1,222 +1,253 @@
+<!-- Begin toolbar -->
 <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/mail/?domain=<?=htmlentities(trim($v_domain, "'"))?>&token=<?=$_SESSION['token']?>"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/mail/?domain=<?=htmlentities(trim($v_domain, "'"))?>&token=<?=$_SESSION['token']?>"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
+<div class="l-center animated fadeIn">
 
-        <form id="vstobjects" name="v_add_mail_acc" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="ok_acc" value="add" />
+	<form id="vstobjects" name="v_add_mail_acc" method="post">
+		<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+		<input type="hidden" name="ok_acc" 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" width="440px">
-                        <tr>
-                            <td class="step-top">
-                                <span class="page-title"><?=_('Adding Mail Account')?></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 _('Domain');?>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td>
-                                <input type="text" size="20" class="vst-input" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>" disabled >
-                                <input type="hidden" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>">
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="vst-text input-label">
-                                <?php print _('Account');?>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td>
-                                <input type="text" size="20" class="vst-input" name="v_account" value="<?=htmlentities(trim($v_account, "'"))?>">
-                            </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"><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 class="vst-text">
-                                <a href="javascript:elementHideShow('advtable');" class="vst-advanced"> <?php print _('Advanced options');?></a>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="vst-text input-label">
-                                <table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="advtable">
-                                    <tr>
-                                        <td class="vst-text input-label">
-                                            <?php print _('Quota');?> <span class="optional">(<?=_('in megabytes')?>)</span>
-                                        </td>
-                                    </tr>
-                                    <tr>
-                                        <td>
-                                            <input type="text" size="20" class="vst-input" name="v_quota" value="<?=htmlentities(trim($v_quota, "'"))?>">
-                                            <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-quota" /</i>
-                                        </td>
-                                    </tr>
-                                <tr>
-                                    <td class="vst-text input-label">
-                                        <?php print _('Aliases');?> <span class="optional">(<?=_('use local-part')?>)</span>
-                                    </td>
-                                </tr>
-                                <tr>
-                                    <td>
-                                        <textarea size="20" class="vst-textinput short" name="v_aliases"><?=htmlentities(trim($v_aliases, "'"))?></textarea>
-                                    </td>
-                                </tr>
-                                <tr>
-                                    <td class="vst-text input-label">
-                                        <?php print _('Forward to');?> <span class="optional">(<?=_('one or more email addresses')?>)</span>
-                                    </td>
-                                </tr>
-                                <tr>
-                                    <td>
-                                        <textarea size="20" class="vst-textinput short" name="v_fwd" id="v_fwd" <?php if($v_blackhole == 'yes') echo "disabled";?>><?=htmlentities(trim($v_fwd, "'"))?></textarea>
-                                    </td>
-                                </tr>
-                                <tr>
-                                    <td class="vst-text input-label">
-                                        <label><input type="checkbox" size="20" class="vst-checkbox" id="v_blackhole" name="v_blackhole" <?php if ($v_blackhole == 'yes') echo "checked=yes" ?>><?php print _('Discard all mail');?></label>
-                                    </td>
-                                </tr>
-                                <tr <?php if ($v_blackhole == 'yes') echo 'style="display:none"'; ?> id="id_fwd_for">
-                                    <td class="vst-text input-label">
-                                        <label><input type="checkbox" size="20" class="vst-checkbox" id="v_fwd_for" name="v_fwd_only" <?php if ($v_fwd_only == 'yes') echo "checked=yes" ?>><?php print _('Do not store forwarded mail');?></label>
-                                    </td>
-                                </tr>
-                            </table>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td class="vst-text input-label">
-                            <?php print _('Send login credentials to email address') ?>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td>
-                            <input type="text"  class="vst-input" name="v_send_email" value="<?=htmlentities(trim($v_send_email, "'"))?>">
-                            <input type="hidden" name="v_credentials" id="v_credentials">
-                        </td>
-                    </tr>
-                </table>
-                <table class="data-col2">
-                </table>
-            </td>
-            <td class="mail-infoblock-td">
-                <div class="mail-infoblock">
-                    <table>
-                    <?php $uname_arr=posix_uname(); $hostname=$uname_arr['nodename']; ?>
-                        <tr>
-                            <td colspan="2">
-                                <select id="mail_configuration" class="vst-list flat">
-                                    <option v_type="hostname" domain="<?=$v_domain?>"><?=_('Use domain hostname')?></option>
-                                    <option v_type="starttls"><?=_('Use STARTTLS')?></option>
-                                    <option v_type="ssl"><?=_('Use SSL / TLS')?></option>
-                                    <option v_type="no_encryption" domain="<?=htmlentities(trim($v_domain, "'"))?>" no_encryption="<?=_('No encryption')?>"><?=_('No encryption')?></option>
-                                </select>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td><?=_('Username')?>:</td>
-                            <td><div><span id="v_account">example</span>@<?=htmlentities(trim($v_domain, "'"))?></div></td>
-                        </tr>
-                        <tr>
-                            <td><?=_('Password')?>:</td>
-                            <td><div id="v_password">******</div></td>
-                        </tr>
-                        <tr>
-                            <td><?=_('IMAP hostname')?>:</td>
-                            <td><div id="td_imap_hostname">mail.<?=$v_domain?></div></td>
-                        </tr>
-                        <tr>
-                            <td><?=_('IMAP port')?>:</td>
-                            <td><div id="td_imap_port">143</div></td>
-                        </tr>
-                        <tr>
-                            <td><?=_('IMAP security')?>:</td>
-                            <td><div id="td_imap_encryption"><?=_('STARTTLS')?></div></td>
-                        </tr>
-                        <tr>
-                            <td><?=_('IMAP auth method')?>:</td>
-                            <td><div><?=_('Normal password')?></div></td>
-                        </tr>
-                        <tr>
-                            <td><?=_('SMTP hostname')?>:</td>
-                            <td><div id="td_smtp_hostname">mail.<?=$v_domain?></div></td>
-                        </tr>
-                        <tr>
-                            <td><?=_('SMTP port')?>:</td>
-                            <td><div id="td_smtp_port">587</div></td>
-                        </tr>
-                        <tr>
-                            <td><?=_('SMTP security')?>:</td>
-                            <td><div id="td_smtp_encryption"><?=_('STARTTLS')?></div></td>
-                        </tr>
-                        <tr>
-                            <td><?=_('SMTP auth method')?>:</td>
-                            <td><div><?=_('Normal password')?></div></td>
-                        </tr>
-                        <?php if($_SESSION['WEBMAIL_SYSTEM']){?>
-                        <tr>
-                            <td><?=_('Webmail URL')?>:</td>
-                            <td><div><a class="vst" href="http://<?=$v_webmail_alias?>" target="_blank">http://<?=$v_webmail_alias?> <i></i></a></div></td>
-                        </tr>
-                        <?php } ?>
-                    </table>
-                </div>
-            </td>
-        </tr>
-    </table>
-    </form>
-  </div>
+		<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" width="440px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Adding Mail Account');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Domain');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>" disabled>
+								<input type="hidden" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Account');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_account" value="<?=htmlentities(trim($v_account, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Password');?> <a href="javascript:randomString();" title="<?=_('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"><br />
+								<meter max="4" id="meter"></meter>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text">
+								<?=_('Your password must have at least');?>:
+								<ul>
+									<li><?=_('8 characters long');?></li>
+									<li><?=_('1 uppercase & 1 lowercase character');?></li>
+									<li><?=_('1 number');?></li>
+								</ul>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text">
+								<a href="javascript:elementHideShow('advtable');" class="vst-advanced"> <?=_('Advanced options');?></a>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="advtable">
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('Quota');?> <span class="optional">(<?=_('in megabytes');?>)</span>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_quota" value="<?=htmlentities(trim($v_quota, "'"))?>">
+											<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-quota" /</i>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('Aliases');?> <span class="optional">(<?=_('use local-part');?>)</span>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<textarea size="20" class="vst-textinput short" name="v_aliases"><?=htmlentities(trim($v_aliases, "'"))?></textarea>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('Forward to');?> <span class="optional">(<?=_('one or more email addresses');?>)</span>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<textarea size="20" class="vst-textinput short" name="v_fwd" id="v_fwd" <?php if($v_blackhole == 'yes') echo "disabled";?>><?=htmlentities(trim($v_fwd, "'"))?></textarea>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<label><input type="checkbox" size="20" class="vst-checkbox" id="v_blackhole" name="v_blackhole" <?php if ($v_blackhole == 'yes') echo "checked=yes" ?>><?=_('Discard all mail');?></label>
+										</td>
+									</tr>
+									<tr <?php if ($v_blackhole == 'yes') echo 'style="display:none"'; ?> id="id_fwd_for">
+										<td class="vst-text input-label">
+											<label><input type="checkbox" size="20" class="vst-checkbox" id="v_fwd_for" name="v_fwd_only" <?php if ($v_fwd_only == 'yes') echo "checked=yes" ?>><?=_('Do not store forwarded mail');?></label>
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Send login credentials to email address') ?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" class="vst-input" name="v_send_email" value="<?=htmlentities(trim($v_send_email, "'"))?>">
+								<input type="hidden" name="v_credentials" id="v_credentials">
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2">
+					</table>
+				</td>
+				<td class="mail-infoblock-td">
+					<div class="mail-infoblock">
+						<table>
+							<?php $uname_arr=posix_uname(); $hostname=$uname_arr['nodename']; ?>
+							<tr>
+								<td colspan="2">
+									<select id="mail_configuration" class="vst-list flat">
+										<option v_type="hostname" domain="<?=$v_domain?>"><?=_('Use domain hostname');?></option>
+										<option v_type="starttls"><?=_('Use STARTTLS');?></option>
+										<option v_type="ssl"><?=_('Use SSL / TLS');?></option>
+										<option v_type="no_encryption" domain="<?=htmlentities(trim($v_domain, "'"))?>" no_encryption="<?=_('No encryption');?>"><?=_('No encryption');?></option>
+									</select>
+								</td>
+							</tr>
+							<tr>
+								<td><?=_('Username');?>:</td>
+								<td>
+									<div><span id="v_account">example</span>@<?=htmlentities(trim($v_domain, "'"))?></div>
+								</td>
+							</tr>
+							<tr>
+								<td><?=_('Password');?>:</td>
+								<td>
+									<div id="v_password">******</div>
+								</td>
+							</tr>
+							<tr>
+								<td><?=_('IMAP hostname');?>:</td>
+								<td>
+									<div id="td_imap_hostname">mail.<?=$v_domain?></div>
+								</td>
+							</tr>
+							<tr>
+								<td><?=_('IMAP port');?>:</td>
+								<td>
+									<div id="td_imap_port">143</div>
+								</td>
+							</tr>
+							<tr>
+								<td><?=_('IMAP security');?>:</td>
+								<td>
+									<div id="td_imap_encryption"><?=_('STARTTLS');?></div>
+								</td>
+							</tr>
+							<tr>
+								<td><?=_('IMAP auth method');?>:</td>
+								<td>
+									<div><?=_('Normal password');?></div>
+								</td>
+							</tr>
+							<tr>
+								<td><?=_('SMTP hostname');?>:</td>
+								<td>
+									<div id="td_smtp_hostname">mail.<?=$v_domain?></div>
+								</td>
+							</tr>
+							<tr>
+								<td><?=_('SMTP port');?>:</td>
+								<td>
+									<div id="td_smtp_port">587</div>
+								</td>
+							</tr>
+							<tr>
+								<td><?=_('SMTP security');?>:</td>
+								<td>
+									<div id="td_smtp_encryption"><?=_('STARTTLS');?></div>
+								</td>
+							</tr>
+							<tr>
+								<td><?=_('SMTP auth method');?>:</td>
+								<td>
+									<div><?=_('Normal password');?></div>
+								</td>
+							</tr>
+							<?php if ($_SESSION['WEBMAIL_SYSTEM']) {?>
+								<tr>
+									<td><?=_('Webmail URL');?>:</td>
+									<td>
+										<div><a class="vst" href="http://<?=$v_webmail_alias?>" target="_blank">http://<?=$v_webmail_alias?> <i></i></a></div>
+									</td>
+								</tr>
+							<?php } ?>
+						</table>
+					</div>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 452 - 450
web/templates/pages/add_package.html

@@ -1,453 +1,455 @@
+<!-- Begin toolbar -->
 <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/package/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/package/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-          $back = $_SESSION['back'];
-          if (empty($back)) {
-            $back = "location.href='/list/package/'";
-          } else {
-            $back = "location.href='".$back."'";
-          }
-        ?>
-        <form id="vstobjects" name="v_add_package" 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"><?=_('Adding Package')?></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 _('Package Name');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_package" value="<?=htmlentities(trim($v_package, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Quota');?> <span class="optional">(<?=_('in megabytes')?>)</span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_disk_quota" value="<?=htmlentities(trim($v_disk_quota, "'"))?>">
-                                    <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-disk-quota"></i>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Bandwidth');?> <span class="optional">(<?=_('in megabytes')?>)</span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_bandwidth" value="<?=htmlentities(trim($v_bandwidth, "'"))?>">
-                                    <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-bandwidth"></i>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Backups');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_backups" value="<?=htmlentities(trim($v_backups, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="section-title" onclick="javascript:elementHideShow('web-options')">
-                                    <?=_('Web');?>
-                                </td>
-                                <td class="section-hide-button">
-                                    <a href="javascript:elementHideShow('web-options');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <table id="web-options" style="display: none;">
-                                        <tr>
-                                            <td class="vst-text input-label step-top">
-                                                <?php print _('Web Domains');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_web_domains" value="<?=htmlentities(trim($v_web_domains, "'"))?>">
-                                                <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-web-domains"></i>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Web Aliases');?> <span class="optional">(<?=_('per domain')?>)</span>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_web_aliases" value="<?=htmlentities(trim($v_web_aliases, "'"))?>">
-                                                <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-web-aliases"></i>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Web Template')  . " <span class='optional'> " .strtoupper($_SESSION['WEB_SYSTEM']) . "</span>";?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_web_template">
-                                                    <?php
-                                                        foreach ($web_templates as $key => $value) {
-                                                            echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
-                                                            if ((!empty($v_web_template)) && ( $value == $v_web_template)){
-                                                                echo ' selected' ;
-                                                            }
-                                                            if ((!empty($v_web_template)) && ( $value == $_POST['v_web_template'])){
-                                                                echo ' selected' ;
-                                                            }
-                                                            echo ">".htmlentities($value)."</option>\n";
-                                                        }
-                                                    ?>
-                                                </select>
-                                            </td>
-                                        </tr>
-                                        <?php if (!empty($_SESSION['WEB_BACKEND'])) { echo ""; ?>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Backend Template')  . "<span class='optional'>" .strtoupper($_SESSION['WEB_BACKEND']) . "</span>";?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_backend_template">
-                                                    <?php
-                                                        foreach ($backend_templates as $key => $value) {
-                                                            echo "\t\t\t\t<option value=\"".$value."\"";
-                                                            if ((!empty($v_backend_template)) && ( $value == $v_backend_template)){
-                                                                echo ' selected' ;
-                                                            }
-                                                            if ((!empty($v_backend_template)) && ( $value == $_POST['v_backend_template'])){
-                                                                echo ' selected' ;
-                                                            }
-                                                            echo ">".htmlentities($value)."</option>\n";
-                                                        }
-                                                    ?>
-                                                </select>
-                                            </td>
-                                        </tr>
-                                        <?php echo ""; }?>
-                                        <?php if (!empty($_SESSION['PROXY_SYSTEM'])) { echo ""; ?>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Proxy Template')  . "<span class='optional'>" .strtoupper($_SESSION['PROXY_SYSTEM']) . "</span>";?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_proxy_template">
-                                                    <?php
-                                                        foreach ($proxy_templates as $key => $value) {
-                                                            echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
-                                                            if ((!empty($v_proxy_template)) && ( $value == $v_proxy_template)){
-                                                                echo ' selected' ;
-                                                            }
-                                                            if ((!empty($v_proxy_template)) && ( $value == $_POST['v_proxy_template'])){
-                                                                echo ' selected' ;
-                                                            }
-                                                            echo ">".htmlentities($value)."</option>\n";
-                                                        }
-                                                    ?>
-                                                </select>
-                                            </td>
-                                        </tr>
-                                        <?php echo ""; }?>
-                                    </table>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="section-title" onclick="javascript:elementHideShow('dns-options')">
-                                    <?=_('DNS');?>
-                                </td>
-                                <td class="section-hide-button">
-                                    <a href="javascript:elementHideShow('dns-options');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <table id="dns-options" style="display: none;">
-                                        <tr>
-                                            <td class="vst-text input-label step-top">
-                                                <?php print _('DNS Template')  . "<span class='optional'>" .strtoupper($_SESSION['DNS_SYSTEM']) . "</span>";?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_dns_template">
-                                                    <?php
-                                                        foreach ($dns_templates as $key => $value) {
-                                                            echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
-                                                            if ((!empty($v_dns_template)) && ( $value == $v_dns_template)){
-                                                                echo ' selected' ;
-                                                            }
-                                                            if ((!empty($v_dns_template)) && ( $value == $_POST['v_dns_template'])){
-                                                                echo ' selected' ;
-                                                            }
-                                                            echo ">".htmlentities($value)."</option>\n";
-                                                        }
-                                                    ?>
-                                                </select>
-                                            </td>
-                                        </tr>
-            
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('DNS domains');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_dns_domains" value="<?=htmlentities(trim($v_dns_domains, "'"))?>">
-                                                <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-dns-domain"></i>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('DNS records');?> <span class="optional">(<?=_('per domain')?>)</span>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_dns_records" value="<?=htmlentities(trim($v_dns_records, "'"))?>">
-                                                <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-dns-records"></i>
-                                            </td>
-                                        </tr>
-                                        
-                                    <?php if ((isset($_SESSION['DNS_SYSTEM'])) && (!empty($_SESSION['DNS_SYSTEM']))) {?>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></span>
-                                                </td>
-                                            </tr>';
-                                            ?>
-            
-                                            <tr class="add-ns" <? if($v_ns8) echo 'style="display:none;"'; ?> >
-                                                <td class="step-top-small">
-                                                  <span class="add-ns-button additional-control add"><?=_('Add one more Name Server')?></span>
-                                                </td>
-                                            </tr>
-                                        <?php } ?>
-                                    </table>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="section-title" onclick="javascript:elementHideShow('mail-options')">
-                                    <?=_('Mail');?>
-                                </td>
-                                <td class="section-hide-button">
-                                    <a href="javascript:elementHideShow('mail-options');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <table id="mail-options" style="display: none;">
-                                        <tr>
-                                            <td class="vst-text input-label step-top">
-                                                <?php print _('Mail Domains');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_mail_domains" value="<?=htmlentities(trim($v_mail_domains, "'"))?>">
-                                                <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-mail-domains"></i>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Mail Accounts');?> <span class="optional">(<?=_('per domain')?>)</span>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_mail_accounts" value="<?=htmlentities(trim($v_mail_accounts, "'"))?>">
-                                                <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-mail-accounts"></i>
-                                            <td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="section-title" onclick="javascript:elementHideShow('database-options')">
-                                    <?=_('Databases');?>
-                                </td>
-                                <td class="section-hide-button">
-                                    <a href="javascript:elementHideShow('database-options');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <table id="database-options" style="display: none;">
-                                        <tr>
-                                            <td class="vst-text input-label step-top">
-                                                <?php print _('Databases');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_databases" value="<?=htmlentities(trim($v_databases, "'"))?>">
-                                                <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-databases"></i>
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="section-title" onclick="javascript:elementHideShow('system-options')">
-                                    <?=_('System');?>
-                                </td>
-                                <td class="section-hide-button">
-                                    <a href="javascript:elementHideShow('system-options');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <table id="system-options" style="display: none;">
-                                        <tr>
-                                            <td class="vst-text input-label step-top">
-                                                <?php print _('Cron Jobs');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_cron_jobs" value="<?=htmlentities(trim($v_cron_jobs, "'"))?>">
-                                                <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-cron-jobs"></i>
-                                            </td>
-                                        </tr>
-                                        <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)."\"";
-                                                            if ((!empty($v_shell)) && ( $value == $v_shell)){
-                                                                echo ' selected' ;
-                                                            }
-                                                            if ((!empty($v_shell)) && ( $value == $_POST['v_shell'])){
-                                                                echo ' selected' ;
-                                                            }
-                                                            echo ">".htmlentities($value)."</option>\n";
-                                                        }
-                                                    ?>
-                                                </select>
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-      </div>
+<div class="l-center animated fadeIn">
+
+	<form id="vstobjects" name="v_add_package" 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"><?=_('Adding Package');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Package Name');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_package" value="<?=htmlentities(trim($v_package, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Quota');?> <span class="optional">(<?=_('in megabytes');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_disk_quota" value="<?=htmlentities(trim($v_disk_quota, "'"))?>">
+								<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-disk-quota"></i>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Bandwidth');?> <span class="optional">(<?=_('in megabytes');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_bandwidth" value="<?=htmlentities(trim($v_bandwidth, "'"))?>">
+								<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-bandwidth"></i>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Backups');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_backups" value="<?=htmlentities(trim($v_backups, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="section-title" onclick="javascript:elementHideShow('web-options')">
+								<?=_('Web');?>
+							</td>
+							<td class="section-hide-button">
+								<a href="javascript:elementHideShow('web-options');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<table id="web-options" style="display: none;">
+									<tr>
+										<td class="vst-text input-label step-top">
+											<?=_('Web Domains');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_web_domains" value="<?=htmlentities(trim($v_web_domains, "'"))?>">
+											<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-web-domains"></i>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('Web Aliases');?> <span class="optional">(<?=_('per domain');?>)</span>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_web_aliases" value="<?=htmlentities(trim($v_web_aliases, "'"))?>">
+											<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-web-aliases"></i>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('Web Template')  . " <span class='optional'> " .strtoupper($_SESSION['WEB_SYSTEM']) . "</span>";?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<select class="vst-list" name="v_web_template">
+												<?php
+													foreach ($web_templates as $key => $value) {
+														echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
+														if ((!empty($v_web_template)) && ( $value == $v_web_template)){
+															echo ' selected' ;
+														}
+														if ((!empty($v_web_template)) && ( $value == $_POST['v_web_template'])){
+															echo ' selected' ;
+														}
+														echo ">".htmlentities($value)."</option>\n";
+													}
+												?>
+											</select>
+										</td>
+									</tr>
+									<?php if (!empty($_SESSION['WEB_BACKEND'])) { echo ""; ?>
+										<tr>
+											<td class="vst-text input-label">
+												<?=_('Backend Template')  . "<span class='optional'>" .strtoupper($_SESSION['WEB_BACKEND']) . "</span>";?>
+											</td>
+										</tr>
+										<tr>
+											<td>
+												<select class="vst-list" name="v_backend_template">
+													<?php
+														foreach ($backend_templates as $key => $value) {
+															echo "\t\t\t\t<option value=\"".$value."\"";
+															if ((!empty($v_backend_template)) && ( $value == $v_backend_template)){
+																echo ' selected' ;
+															}
+															if ((!empty($v_backend_template)) && ( $value == $_POST['v_backend_template'])){
+																echo ' selected' ;
+															}
+															echo ">".htmlentities($value)."</option>\n";
+														}
+													?>
+												</select>
+											</td>
+										</tr>
+									<?=""; }?>
+									<?php if (!empty($_SESSION['PROXY_SYSTEM'])) { echo ""; ?>
+										<tr>
+											<td class="vst-text input-label">
+												<?=_('Proxy Template')  . "<span class='optional'>" .strtoupper($_SESSION['PROXY_SYSTEM']) . "</span>";?>
+											</td>
+										</tr>
+										<tr>
+											<td>
+												<select class="vst-list" name="v_proxy_template">
+													<?php
+														foreach ($proxy_templates as $key => $value) {
+															echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
+															if ((!empty($v_proxy_template)) && ( $value == $v_proxy_template)){
+																echo ' selected' ;
+															}
+															if ((!empty($v_proxy_template)) && ( $value == $_POST['v_proxy_template'])){
+																echo ' selected' ;
+															}
+															echo ">".htmlentities($value)."</option>\n";
+														}
+													?>
+												</select>
+											</td>
+										</tr>
+									<?=""; }?>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td class="section-title" onclick="javascript:elementHideShow('dns-options')">
+								<?=_('DNS');?>
+							</td>
+							<td class="section-hide-button">
+								<a href="javascript:elementHideShow('dns-options');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<table id="dns-options" style="display: none;">
+									<tr>
+										<td class="vst-text input-label step-top">
+											<?=_('DNS Template')  . "<span class='optional'>" .strtoupper($_SESSION['DNS_SYSTEM']) . "</span>";?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<select class="vst-list" name="v_dns_template">
+												<?php
+													foreach ($dns_templates as $key => $value) {
+														echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
+														if ((!empty($v_dns_template)) && ( $value == $v_dns_template)){
+															echo ' selected' ;
+														}
+														if ((!empty($v_dns_template)) && ( $value == $_POST['v_dns_template'])){
+															echo ' selected' ;
+														}
+														echo ">".htmlentities($value)."</option>\n";
+													}
+												?>
+											</select>
+										</td>
+									</tr>
+
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('DNS domains');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_dns_domains" value="<?=htmlentities(trim($v_dns_domains, "'"))?>">
+											<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-dns-domain"></i>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('DNS records');?> <span class="optional">(<?=_('per domain');?>)</span>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_dns_records" value="<?=htmlentities(trim($v_dns_records, "'"))?>">
+											<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-dns-records"></i>
+										</td>
+									</tr>
+									<?php if ((isset($_SESSION['DNS_SYSTEM'])) && (!empty($_SESSION['DNS_SYSTEM']))) {?>
+										<tr>
+											<td class="vst-text input-label">
+												<?=_('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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></span>
+											</td>
+										</tr>
+										<?php
+											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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></span>
+													</td>
+												</tr>';
+											}
+										?>
+										<tr class="add-ns" <?php if ($v_ns8) echo 'style="display:none;"' ; ?> >
+											<td class="step-top-small">
+												<span class="add-ns-button additional-control add"><?=_('Add one more Name Server');?></span>
+											</td>
+										</tr>
+									<?php } ?>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td class="section-title" onclick="javascript:elementHideShow('mail-options')">
+								<?=_('Mail');?>
+							</td>
+							<td class="section-hide-button">
+								<a href="javascript:elementHideShow('mail-options');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<table id="mail-options" style="display: none;">
+									<tr>
+										<td class="vst-text input-label step-top">
+											<?=_('Mail Domains');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_mail_domains" value="<?=htmlentities(trim($v_mail_domains, "'"))?>">
+											<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-mail-domains"></i>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('Mail Accounts');?> <span class="optional">(<?=_('per domain');?>)</span>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_mail_accounts" value="<?=htmlentities(trim($v_mail_accounts, "'"))?>">
+											<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-mail-accounts"></i>
+										<td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td class="section-title" onclick="javascript:elementHideShow('database-options')">
+								<?=_('Databases');?>
+							</td>
+							<td class="section-hide-button">
+								<a href="javascript:elementHideShow('database-options');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<table id="database-options" style="display: none;">
+									<tr>
+										<td class="vst-text input-label step-top">
+											<?=_('Databases');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_databases" value="<?=htmlentities(trim($v_databases, "'"))?>">
+											<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-databases"></i>
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td class="section-title" onclick="javascript:elementHideShow('system-options')">
+								<?=_('System');?>
+							</td>
+							<td class="section-hide-button">
+								<a href="javascript:elementHideShow('system-options');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<table id="system-options" style="display: none;">
+									<tr>
+										<td class="vst-text input-label step-top">
+											<?=_('Cron Jobs');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_cron_jobs" value="<?=htmlentities(trim($v_cron_jobs, "'"))?>">
+											<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-cron-jobs"></i>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('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)."\"";
+														if ((!empty($v_shell)) && ( $value == $v_shell)){
+															echo ' selected' ;
+														}
+														if ((!empty($v_shell)) && ( $value == $_POST['v_shell'])){
+															echo ' selected' ;
+														}
+														echo ">".htmlentities($value)."</option>\n";
+													}
+												?>
+											</select>
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 191 - 189
web/templates/pages/add_user.html

@@ -1,193 +1,195 @@
+<!-- Begin toolbar -->
 <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>
-          </div>
-          <div class="l-unit-toolbar__buttonstrip float-right">
-            <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-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>
+		</div>
+		<div class="l-unit-toolbar__buttonstrip float-right">
+			<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>
+<!-- End toolbar -->
 
-    <div class="l-separator"></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" name="v_add_user" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="ok" value="Add" />
+<div class="l-center animated fadeIn">
 
-            <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"><?=_('Adding 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_username" value="<?=htmlentities(trim($v_username, "'"))?>" tabindex="1" >
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text ">
-                                    <?php print _('Contact');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_name" value="<?=htmlentities(trim($v_name, "'"))?>" tabindex="2" >
-                                </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" id='v_email' value="<?=htmlentities(trim($v_email, "'"))?>" tabindex="3" >
-                                </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, "'"))?>" tabindex="4" /><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" 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>
-                                    </td>
-                                </tr>
-                             <tr id="send-welcome">
-                                <td class="vst-text input-label">
-                                    <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>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Language');?>
-                                </td>
-                            </tr>                        
-                            <tr>
-                                <td>
-                                    <select class="vst-list" name="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>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Role');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <select class="vst-list" name="v_role" tabindex="7">
-                                        <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" name="v_package">
-                                    <?php print _('Package');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <select class="vst-list" name="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>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Send login credentials to email address');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text"  class="vst-input" name="v_notify" id="v_notify" value="<?=htmlentities(trim($v_notify, "'"))?>" tabindex="8" >
-                                </td>
-                            </tr>
-                        </table>
-                    <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+	<form id="vstobjects" name="v_add_user" 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"><?=_('Adding User');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Username');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_username" value="<?=htmlentities(trim($v_username, "'"))?>" tabindex="1">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text ">
+								<?=_('Contact');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_name" value="<?=htmlentities(trim($v_name, "'"))?>" tabindex="2">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Email');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_email" id='v_email' value="<?=htmlentities(trim($v_email, "'"))?>" tabindex="3">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Password');?> <a href="javascript:randomString();" title="<?=_('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, "'"))?>" tabindex="4" /><br />
+								<meter max="4" id="meter"></meter>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text">
+								<?=_('Your password must have at least');?>:
+								<ul>
+									<li><?=_('8 characters long');?></li>
+									<li><?=_('1 uppercase & 1 lowercase character');?></li>
+									<li><?=_('1 number');?></li>
+								</ul>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<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" ?>><?=_('Do not allow user to log in to Control Panel');?></label>
+							</td>
+						</tr>
+						<tr id="send-welcome">
+							<td class="vst-text input-label">
+								<label><input type="checkbox" size="20" class="vst-checkbox" name="v_email_notice" id='v_email_notify' value="" tabindex="5" /><?=_('Send welcome email');?></label>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Language');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" name="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>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Role');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" name="v_role" tabindex="7">
+									<option value="user"><?=_('User');?>
+									<option value="admin" <?php if($v_role == "admin" ){ echo "selected"; } ?>><?=_('Administrator');?>
+								</select>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label" name="v_package">
+								<?=_('Package');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" name="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>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Send login credentials to email address');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" class="vst-input" name="v_notify" id="v_notify" value="<?=htmlentities(trim($v_notify, "'"))?>" tabindex="8">
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 544 - 539
web/templates/pages/add_web.html

@@ -1,549 +1,554 @@
+<!-- Begin toolbar -->
 <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/web/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-          </div>
-          <div class="l-unit-toolbar__buttonstrip float-right">
-            <? if (($user == 'admin') && (($_GET['accept'] === "true")) || ($user !== "admin"))  {?>
-                <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-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<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>
+		</div>
+		<div class="l-unit-toolbar__buttonstrip float-right">
+			<?php if (($user == 'admin') && (($_GET['accept'] === "true")) || ($user !== "admin"))  {?>
+				<a href="#" class="ui-button" title="<?=_('Save');?>" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+			<?php } ?>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-      <?php
-        $back = $_SESSION['back'];
-        if (empty($back)) {
-          $back = "location.href='/list/web/'";
-        } else {
-          $back = "location.href='".$back."'";
-        }
-      ?>
+<div class="l-center animated fadeIn">
 
-        <form id="vstobjects" name="v_add_web" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="ok" value="Add" />
+	<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>
-                            </td>
-                        </tr>
-                        <? if (($user == 'admin') && (($_GET['accept'] !== "true")))  {?>
-                        <tr>
-                            <td class="step-top">
-                                <span class="alert alert-danger alert-with-icon">
-                                    <i class="fas fa-exclamation"></i>
-                                    <?=_('Avoid adding web domains on admin account')?>
-                                </span>
-                            </td>
-                        </tr>
-                        <?php } ?>
-                        <? if (($user == 'admin') && (empty($_GET['accept']))) {?>
-                            <tr>
-                                <td class="step-top">
-                                    <span><a href="/add/user/" class="vst-advanced admin-warning-button"><?=_('Add User')?></a></span>
-                                    <span><a href="/add/web/?accept=true" class="vst-advanced button danger admin-warning-button"><?=_('Continue')?></a> </span>
-                                </td>
-                            </tr>
-                        <? } ?>
-                        <? if (($user == 'admin') && (($_GET['accept'] === "true")) || ($user !== "admin"))  {?>
-                            <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>
-                            <tr><td class="input-label"></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');?>&nbsp;<i class="fas fa-arrow-circle-right"></i></a>
-                            </td>
-                        </tr>
-                        -->
-                    </table>
-                    <table class="data-col2" width="600px" style="display: none;">
-                        <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>
-                        <tr>
-                            <td class="vst-text input-label">
-                                <?php print _('Web Template')  . "<span class='optional'>" .strtoupper($_SESSION['WEB_SYSTEM']) . "</span>";?>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td>
-                                <select class="vst-list" name="v_template">
-                                    <?php
-                                        foreach ($templates as $key => $value) {
-                                            echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
-                                            $svalue = "'".$value."'";
-                                            if ((!empty($v_template)) && ( $value == $v_template ) || ($svalue == $v_template)){
-                                                echo ' selected' ;
-                                            }
-                                            echo ">".htmlentities($value)."</option>\n";
-                                        }
-                                    ?>
-                                </select>
-                            </td>
-                        </tr>
-                        <?php if (!empty($_SESSION['WEB_BACKEND'])) { ?>
-                        <tr>
-                            <td class="vst-text input-label">
-                                <?php print _('Backend Template') . " <span class='optional'>" . strtoupper($_SESSION['WEB_BACKEND']) . "</span>";?>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td>
-                                <select class="vst-list" name="v_backend_template">
-                                    <?php
-                                        foreach ($backend_templates as $key => $value) {
-                                            echo "\t\t\t\t<option value=\"".$value."\"";
-                                            $svalue = "'".$value."'";
-                                            if ((!empty($v_backend_template)) && ( $value == $v_backend_template ) || ($svalue == $v_backend_template)){
-                                                echo ' selected' ;
-                                            }
-                                            if ((empty($v_backend_template)) && ($value == 'default')){
-                                                echo ' selected' ;
-                                            }
-                                            echo ">".htmlentities($value)."</option>\n";
-                                        }
-                                    ?>
-                                </select>
-                            </td>
-                        </tr>
-                        <?php }?>
-                        <?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 class="vst-text input-label">
-                                <?php print _('Proxy Template');?>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td>
-                                <select class="vst-list" name="v_proxy_template">
-                                    <?php
-                                        foreach ($proxy_templates as $key => $value) {
-                                            echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
-                                            $svalue = "'".$value."'";
-                                            if ((!empty($v_proxy_template)) && ( $value == $v_proxy_template ) || ($svalue == $v_proxy_template)){
-                                                echo ' selected' ;
-                                            }
-                                            if ((empty($v_proxy_template)) && ($value == 'default')){
-                                                echo ' selected' ;
-                                            }
-                                            echo ">".htmlentities($value)."</option>\n";
-                                        }
-                                    ?>
-                                </select>
-                            </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="vst-text step-top">
-                                    <label><input type="checkbox" size="20" class="vst-checkbox" name="v_custom_doc_root_check" <?php if (!empty($v_custom_doc_root)) echo "checked=yes" ?> onclick="javascript:elementHideShow('v_custom_doc_root');"><?php print _('Custom document root');?></label>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="step-left">
-                                    <table style="display:<?php if (empty($v_custom_doc_root)) { echo 'none';} else {echo 'block';}?> ;" id="v_custom_doc_root">
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Point to');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="hidden" name="v-custom-doc-root_prepath" value="<?php echo $v_custom_doc_root_prepath;?>">
-                                                <select class="vst-list" name="v-custom-doc-domain">
-                                                    <option value="<?=htmlentities(trim($v_domain, "'"))?>" id="v-custom-doc-domain-main"><?=htmlentities(trim($v_domain, "'"))?></option>
-                                                    <?php
-                                                    foreach ($user_domains  as $domain) {
-                                                        if($domain != $v_domain ){
-                                                        if($v_custom_doc_domain == $domain){
-                                                    ?>
-                                                            <option value="<?php echo $domain;?>" selected="selected"><?php echo $domain;?></option> 
-                                                    <?php
-                                                        }else{
-                                                     ?>
-                                                            <option value="<?php echo $domain;?>"><?php echo $domain;?></option> 
-                                                    <?php                                                           
-                                                        }
-                                                        }
-                                                    }
-                                                    ?>
-                                                </select>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print( _('Directory'));?> <span class="optional">(<?php print _('optional');?>)</span>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input"
-                                                name="v-custom-doc-folder" value="<?=htmlentities(trim($v_custom_doc_folder, "'"))?>">
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <small class="custom_docroot_hint"></small>
-                                            </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="step-left input-label vst-text">
-                                            <label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl_forcessl" <?php if($v_ssl_forcessl != 'no') echo "checked=yes" ?> onclick="App.Actions.WEB.toggle_forcessl(this)"><?php print _('Force SSL/HTTPS');?></label>
-                                        </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 console" 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 console" 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 console" 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 sprintf(_('Prefix %s will be added to username automatically'),$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>
+		<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>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<?php if (($user == 'admin') && (($_GET['accept'] !== "true")))  {?>
+							<tr>
+								<td class="step-top">
+									<span class="alert alert-danger alert-with-icon">
+										<i class="fas fa-exclamation"></i>
+										<?=_('Avoid adding web domains on admin account');?>
+									</span>
+								</td>
+							</tr>
+						<?php } ?>
+						<?php if (($user == 'admin') && (empty($_GET['accept']))) {?>
+							<tr>
+								<td class="step-top">
+									<span><a href="/add/user/" class="vst-advanced admin-warning-button"><?=_('Add User');?></a></span>
+									<span><a href="/add/web/?accept=true" class="vst-advanced button danger admin-warning-button"><?=_('Continue');?></a> </span>
+								</td>
+							</tr>
+						<?php } ?>
+						<?php if (($user == 'admin') && (($_GET['accept'] === "true")) || ($user !== "admin")) {?>
+							<tr>
+								<td class="vst-text step-top">
+									<?=_('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">
+									<?=_('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>
+							<tr>
+								<td class="input-label"></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") ?>><?=_('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") ?>><?=_('Mail Support');?></label>
+										</td>
+									</tr>
+								<?php } ?>
+							<?php } ?>
+						<?php } ?>
+						<!-- OPTION DISABLED
+						<tr>
+							<td class="step-top vst-text" style="/*padding: 32px 0 20px 0;*/">
+								<a href="javascript:elementHideShow('advtable');" class="vst-advanced"><?=_('Advanced options');?>&nbsp;<i class="fas fa-arrow-circle-right"></i></a>
+							</td>
+						</tr>
+						-->
+					</table>
 
-                                        <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>
+					<!--
+						THE FOLLOWING SECTION OF CODE IS NO LONGER EXPOSED VIA USER INTERFACE
+						BUT VALUES ARE REQUIRED FOR DOMAINS TO BE CREATED CORRECTLY UNTIL BACKEND CALLS ARE MODIFIED
+					-->
+					<table class="data-col2" width="600px" style="display: none;">
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('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>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Web Template')  . "<span class='optional'>" .strtoupper($_SESSION['WEB_SYSTEM']) . "</span>";?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" name="v_template">
+									<?php
+										foreach ($templates as $key => $value) {
+											echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
+											$svalue = "'".$value."'";
+											if ((!empty($v_template)) && ( $value == $v_template ) || ($svalue == $v_template)){
+												echo ' selected' ;
+											}
+											echo ">".htmlentities($value)."</option>\n";
+										}
+									?>
+								</select>
+							</td>
+						</tr>
+						<?php if (!empty($_SESSION['WEB_BACKEND'])) { ?>
+							<tr>
+								<td class="vst-text input-label">
+									<?=_('Backend Template') . " <span class='optional'>" . strtoupper($_SESSION['WEB_BACKEND']) . "</span>";?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<select class="vst-list" name="v_backend_template">
+										<?php
+											foreach ($backend_templates as $key => $value) {
+												echo "\t\t\t\t<option value=\"".$value."\"";
+												$svalue = "'".$value."'";
+												if ((!empty($v_backend_template)) && ( $value == $v_backend_template ) || ($svalue == $v_backend_template)){
+													echo ' selected' ;
+												}
+												if ((empty($v_backend_template)) && ($value == 'default')){
+													echo ' selected' ;
+												}
+												echo ">".htmlentities($value)."</option>\n";
+											}
+										?>
+									</select>
+								</td>
+							</tr>
+						<?php }?>
+						<?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');"><?=_('Proxy Support');?></label>
+								</td>
+							</tr>
+							<tr>
+								<td class="vst-text input-label">
+									<?=_('Proxy Template');?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<select class="vst-list" name="v_proxy_template">
+										<?php
+											foreach ($proxy_templates as $key => $value) {
+												echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
+												$svalue = "'".$value."'";
+												if ((!empty($v_proxy_template)) && ( $value == $v_proxy_template ) || ($svalue == $v_proxy_template)){
+													echo ' selected' ;
+												}
+												if ((empty($v_proxy_template)) && ($value == 'default')){
+													echo ' selected' ;
+												}
+												echo ">".htmlentities($value)."</option>\n";
+											}
+										?>
+									</select>
+								</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">
+												<?=_('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>
+						<?=""; }?>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('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="<?php if (trim($v_stats, "'") == ' none') { echo '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">
+											<?=_('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">
+											<?=_('Password');?> / <a href="javascript:WEBrandom();" class="generate"><?=_('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="vst-text step-top">
+								<label><input type="checkbox" size="20" class="vst-checkbox" name="v_custom_doc_root_check" <?php if (!empty($v_custom_doc_root)) echo "checked=yes" ?> onclick="javascript:elementHideShow('v_custom_doc_root');"><?=_('Custom document root');?></label>
+							</td>
+						</tr>
+						<tr>
+							<td class="step-left">
+								<table style="display:<?php if (empty($v_custom_doc_root)) { echo 'none';} else {echo 'block';}?> ;" id="v_custom_doc_root">
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('Point to');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="hidden" name="v-custom-doc-root_prepath" value="<?=$v_custom_doc_root_prepath;?>">
+											<select class="vst-list" name="v-custom-doc-domain">
+												<option value="<?=htmlentities(trim($v_domain, "'"))?>" id="v-custom-doc-domain-main"><?=htmlentities(trim($v_domain, "'"))?></option>
+												<?php
+													foreach ($user_domains  as $domain) {
+														if($domain != $v_domain ){
+														if($v_custom_doc_domain == $domain){
+													?>
+													<option value="<?=$domain;?>" selected="selected"><?=$domain;?></option>
+												<?php } else{ ?>
+													<option value="<?=$domain;?>"><?=$domain;?></option>
+												<?php } } } ?>
+											</select>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<?php print( _('Directory'));?> <span class="optional">(<?=_('optional');?>)</span>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input"
+												name="v-custom-doc-folder" value="<?=htmlentities(trim($v_custom_doc_folder, "'"))?>">
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<small class="custom_docroot_hint"></small>
+										</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>
+								</table>
+							</td>
+						</tr>
 
-    <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 sprintf(_('Prefix %s will be added to username automatically'),$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="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');"><?=_('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)"><?=_('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="step-left input-label vst-text">
+											<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl_forcessl" <?php if($v_ssl_forcessl != 'no') echo "checked=yes" ?> onclick="App.Actions.WEB.toggle_forcessl(this)"><?=_('Force SSL/HTTPS');?></label>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label step-left">
+											<?=_('SSL Certificate');?>
+											<span id="generate-csr"> / <a class="generate" target="_blank" href="/generate/ssl/?domain=<?=htmlentities(trim($v_domain, "'")) ?>"><?=_('Generate CSR') ?></a></span>
+										</td>
+									</tr>
+									<tr>
+										<td class="step-left">
+											<textarea size="20" class="vst-textinput short console" name="v_ssl_crt"><?=htmlentities(trim($v_ssl_crt, "'"))?></textarea>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label step-left">
+											<?=_('SSL Key');?>
+										</td>
+									</tr>
+									<tr>
+										<td class="step-left">
+											<textarea size="20" class="vst-textinput short console" name="v_ssl_key"><?=htmlentities(trim($v_ssl_key, "'"))?></textarea>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label step-left">
+											<?=_('SSL Certificate Authority / Intermediate');?> <span class="optional">(<?=_('optional');?>)</span>
+										</td>
+									</tr>
+									<tr>
+										<td class="step-left">
+											<textarea size="20" class="vst-textinput short console" 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)"><?=_('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 <?=(!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">
+											<?=_('FTP') ?> #<span class="ftp-user-number"><?=$i + 1; ?></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[<?=$i ?>][delete]" value="0" />
+											<input type="hidden" class="v-ftp-user-is-new" name="v_ftp_user[<?=$i ?>][is_new]" value="<?=htmlentities($ftp_user['is_new']) ?>" />
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text step-left input-label">
+											<?=_('Username');?><br>
+											<span style="font-size: 10pt; color:#777;"><?=sprintf(_('Prefix %s will be added to username automatically'),$user."_");?></span>
+										</td>
+									</tr>
+									<tr>
+										<td class="step-left">
+											<input type="text" size="20" class="vst-input v-ftp-user" <?=$ftp_user['is_new'] != 1 ? 'disabled="disabled"' : '' ?> name="v_ftp_user[<?=$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">
+											<?=_('Password');?> / <a href="javascript:void(0);" onClick="FTPrandom(this)" ; class="generate"><?=_('generate');?></a>
+										</td>
+									</tr>
+									<tr>
+										<td class="step-left">
+											<input type="text" class="vst-input v-ftp-user-psw password" name="v_ftp_user[<?=$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="">
-                        <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>
+									<tr>
+										<td class="vst-text step-left input-label">
+											<?=_('Path');?>
+										</td>
+									</tr>
+									<tr>
+										<td class="step-left">
+											<input type="hidden" class="vst-input v-ftp-pre-path" name="v_ftp_pre_path" value="<?=!empty($v_ftp_pre_path) ? htmlentities(trim($v_ftp_pre_path, "'")) : '/'; ?>">
+											<input type="text" class="vst-input v-ftp-path" name="v_ftp_user[<?=$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>
 
-    <script>
-        GLOBAL.FTP_USER_PREFIX  = <?=json_encode($user.'_')?>;
-        GLOBAL.FTP_USER_PREPATH = <?=json_encode($v_ftp_user_prepath)?>;
-    </script>
+										<tr>
+											<td class="vst-text step-left input-label">
+												 <?=_('Send FTP credentials to email');?>
+											</td>
+										</tr>
+										<tr>
+											<td class="step-left">
+												<input type="text"  class="vst-input" name="v_ftp_user[<?=$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">
+						<?=_('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">
+						<?=_('Username');?><br>
+						<span style="font-size: 10pt; color:#777;"><?=sprintf(_('Prefix %s will be added to username automatically'),$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">
+						<?=_('Password');?> / <a href="javascript:void(0);" onClick="FTPrandom(this)"; class="generate" ><?=_('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">
+						 <?=_('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">
+						 <?=_('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 = <?php json_encode($user.'_') ?>;
+		GLOBAL.FTP_USER_PREPATH = <?= json_encode($v_ftp_user_prepath) ?>;
+	</script>

+ 21 - 21
web/templates/pages/debug_panel.html

@@ -1,23 +1,23 @@
-<div class="debug-panel-header"><?=_('Debug mode is enabled.')?> <a href="javascript:elementHideShow('debug-panel')"><?=_('Show / Hide Panel')?></a></div>
+<div class="debug-panel-header"><?=_('Debug mode is enabled.');?> <a href="javascript:elementHideShow('debug-panel')"><?=_('Show / Hide Panel');?></a></div>
 <div class="debug-panel-contents animated fadeIn" id="debug-panel" style="display:none;">
-    <?php
-        echo "<h3>Server Variables</h3>";
-        foreach ($_SERVER as $key=>$val)
-        echo "<b>".$key."= </b> ".$val."  ";
-    ?>
-    <?php
-        echo "<h3>Session Variables</h3>";
-        foreach ($_SESSION as $key=>$val)
-        echo "<b>".$key."= </b> ".$val."  ";
-    ?>
-    <?php
-        echo "<h3>POST Variables</h3>";
-        foreach ($_POST as $key=>$val)
-        echo "<b>".$key."= </b> ".$val."  ";  
-    ?>
-    <?php
-        echo "<h3>GET Variables</h3>";
-        foreach ($_GET as $key=>$val)
-        echo "<b>".$key."= </b> ".$val."  ";
-    ?>
+	<?php
+		echo "<h3>Server Variables</h3>";
+		foreach ($_SERVER as $key=>$val)
+		echo "<b>".$key."= </b> ".$val."  ";
+	?>
+	<?php
+		echo "<h3>Session Variables</h3>";
+		foreach ($_SESSION as $key=>$val)
+		echo "<b>".$key."= </b> ".$val."  ";
+	?>
+	<?php
+		echo "<h3>POST Variables</h3>";
+		foreach ($_POST as $key=>$val)
+		echo "<b>".$key."= </b> ".$val."  ";  
+	?>
+	<?php
+		echo "<h3>GET Variables</h3>";
+		foreach ($_GET as $key=>$val)
+		echo "<b>".$key."= </b> ".$val."  ";
+	?>
 </div>

+ 100 - 99
web/templates/pages/edit_backup_exclusions.html

@@ -1,102 +1,103 @@
+<!-- Begin toolbar -->
 <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/backup/exclusions/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/backup/exclusions/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center edit animated fadeIn">
-      <?php
-        $back = $_SESSION['back'];
-        if (empty($back)) {
-          $back = "location.href='/list/backup/exclusions'";
-        } else {
-          $back = "location.href='".$back."'";
-        }
-      ?>
-        <form id="vstobjects" name="v_edit_backup_exclusions" method="post" 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" width="600px">
-                            <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Editing Backup Exclusions')?></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 _('Web Domains');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput" name="v_web" placeholder="<?php echo _('WEB_EXCLUSIONS') ?>"><?=htmlentities(trim($v_web, "'"))?></textarea>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Mail Domains');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput" name="v_mail" placeholder="<?php echo _('MAIL_EXCLUSIONS') ?>"><?=htmlentities(trim($v_mail, "'"))?></textarea>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Databases');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput" name="v_db" placeholder="<?php echo _('DB_EXCLUSIONS') ?>"><?=htmlentities(trim($v_db, "'"))?></textarea>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('User Directories');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea size="20" class="vst-textinput" name="v_userdir" placeholder="<?php echo _('USER_EXCLUSIONS') ?>"><?=htmlentities(trim($v_userdir, "'"))?></textarea>
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+<div class="l-center edit animated fadeIn">
+
+	<form id="vstobjects" name="v_edit_backup_exclusions" method="post" 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" width="600px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Editing Backup Exclusions');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Web Domains');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea class="vst-textinput" name="v_web" placeholder="<?=_('WEB_EXCLUSIONS') ?>"><?=htmlentities(trim($v_web, "'"))?></textarea>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Mail Domains');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea class="vst-textinput" name="v_mail" placeholder="<?=_('MAIL_EXCLUSIONS') ?>"><?=htmlentities(trim($v_mail, "'"))?></textarea>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Databases');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea class="vst-textinput" name="v_db" placeholder="<?=_('DB_EXCLUSIONS') ?>"><?=htmlentities(trim($v_db, "'"))?></textarea>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('User Directories');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea size="20" class="vst-textinput" name="v_userdir" placeholder="<?=_('USER_EXCLUSIONS') ?>"><?=htmlentities(trim($v_userdir, "'"))?></textarea>
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 417 - 428
web/templates/pages/edit_cron.html

@@ -1,439 +1,428 @@
+<!-- Begin toolbar -->
 <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/cron/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/cron/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-            $back = $_SESSION['back'];
-            if (empty($back)) {
-                $back = "location.href='/list/cron/'";
-            } else {
-                $back = "location.href='".$back."'";
-            }
-        ?>
+<div class="l-center animated fadeIn">
 
-        <div class="vst-text step-top helper-container">
-            <div id="tabs"  class="cron-helper-tabs">
-                <ul>
-                    <li><a href="#tabs-1"><?=_('Minutes')?></a></li>
-                    <li><a href="#tabs-2"><?=_('Hourly')?></a></li>
-                    <li><a href="#tabs-3"><?=_('Daily')?></a></li>
-                    <li><a href="#tabs-4"><?=_('Weekly')?></a></li>
-                    <li><a href="#tabs-5"><?=_('Monthly')?></a></li>
-                </ul>
-                <div id="tabs-1">
-                    <form>
-                        <input type="hidden" name="h_hour" value="*" />
-                        <input type="hidden" name="h_day" value="*" />
-                        <input type="hidden" name="h_month" value="*" />
-                        <input type="hidden" name="h_wday" value="*" />
-                        <p><span class="first"><?=_('Run Command')?>:</span>
-                            <select name="h_min" class="vst-list">
-                                <option value="*"  selected="selected"><?=_('every minute')?></option>
-                                <option value="*/2"><?=_('every two minutes')?></option>
-                                <option value="*/5"><?=_('every')?> 5</option>
-                                <option value="*/10"><?=_('every')?> 10</option>
-                                <option value="*/15"><?=_('every')?> 15</option>
-                                <option value="*/30"><?=_('every')?> 30</option>
-                            </select>
-                        </p>
-                        <p class="step-top">
-                            <input type="submit" value="<?=_('generate')?>" class="button">
-                        </p>
-                    </form>
-                </div>
+	<div class="vst-text step-top helper-container">
+		<div id="tabs" class="cron-helper-tabs">
+			<ul>
+				<li><a href="#tabs-1"><?=_('Minutes');?></a></li>
+				<li><a href="#tabs-2"><?=_('Hourly');?></a></li>
+				<li><a href="#tabs-3"><?=_('Daily');?></a></li>
+				<li><a href="#tabs-4"><?=_('Weekly');?></a></li>
+				<li><a href="#tabs-5"><?=_('Monthly');?></a></li>
+			</ul>
+			<div id="tabs-1">
+				<form>
+					<input type="hidden" name="h_hour" value="*" />
+					<input type="hidden" name="h_day" value="*" />
+					<input type="hidden" name="h_month" value="*" />
+					<input type="hidden" name="h_wday" value="*" />
+					<p><span class="first"><?=_('Run Command');?>:</span>
+						<select name="h_min" class="vst-list">
+							<option value="*" selected="selected"><?=_('every minute');?></option>
+							<option value="*/2"><?=_('every two minutes');?></option>
+							<option value="*/5"><?=_('every');?> 5</option>
+							<option value="*/10"><?=_('every');?> 10</option>
+							<option value="*/15"><?=_('every');?> 15</option>
+							<option value="*/30"><?=_('every');?> 30</option>
+						</select>
+					</p>
+					<p class="step-top">
+						<input type="submit" value="<?=_('generate');?>" class="button">
+					</p>
+				</form>
+			</div>
 
-                <div id="tabs-2">
-                    <form>
-                        <input type="hidden" name="h_day" value="*" />
-                        <input type="hidden" name="h_month" value="*" />
-                        <input type="hidden" name="h_wday" value="*" />
-                        <p><span class="first"><?=_('Run Command')?>:</span>
-                            <select name="h_hour" class="vst-list">
-                                <option value="*" selected="selected"><?=_('every hour')?></option>
-                                <option value="*/2"><?=_('every two hours')?></option>
-                                <option value="*/6"><?=_('every')?> 6</option>
-                                <option value="*/12"><?=_('every')?> 12</option>
-                            </select>
-                        </p>
+			<div id="tabs-2">
+				<form>
+					<input type="hidden" name="h_day" value="*" />
+					<input type="hidden" name="h_month" value="*" />
+					<input type="hidden" name="h_wday" value="*" />
+					<p><span class="first"><?=_('Run Command');?>:</span>
+						<select name="h_hour" class="vst-list">
+							<option value="*" selected="selected"><?=_('every hour');?></option>
+							<option value="*/2"><?=_('every two hours');?></option>
+							<option value="*/6"><?=_('every');?> 6</option>
+							<option value="*/12"><?=_('every');?> 12</option>
+						</select>
+					</p>
+					<p><span class="first"><?=_('Minute');?>:</span>
+						<select name="h_min" class="vst-list short">
+							<option value="0" selected="selected">00</option>
+							<option value="15">15</option>
+							<option value="30">30</option>
+							<option value="45">45</option>
+						</select>
+					</p>
+					<p class="step-top">
+						<input type="submit" value="<?=_('generate');?>" class="button">
+					</p>
+				</form>
+			</div>
 
-                        <p><span class="first"><?=_('Minute')?>:</span>
-                            <select name="h_min" class="vst-list short">
-                                <option value="0" selected="selected">00</option>
-                                <option value="15">15</option>
-                                <option value="30">30</option>
-                                <option value="45">45</option>
-                            </select>
-                        </p>
+			<div id="tabs-3">
+				<form>
+					<input type="hidden" name="h_month" value="*" />
+					<input type="hidden" name="h_wday" value="*" />
+					<p><span class="first"><?=_('Run Command');?>:</span>
+						<select name="h_day" class="vst-list">
+							<option value="*" selected="selected"><?=_('every day');?></option>
+							<option value="1-31/2"><?=_('every odd day');?></option>
+							<option value="*/2"><?=_('every even day');?></option>
+							<option value="*/3"><?=_('every');?> 3</option>
+							<option value="*/5"><?=_('every');?> 5</option>
+							<option value="*/10"><?=_('every');?> 10</option>
+							<option value="*/15"><?=_('every');?> 15</option>
+						</select>
+					</p>
+					<p><span class="first"><?=_('Hour');?>:</span>
+						<select name="h_hour" class="vst-list short">
+							<option value="0">00</option>
+							<option value="1">01</option>
+							<option value="2">02</option>
+							<option value="3">03</option>
+							<option value="4">04</option>
+							<option value="5">05</option>
+							<option value="6">06</option>
+							<option value="7">07</option>
+							<option value="8">08</option>
+							<option value="9">09</option>
+							<option value="10">10</option>
+							<option value="11">11</option>
+							<option value="12" selected="selected">12</option>
+							<option value="13">13</option>
+							<option value="14">14</option>
+							<option value="15">15</option>
+							<option value="16">16</option>
+							<option value="17">17</option>
+							<option value="18">18</option>
+							<option value="19">19</option>
+							<option value="20">20</option>
+							<option value="21">21</option>
+							<option value="22">22</option>
+							<option value="23">23</option>
+						</select>
+						<span><?=_('Minute');?>:</span>
+						<select name="h_min" class="vst-list  short">
+							<option value="0" selected="selected">00</option>
+							<option value="1">01</option>
+							<option value="2">02</option>
+							<option value="5">05</option>
+							<option value="10">10</option>
+							<option value="15">15</option>
+							<option value="20">20</option>
+							<option value="25">25</option>
+							<option value="30">30</option>
+							<option value="35">35</option>
+							<option value="40">40</option>
+							<option value="45">45</option>
+							<option value="50">50</option>
+							<option value="55">55</option>
+						</select>
+					</p>
+					<p class="step-top">
+						<input type="submit" value="<?=_('generate');?>" class="button">
+					</p>
+				</form>
+			</div>
 
-                        <p class="step-top">
-                            <input type="submit" value="<?=_('generate')?>" class="button">
-                        </p>
-                    </form>
-                </div>
+			<div id="tabs-4">
+				<form>
+					<input type="hidden" name="h_month" value="*" />
+					<input type="hidden" name="h_day" value="*" />
 
-                <div id="tabs-3">
-                    <form>
-                        <input type="hidden" name="h_month" value="*" />
-                        <input type="hidden" name="h_wday" value="*" />
-                        <p><span class="first"><?=_('Run Command')?>:</span>
-                            <select name="h_day" class="vst-list">
-                                <option value="*" selected="selected"><?=_('every day')?></option>
-                                <option value="1-31/2"><?=_('every odd day')?></option>
-                                <option value="*/2"><?=_('every even day')?></option>
-                                <option value="*/3"><?=_('every')?> 3</option>
-                                <option value="*/5"><?=_('every')?> 5</option>
-                                <option value="*/10"><?=_('every')?> 10</option>
-                                <option value="*/15"><?=_('every')?> 15</option>
-                            </select>
-                        </p>
+					<p><span class="first"><?=_('Run Command');?>:</span>
+						<select name="h_wday" class="vst-list">
+							<option value="*" selected="selected"><?=_('every day');?></option>
+							<option value="1,2,3,4,5"><?=_('weekdays (5 days)');?></option>
+							<option value="0,6"><?=_('weekend (2 days)');?></option>
+							<option value="1"><?=_('Monday');?></option>
+							<option value="2"><?=_('Tuesday');?></option>
+							<option value="3"><?=_('Wednesday');?></option>
+							<option value="4"><?=_('Thursday');?></option>
+							<option value="5"><?=_('Friday');?></option>
+							<option value="6"><?=_('Saturday');?></option>
+							<option value="0"><?=_('Sunday');?></option>
+						</select>
+					</p>
+					<p><span class="first"><?=_('Hour');?>:</span>
+						<select name="h_hour" class="vst-list short">
+							<option value="0">00</option>
+							<option value="1">01</option>
+							<option value="2">02</option>
+							<option value="3">03</option>
+							<option value="4">04</option>
+							<option value="5">05</option>
+							<option value="6">06</option>
+							<option value="7">07</option>
+							<option value="8">08</option>
+							<option value="9">09</option>
+							<option value="10">10</option>
+							<option value="11">11</option>
+							<option value="12" selected="selected">12</option>
+							<option value="13">13</option>
+							<option value="14">14</option>
+							<option value="15">15</option>
+							<option value="16">16</option>
+							<option value="17">17</option>
+							<option value="18">18</option>
+							<option value="19">19</option>
+							<option value="20">20</option>
+							<option value="21">21</option>
+							<option value="22">22</option>
+							<option value="23">23</option>
+						</select>
+						<span><?=_('Minute');?>:</span>
+						<select name="h_min" class="vst-list short">
+							<option value="0" selected="selected">00</option>
+							<option value="1">01</option>
+							<option value="2">02</option>
+							<option value="5">05</option>
+							<option value="10">10</option>
+							<option value="15">15</option>
+							<option value="20">20</option>
+							<option value="25">25</option>
+							<option value="30">30</option>
+							<option value="35">35</option>
+							<option value="40">40</option>
+							<option value="45">45</option>
+							<option value="50">50</option>
+							<option value="55">55</option>
+						</select>
+					</p>
+					<p class="step-top">
+						<input type="submit" value="<?=_('generate');?>" class="button">
+					</p>
+				</form>
+			</div>
 
-                        <p><span class="first"><?=_('Hour')?>:</span>
-                            <select name="h_hour" class="vst-list short">
-                                <option value="0">00</option>
-                                <option value="1">01</option>
-                                <option value="2">02</option>
-                                <option value="3">03</option>
-                                <option value="4">04</option>
-                                <option value="5">05</option>
-                                <option value="6">06</option>
-                                <option value="7">07</option>
-                                <option value="8">08</option>
-                                <option value="9">09</option>
-                                <option value="10">10</option>
-                                <option value="11">11</option>
-                                <option value="12"  selected="selected">12</option>
-                                <option value="13">13</option>
-                                <option value="14">14</option>
-                                <option value="15">15</option>
-                                <option value="16">16</option>
-                                <option value="17">17</option>
-                                <option value="18">18</option>
-                                <option value="19">19</option>
-                                <option value="20">20</option>
-                                <option value="21">21</option>
-                                <option value="22">22</option>
-                                <option value="23">23</option>
-                            </select>
+			<div id="tabs-5">
+				<form>
+					<input type="hidden" name="h_wday" value="*" />
+					<p><span class="first"><?=_('Run Command');?>:</span>
+						<select name="h_month" class="vst-list">
+							<option value="*" selected="selected"><?=_('every month');?></option>
+							<option value="1-11/2"><?=_('every odd month');?></option>
+							<option value="*/2"><?=_('every even month');?></option>
+							<option value="*/3"><?=_('every');?> 3</option>
+							<option value="*/6"><?=_('every');?> 6</option>
+							<option value="1"><?=_('Jan');?></option>
+							<option value="2"><?=_('Feb');?></option>
+							<option value="3"><?=_('Mar');?></option>
+							<option value="4"><?=_('Apr');?></option>
+							<option value="5"><?=_('May');?></option>
+							<option value="6"><?=_('Jun');?></option>
+							<option value="7"><?=_('Jul');?></option>
+							<option value="8"><?=_('Aug');?></option>
+							<option value="9"><?=_('Sep');?></option>
+							<option value="10"><?=_('Oct');?></option>
+							<option value="11"><?=_('Nov');?></option>
+							<option value="12"><?=_('Dec');?></option>
+						</select>
+					</p>
+					<p><span class="first"><?=_('Date');?>:</span>
+						<select name="h_day" class="vst-list short">
+							<option value="1" selected="selected">1</option>
+							<option value="2">2</option>
+							<option value="3">3</option>
+							<option value="4">4</option>
+							<option value="5">5</option>
+							<option value="6">6</option>
+							<option value="7">7</option>
+							<option value="8">8</option>
+							<option value="9">9</option>
+							<option value="10">10</option>
+							<option value="11">11</option>
+							<option value="12">12</option>
+							<option value="13">13</option>
+							<option value="14">14</option>
+							<option value="15">15</option>
+							<option value="16">16</option>
+							<option value="17">17</option>
+							<option value="18">18</option>
+							<option value="19">19</option>
+							<option value="20">20</option>
+							<option value="21">21</option>
+							<option value="22">22</option>
+							<option value="23">23</option>
+							<option value="24">24</option>
+							<option value="25">25</option>
+							<option value="26">26</option>
+							<option value="27">27</option>
+							<option value="28">28</option>
+							<option value="29">29</option>
+							<option value="30">30</option>
+							<option value="31">31</option>
+						</select>
+						<span><?=_('Hour');?>:</span>
+						<select name="h_hour" class="vst-list short">
+							<option value="0">00</option>
+							<option value="1">01</option>
+							<option value="2">02</option>
+							<option value="3">03</option>
+							<option value="4">04</option>
+							<option value="5">05</option>
+							<option value="6">06</option>
+							<option value="7">07</option>
+							<option value="8">08</option>
+							<option value="9">09</option>
+							<option value="10">10</option>
+							<option value="11">11</option>
+							<option value="12" selected="selected">12</option>
+							<option value="13">13</option>
+							<option value="14">14</option>
+							<option value="15">15</option>
+							<option value="16">16</option>
+							<option value="17">17</option>
+							<option value="18">18</option>
+							<option value="19">19</option>
+							<option value="20">20</option>
+							<option value="21">21</option>
+							<option value="22">22</option>
+							<option value="23">23</option>
+						</select>
+						<span><?=_('Minute');?>:</span>
+						<select name="h_min" class="vst-list short">
+							<option value="0" selected="selected">00</option>
+							<option value="1">01</option>
+							<option value="2">02</option>
+							<option value="5">05</option>
+							<option value="10">10</option>
+							<option value="15">15</option>
+							<option value="20">20</option>
+							<option value="25">25</option>
+							<option value="30">30</option>
+							<option value="35">35</option>
+							<option value="40">40</option>
+							<option value="45">45</option>
+							<option value="50">50</option>
+							<option value="55">55</option>
+						</select>
+					</p>
+					<p class="step-top">
+						<input type="submit" value="<?=_('generate');?>" class="button">
+					</p>
+				</form>
+			</div>
+		</div>
+	</div>
 
-                            <span><?=_('Minute')?>:</span>
-                            <select name="h_min" class="vst-list  short">
-                                <option value="0" selected="selected">00</option>
-                                <option value="1">01</option>
-                                <option value="2">02</option>
-                                <option value="5">05</option>
-                                <option value="10">10</option>
-                                <option value="15">15</option>
-                                <option value="20">20</option>
-                                <option value="25">25</option>
-                                <option value="30">30</option>
-                                <option value="35">35</option>
-                                <option value="40">40</option>
-                                <option value="45">45</option>
-                                <option value="50">50</option>
-                                <option value="55">55</option>
-                            </select>
-                        </p>
-                        <p class="step-top">
-                            <input type="submit" value="<?=_('generate')?>" class="button">
-                        </p>
-                    </form>
-                </div>
+	<form id="vstobjects" name="v_edit_cron" method="post" 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" width="600px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Editing Cron Job');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Command');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input long" name="v_cmd" value="<?=htmlentities(trim($v_cmd, "'"))?>">
+							</td>
+						</tr>
 
-                <div id="tabs-4">
-                    <form>
-                        <input type="hidden" name="h_month" value="*" />
-                        <input type="hidden" name="h_day" value="*" />
-
-                        <p><span class="first"><?=_('Run Command')?>:</span>
-                            <select name="h_wday" class="vst-list">
-                                <option value="*" selected="selected"><?=_('every day')?></option>
-                                <option value="1,2,3,4,5"><?=_('weekdays (5 days)')?></option>
-                                <option value="0,6"><?=_('weekend (2 days)')?></option>
-                                <option value="1"><?=_('Monday')?></option>
-                                <option value="2"><?=_('Tuesday')?></option>
-                                <option value="3"><?=_('Wednesday')?></option>
-                                <option value="4"><?=_('Thursday')?></option>
-                                <option value="5"><?=_('Friday')?></option>
-                                <option value="6"><?=_('Saturday')?></option>
-                                <option value="0"><?=_('Sunday')?></option>
-                            </select>
-                        </p>
-
-                        <p><span class="first"><?=_('Hour')?>:</span>
-                            <select name="h_hour" class="vst-list short">
-                                <option value="0">00</option>
-                                <option value="1">01</option>
-                                <option value="2">02</option>
-                                <option value="3">03</option>
-                                <option value="4">04</option>
-                                <option value="5">05</option>
-                                <option value="6">06</option>
-                                <option value="7">07</option>
-                                <option value="8">08</option>
-                                <option value="9">09</option>
-                                <option value="10">10</option>
-                                <option value="11">11</option>
-                                <option value="12"  selected="selected">12</option>
-                                <option value="13">13</option>
-                                <option value="14">14</option>
-                                <option value="15">15</option>
-                                <option value="16">16</option>
-                                <option value="17">17</option>
-                                <option value="18">18</option>
-                                <option value="19">19</option>
-                                <option value="20">20</option>
-                                <option value="21">21</option>
-                                <option value="22">22</option>
-                                <option value="23">23</option>
-                            </select>
-                            
-                            <span><?=_('Minute')?>:</span>
-                            <select name="h_min" class="vst-list short">
-                                <option value="0" selected="selected">00</option>
-                                <option value="1">01</option>
-                                <option value="2">02</option>
-                                <option value="5">05</option>
-                                <option value="10">10</option>
-                                <option value="15">15</option>
-                                <option value="20">20</option>
-                                <option value="25">25</option>
-                                <option value="30">30</option>
-                                <option value="35">35</option>
-                                <option value="40">40</option>
-                                <option value="45">45</option>
-                                <option value="50">50</option>
-                                <option value="55">55</option>
-                            </select>
-                        </p>
-
-                        <p class="step-top">
-                            <input type="submit" value="<?=_('generate')?>" class="button">
-                        </p>
-                    </form>
-                </div>
-
-                <div id="tabs-5">
-                    <form>
-                        <input type="hidden" name="h_wday" value="*" />
-                        <p><span class="first"><?=_('Run Command')?>:</span>
-                            <select name="h_month" class="vst-list">
-                                <option value="*" selected="selected"><?=_('every month')?></option>
-                                <option value="1-11/2"><?=_('every odd month')?></option>
-                                <option value="*/2"><?=_('every even month')?></option>
-                                <option value="*/3"><?=_('every')?> 3</option>
-                                <option value="*/6"><?=_('every')?> 6</option>
-                                <option value="1"><?=_('Jan')?></option>
-                                <option value="2"><?=_('Feb')?></option>
-                                <option value="3"><?=_('Mar')?></option>
-                                <option value="4"><?=_('Apr')?></option>
-                                <option value="5"><?=_('May')?></option>
-                                <option value="6"><?=_('Jun')?></option>
-                                <option value="7"><?=_('Jul')?></option>
-                                <option value="8"><?=_('Aug')?></option>
-                                <option value="9"><?=_('Sep')?></option>
-                                <option value="10"><?=_('Oct')?></option>
-                                <option value="11"><?=_('Nov')?></option>
-                                <option value="12"><?=_('Dec')?></option>
-                            </select>
-                        </p>
-
-                        <p><span class="first"><?=_('Date')?>:</span>
-                            <select name="h_day" class="vst-list short">
-                                <option value="1" selected="selected">1</option>
-                                <option value="2">2</option>
-                                <option value="3">3</option>
-                                <option value="4">4</option>
-                                <option value="5">5</option>
-                                <option value="6">6</option>
-                                <option value="7">7</option>
-                                <option value="8">8</option>
-                                <option value="9">9</option>
-                                <option value="10">10</option>
-                                <option value="11">11</option>
-                                <option value="12">12</option>
-                                <option value="13">13</option>
-                                <option value="14">14</option>
-                                <option value="15">15</option>
-                                <option value="16">16</option>
-                                <option value="17">17</option>
-                                <option value="18">18</option>
-                                <option value="19">19</option>
-                                <option value="20">20</option>
-                                <option value="21">21</option>
-                                <option value="22">22</option>
-                                <option value="23">23</option>
-                                <option value="24">24</option>
-                                <option value="25">25</option>
-                                <option value="26">26</option>
-                                <option value="27">27</option>
-                                <option value="28">28</option>
-                                <option value="29">29</option>
-                                <option value="30">30</option>
-                                <option value="31">31</option>
-                            </select>
-
-                            <span><?=_('Hour')?>:</span>
-                            <select name="h_hour" class="vst-list short">
-                                <option value="0">00</option>
-                                <option value="1">01</option>
-                                <option value="2">02</option>
-                                <option value="3">03</option>
-                                <option value="4">04</option>
-                                <option value="5">05</option>
-                                <option value="6">06</option>
-                                <option value="7">07</option>
-                                <option value="8">08</option>
-                                <option value="9">09</option>
-                                <option value="10">10</option>
-                                <option value="11">11</option>
-                                <option value="12"  selected="selected">12</option>
-                                <option value="13">13</option>
-                                <option value="14">14</option>
-                                <option value="15">15</option>
-                                <option value="16">16</option>
-                                <option value="17">17</option>
-                                <option value="18">18</option>
-                                <option value="19">19</option>
-                                <option value="20">20</option>
-                                <option value="21">21</option>
-                                <option value="22">22</option>
-                                <option value="23">23</option>
-                            </select>
-
-                            <span><?=_('Minute')?>:</span>
-                            <select name="h_min" class="vst-list short">
-                                <option value="0" selected="selected">00</option>
-                                <option value="1">01</option>
-                                <option value="2">02</option>
-                                <option value="5">05</option>
-                                <option value="10">10</option>
-                                <option value="15">15</option>
-                                <option value="20">20</option>
-                                <option value="25">25</option>
-                                <option value="30">30</option>
-                                <option value="35">35</option>
-                                <option value="40">40</option>
-                                <option value="45">45</option>
-                                <option value="50">50</option>
-                                <option value="55">55</option>
-                            </select>
-                        </p>
-                        <p class="step-top">
-                            <input type="submit" value="<?=_('generate')?>" class="button">
-                        </p>
-                    </form>
-                </div>
-            </div>
-        </div>
-
-        <form id="vstobjects" name="v_edit_cron" method="post"  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" width="600px">
-                            <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Editing Cron Job')?></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 input-label">
-                                    <?php print _('Command');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input long" name="v_cmd" value="<?=htmlentities(trim($v_cmd, "'"))?>">
-                                </td>
-                            </tr>
-
-                            <tr>
-                                <td class="vst-text step-top">
-                                    <?php print _('Minute');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input short" name="v_min" value="<?=htmlentities(trim($v_min, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Hour');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input short" name="v_hour" value="<?=htmlentities(trim($v_hour, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Day');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input short" name="v_day" value="<?=htmlentities(trim($v_day, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Month');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input short" name="v_month" value="<?=htmlentities(trim($v_month, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Day of week');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input short" name="v_wday" value="<?=htmlentities(trim($v_wday, "'"))?>">
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Minute');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input short" name="v_min" value="<?=htmlentities(trim($v_min, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Hour');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input short" name="v_hour" value="<?=htmlentities(trim($v_hour, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Day');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input short" name="v_day" value="<?=htmlentities(trim($v_day, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Month');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input short" name="v_month" value="<?=htmlentities(trim($v_month, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Day of week');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input short" name="v_wday" value="<?=htmlentities(trim($v_wday, "'"))?>">
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 140 - 143
web/templates/pages/edit_db.html

@@ -1,147 +1,144 @@
+<!-- Begin toolbar -->
 <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/db/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/db/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-            $back = $_SESSION['back'];
-            if (empty($back)) {
-                $back = "location.href='/list/db/'";
-            } else {
-                $back = "location.href='".$back."'";
-            }
-        ?>
-        <form id="vstobjects" name="v_edit_db" method="post"  class="<?=$v_status?>">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="save" value="save" />
+<div class="l-center animated fadeIn">
 
-            <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" width="600px">
-                             <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Editing Database')?></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 _('Database');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_database" value="<?=htmlentities(trim($v_database, "'"))?>" disabled>
-                                    <small class="hint"></small>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php
-                                        print _('Username');
-                                        echo "&nbsp;&nbsp;&nbsp;&nbsp;<em><small>(".sprintf(_('maximum characters length, including prefix'), 32).")</small></em>";
-                                    ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_dbuser" value="<?=htmlentities(trim($v_dbuser, "'"))?>">
-                                    <small class="hint"></small>
-                                </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 class="vst-text input-label">
-                                    <?php print _('Type');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_type" value="<?=htmlentities(trim($v_type, "'"))?>" disabled>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Host');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_host" value="<?=htmlentities(trim($v_host, "'"))?>" disabled>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Charset');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_charset" value="<?=htmlentities(trim($v_charset, "'"))?>" disabled>
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
-    <?php if ($v_type == 'pgsql'){
-        $user=strtolower($user);
-    }
-    ?>
-    <script>
-        GLOBAL.DB_USER_PREFIX = <?=json_encode($user.'_')?>;
-        GLOBAL.DB_DBNAME_PREFIX = <?=json_encode($user.'_')?>;
-    </script>
+	<form id="vstobjects" name="v_edit_db" method="post" 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" width="600px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Editing Database');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Database');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_database" value="<?=htmlentities(trim($v_database, "'"))?>" disabled>
+								<small class="hint"></small>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?php
+									print _('Username');
+									echo "&nbsp;&nbsp;&nbsp;&nbsp;<em><small>(".sprintf(_('maximum characters length, including prefix'), 32).")</small></em>";
+								?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_dbuser" value="<?=htmlentities(trim($v_dbuser, "'"))?>">
+								<small class="hint"></small>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Password');?> <a href="javascript:randomString();" title="<?=_('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">
+								<?=_('Your password must have at least');?>:
+								<ul>
+									<li><?=_('8 characters long');?></li>
+									<li><?=_('1 uppercase & 1 lowercase character');?></li>
+									<li><?=_('1 number');?></li>
+								</ul>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Type');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_type" value="<?=htmlentities(trim($v_type, "'"))?>" disabled>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Host');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_host" value="<?=htmlentities(trim($v_host, "'"))?>" disabled>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Charset');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_charset" value="<?=htmlentities(trim($v_charset, "'"))?>" disabled>
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>
+<?php if ($v_type == 'pgsql'){ $user=strtolower($user); } ?>
+<script>
+	GLOBAL.DB_USER_PREFIX = <?php json_encode($user.'_') ?>;
+	GLOBAL.DB_DBNAME_PREFIX = <?php json_encode($user.'_') ?>;
+</script>

+ 144 - 143
web/templates/pages/edit_dns.html

@@ -1,146 +1,147 @@
+<!-- Begin toolbar -->
 <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/dns/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/dns/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-            $back = $_SESSION['back'];
-            if (empty($back)) {
-                $back = "location.href='/list/dns/'";
-            } else {
-                $back = "location.href='".$back."'";
-            }
-        ?>
-        <form id="vstobjects" name="v_edit_dns" method="post"  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 DNS Domain')?></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 _('Domain');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                  <input type="text" size="20" class="vst-input" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>" disabled>
-                                  <input type="hidden" name="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" tabindex="-1" onchange="this.nextElementSibling.value=this.value">
-                                        <option value="">clear</option>
-                                        <?php
-                                            foreach ($v_ips as $ip => $value) {
-                                                $display_ip = empty($value['NAT']) ? $ip : "{$value['NAT']}";
-                                                $ip_selected = ((!empty($v_ip) && ($v_ip==$ip||$v_ip==$display_ip) ))? 'selected' : '';
-                                                echo "<option value='{$display_ip}' {$ip_selected}>" . htmlentities($display_ip) . "</option>\n";
-                                            }
-                                        ?>
-                                    </select>
-                                    <input type="text" size="20" class="vst-input vst-list-editor" name="v_ip" value="<?=htmlentities(trim($v_ip, "'"))?>">
-                                </td>
-                            </tr>
-                            <? if (($_SESSION['userContext'] === 'admin') || ($_SESSION['userContext'] === 'user') && ($_SESSION['POLICY_USER_EDIT_DNS_TEMPLATES'] === 'yes')) { ?>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Template') . "<span class='optional'>" . strtoupper($_SESSION['DNS_SYSTEM']) . "</span>";?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <select class="vst-list" name="v_template">
-                                        <?php
-                                            foreach ($templates as $key => $value) {
-                                                echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
-                                                $svalue = "'".$value."'";
-                                                if ((!empty($v_template)) && ( $value == $v_template ) || ($svalue == $v_template)){
-                                                    echo ' selected' ;
-                                                }
-                                                echo ">".htmlentities($value)."</option>\n";
-                                            }
-                                        ?>
-                                    </select>
-                                </td>
-                            </tr>
-                            <? } ?>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Expiration Date');?><span class="optional">(<?=_('YYYY-MM-DD');?>)</span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_exp" value="<?=htmlentities(trim($v_exp, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    SOA
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_soa" value="<?=htmlentities(trim($v_soa, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    TTL
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_ttl" value="<?=htmlentities(trim($v_ttl, "'"))?>">
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+<div class="l-center animated fadeIn">
+
+	<form id="vstobjects" name="v_edit_dns" method="post" 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 DNS Domain');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Domain');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>" disabled>
+								<input type="hidden" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('IP Address');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" tabindex="-1" onchange="this.nextElementSibling.value=this.value">
+									<option value="">clear</option>
+									<?php
+										foreach ($v_ips as $ip => $value) {
+											$display_ip = empty($value['NAT']) ? $ip : "{$value['NAT']}";
+											$ip_selected = ((!empty($v_ip) && ($v_ip==$ip||$v_ip==$display_ip) ))? 'selected' : '';
+											echo "<option value='{$display_ip}' {$ip_selected}>" . htmlentities($display_ip) . "</option>\n";
+										}
+									?>
+								</select>
+								<input type="text" size="20" class="vst-input vst-list-editor" name="v_ip" value="<?=htmlentities(trim($v_ip, "'"))?>">
+							</td>
+						</tr>
+						<?php if (($_SESSION['userContext'] === 'admin') || ($_SESSION['userContext'] === 'user') && ($_SESSION['POLICY_USER_EDIT_DNS_TEMPLATES'] === 'yes')) { ?>
+							<tr>
+								<td class="vst-text input-label">
+									<?=_('Template') . "<span class='optional'>" . strtoupper($_SESSION['DNS_SYSTEM']) . "</span>";?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<select class="vst-list" name="v_template">
+										<?php
+											foreach ($templates as $key => $value) {
+												echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
+												$svalue = "'".$value."'";
+												if ((!empty($v_template)) && ( $value == $v_template ) || ($svalue == $v_template)){
+													echo ' selected' ;
+												}
+												echo ">".htmlentities($value)."</option>\n";
+											}
+										?>
+									</select>
+								</td>
+							</tr>
+						<?php } ?>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Expiration Date');?><span class="optional">(<?=_('YYYY-MM-DD');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_exp" value="<?=htmlentities(trim($v_exp, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('SOA');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_soa" value="<?=htmlentities(trim($v_soa, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('TTL');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_ttl" value="<?=htmlentities(trim($v_ttl, "'"))?>">
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 155 - 154
web/templates/pages/edit_dns_rec.html

@@ -1,157 +1,158 @@
+<!-- Begin toolbar -->
 <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/dns/?domain=<?=htmlentities(trim($v_domain, "'"))?>&token=<?=$_SESSION['token']?>"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/dns/?domain=<?=htmlentities(trim($v_domain, "'"))?>&token=<?=$_SESSION['token']?>"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-            $back = $_SESSION['back'];
-            if (empty($back)) {
-                $back = "location.href='/list/dns/?domain=".htmlentities($_GET['domain'])."'";
-            } else {
-                $back = "location.href='".$back."'";
-            }
-        ?>
-        <form id="vstobjects" name="v_edit_dns_rec" method="post"  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 DNS Record')?></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">
-                                    <?=_('Domain');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>" disabled >
-                                    <input type="hidden" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Record');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                  <input type="text" size="20" class="vst-input" name="v_rec" value="<?=htmlentities(trim($v_rec, "'"))?>">
-                                  <input type="hidden" name="v_record_id" value="<?=htmlentities($v_record_id)?>">
-                                  <small class="hint"></small>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Type');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <select class="vst-list" name="v_type">
-                                        <option value="A" <?php if ($v_type == 'A') echo selected; ?>>A</option>
-                                        <option value="AAAA" <?php if ($v_type == 'AAAA') echo selected; ?>>AAAA</option>
-                                        <option value="CAA" <?php if ($v_type == 'CAA') echo selected; ?>>CAA</option>
-                                        <option value="CNAME" <?php if ($v_type == 'CNAME') echo selected; ?>>CNAME</option>
-                                        <option value="DNSKEY" <?php if ($v_type == 'DNSKEY') echo selected; ?>>DNSKEY</option>
-                                        <option value="IPSECKEY" <?php if ($v_type == 'IPSECKEY') echo selected; ?>>IPSECKEY</option>
-                                        <option value="KEY" <?php if ($v_type == 'KEY') echo selected; ?>>KEY</option>
-                                        <option value="MX" <?php if ($v_type == 'MX') echo selected; ?>>MX</option>
-                                        <option value="NS" <?php if ($v_type == 'NS') echo selected; ?>>NS</option>
-                                        <option value="PTR" <?php if ($v_type == 'PTR') echo selected; ?>>PTR</option>
-                                        <option value="SPF" <?php if ($v_type == 'SPF') echo selected; ?>>SPF</option>
-                                        <option value="SRV" <?php if ($v_type == 'SRV') echo selected; ?>>SRV</option>
-                                        <option value="TLSA" <?php if ($v_type == 'TLSA') echo selected; ?>>TLSA</option>
-                                        <option value="TXT" <?php if ($v_type == 'TXT') echo selected; ?>>TXT</option>
-                                    </select>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('IP or Value');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <select class="vst-list" tabindex="-1" onchange="this.nextElementSibling.value=this.value">
-                                        <option value="">clear</option>
-                                        <?php
-                                            foreach ($v_ips as $ip => $value) {
-                                                $display_ip = empty($value['NAT']) ? $ip : "{$value['NAT']}";
-                                                echo "<option value='{$display_ip}'>" . htmlentities($display_ip) . "</option>\n";
-                                            }
-                                        ?>
-                                    </select>
-                                    <input type="text" size="20" class="vst-input vst-list-editor" name="v_val" value="<?=htmlentities(trim($v_val, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Priority');?> <span class="optional">(<?=_('optional');?>)</span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_priority" value="<?=htmlentities(trim($v_priority, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('TTL');?> <span class="optional">(<?=_('optional');?>)</span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_ttl" value="<?=htmlentities(trim($v_ttl, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="hidden" size="20" class="vst-input" name="v_record_id" value="<?=htmlentities(trim($v_record_id, "'"))?>">
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
-    <script>
-        GLOBAL.DNS_REC_PREFIX = <?=json_encode($_GET['domain'])?>;
-    </script>
+<div class="l-center animated fadeIn">
+
+	<form id="vstobjects" name="v_edit_dns_rec" method="post" 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 DNS Record');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Domain');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>" disabled>
+								<input type="hidden" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Record');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_rec" value="<?=htmlentities(trim($v_rec, "'"))?>">
+								<input type="hidden" name="v_record_id" value="<?=htmlentities($v_record_id)?>">
+								<small class="hint"></small>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Type');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" name="v_type">
+									<option value="A" <?php if ($v_type == 'A') echo selected; ?>>A</option>
+									<option value="AAAA" <?php if ($v_type == 'AAAA') echo selected; ?>>AAAA</option>
+									<option value="CAA" <?php if ($v_type == 'CAA') echo selected; ?>>CAA</option>
+									<option value="CNAME" <?php if ($v_type == 'CNAME') echo selected; ?>>CNAME</option>
+									<option value="DNSKEY" <?php if ($v_type == 'DNSKEY') echo selected; ?>>DNSKEY</option>
+									<option value="IPSECKEY" <?php if ($v_type == 'IPSECKEY') echo selected; ?>>IPSECKEY</option>
+									<option value="KEY" <?php if ($v_type == 'KEY') echo selected; ?>>KEY</option>
+									<option value="MX" <?php if ($v_type == 'MX') echo selected; ?>>MX</option>
+									<option value="NS" <?php if ($v_type == 'NS') echo selected; ?>>NS</option>
+									<option value="PTR" <?php if ($v_type == 'PTR') echo selected; ?>>PTR</option>
+									<option value="SPF" <?php if ($v_type == 'SPF') echo selected; ?>>SPF</option>
+									<option value="SRV" <?php if ($v_type == 'SRV') echo selected; ?>>SRV</option>
+									<option value="TLSA" <?php if ($v_type == 'TLSA') echo selected; ?>>TLSA</option>
+									<option value="TXT" <?php if ($v_type == 'TXT') echo selected; ?>>TXT</option>
+								</select>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('IP or Value');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" tabindex="-1" onchange="this.nextElementSibling.value=this.value">
+									<option value="">clear</option>
+									<?php
+										foreach ($v_ips as $ip => $value) {
+											$display_ip = empty($value['NAT']) ? $ip : "{$value['NAT']}";
+											echo "<option value='{$display_ip}'>" . htmlentities($display_ip) . "</option>\n";
+										}
+									?>
+								</select>
+								<input type="text" size="20" class="vst-input vst-list-editor" name="v_val" value="<?=htmlentities(trim($v_val, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Priority');?> <span class="optional">(<?=_('optional');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_priority" value="<?=htmlentities(trim($v_priority, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('TTL');?> <span class="optional">(<?=_('optional');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_ttl" value="<?=htmlentities(trim($v_ttl, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="hidden" size="20" class="vst-input" name="v_record_id" value="<?=htmlentities(trim($v_record_id, "'"))?>">
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>
+<script>
+	GLOBAL.DNS_REC_PREFIX = <?php json_encode($_GET['domain']) ?>;
+</script>

+ 139 - 139
web/templates/pages/edit_firewall.html

@@ -1,147 +1,147 @@
+<!-- Begin toolbar -->
 <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/firewall/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/firewall/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-            $back = $_SESSION['back'];
-            if (empty($back)) {
-                $back = "location.href='/list/firewall/'";
-            } else {
-                $back = "location.href='".$back."'";
-            }
-        ?>
-        <form id="vstobjects" name="v_edit_firewall" method="post"  class="<?=$v_status?>">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="save" value="save" />
+<div class="l-center animated fadeIn">
 
-            <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" width="600px">
-                            <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Editing Firewall Rule')?></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 _('Action'); ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <select class="vst-list" name="v_action">
-                                        <option value="DROP" <?php if ((!empty($v_action)) && ( $v_action == "DROP" )) echo 'selected'?>><?=_('DROP')?></option>
-                                        <option value="ACCEPT" <?php if ((!empty($v_action)) && ( $v_action == "ACCEPT" )) echo 'selected'?>><?=_('ACCEPT')?></option>
-                                    </select>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Protocol') ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <select class="vst-list" name="v_protocol">
-                                        <option value="TCP" <?php if ((!empty($v_protocol)) && ( $v_protocol == "TCP" )) echo 'selected'?>><?=_('TCP')?></option>
-                                        <option value="UDP" <?php if ((!empty($v_protocol)) && ( $v_protocol == "UDP" )) echo 'selected'?>><?=_('UDP')?></option>
-                                        <option value="ICMP" <?php if ((!empty($v_protocol)) && ( $v_protocol == "ICMP" )) echo 'selected'?>><?=_('ICMP')?></option>
-                                    </select>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Port');?> <span class="optional">(<?php print _('Ranges and Lists are acceptable');?>)</span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_port" value="<?=htmlentities(trim($v_port, "'"))?>" placeholder="<?php print _('All ports: 0, Range: 80-82, List: 80,443,8080,8443');?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('IP address / IPset');?> <span class="optional">(<?php print _('CIDR format is supported');?>)</span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <select class="vst-list" tabindex="-1" id="quickips_list" onchange="this.nextElementSibling.value=this.value">
-                                        <option value="">&nbsp;</option>
-                                    </select>
-                                    <input type="text" size="20" class="vst-input vst-list-editor" name="v_ip" value="<?=htmlentities(trim($v_ip, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Comment');?> <span class="optional">(<?php print _('optional');?>)</span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_comment" maxlength="255" value="<?=htmlentities(trim($v_comment, "'"))?>">
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2">
-                        </table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+	<form id="vstobjects" name="v_edit_firewall" method="post" class="<?=$v_status?>">
+		<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+		<input type="hidden" name="save" value="save" />
 
-    <script>
-        var iplists = JSON.parse('<?=$ipset_lists_json?>');
-        iplists.sort(function (a, b) {
-            return a.name > b.name;
-        });
+		<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" width="600px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Editing Firewall Rule');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Action'); ?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" name="v_action">
+									<option value="DROP" <?php if ((!empty($v_action)) && ( $v_action == "DROP" )) echo 'selected'?>><?=_('DROP');?></option>
+									<option value="ACCEPT" <?php if ((!empty($v_action)) && ( $v_action == "ACCEPT" )) echo 'selected'?>><?=_('ACCEPT');?></option>
+								</select>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Protocol') ?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" name="v_protocol">
+									<option value="TCP" <?php if ((!empty($v_protocol)) && ( $v_protocol == "TCP" )) echo 'selected'?>><?=_('TCP');?></option>
+									<option value="UDP" <?php if ((!empty($v_protocol)) && ( $v_protocol == "UDP" )) echo 'selected'?>><?=_('UDP');?></option>
+									<option value="ICMP" <?php if ((!empty($v_protocol)) && ( $v_protocol == "ICMP" )) echo 'selected'?>><?=_('ICMP');?></option>
+								</select>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Port');?> <span class="optional">(<?=_('Ranges and Lists are acceptable');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_port" value="<?=htmlentities(trim($v_port, "'"))?>" placeholder="<?=_('All ports: 0, Range: 80-82, List: 80,443,8080,8443');?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('IP address / IPset');?> <span class="optional">(<?=_('CIDR format is supported');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" tabindex="-1" id="quickips_list" onchange="this.nextElementSibling.value=this.value">
+									<option value="">&nbsp;</option>
+								</select>
+								<input type="text" size="20" class="vst-input vst-list-editor" name="v_ip" value="<?=htmlentities(trim($v_ip, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Comment');?> <span class="optional">(<?=_('optional');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_comment" maxlength="255" value="<?=htmlentities(trim($v_comment, "'"))?>">
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2">
+					</table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>
 
-        $(function() {
-            var targetelement = document.getElementById('quickips_list');
+<script>
+	var iplists = JSON.parse('<?=$ipset_lists_json?>');
+	iplists.sort(function (a, b) {
+		return a.name > b.name;
+	});
 
-            var newEl = document.createElement("option");
-            newEl.text= "IP address lists:";
-            newEl.disabled = true;
-            targetelement.appendChild(newEl);
+	$(function () {
+		var targetelement = document.getElementById('quickips_list');
 
-            iplists.forEach(iplist => {
-                var newEl = document.createElement("option");
-                newEl.text = iplist.name;
-                newEl.value = "ipset:" + iplist.name;
-                targetelement.appendChild(newEl);
-            });
-        });
-    </script>
+		var newEl = document.createElement("option");
+		newEl.text = "IP address lists:";
+		newEl.disabled = true;
+		targetelement.appendChild(newEl);
+
+		iplists.forEach(iplist => {
+			var newEl = document.createElement("option");
+			newEl.text = iplist.name;
+			newEl.value = "ipset:" + iplist.name;
+			targetelement.appendChild(newEl);
+		});
+	});
+</script>

+ 149 - 149
web/templates/pages/edit_ip.html

@@ -1,153 +1,153 @@
+<!-- Begin toolbar -->
 <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/ip/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/ip/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-            $back = $_SESSION['back'];
-            if (empty($back)) {
-                $back = "location.href='/list/ip/'";
-            } else {
-                $back = "location.href='".$back."'";
-            }
-        ?>
-        <form id="vstobjects" name="v_edit_ip" method="post"  class="<?=$v_status?>">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="save" value="save" />
+<div class="l-center animated fadeIn">
 
-            <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" width="600px">
-                            <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Editing IP Address')?></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 _('IP address'); ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_ip" value="<?=htmlentities(trim($v_ip, "'"))?>" disabled>
-                                    <input type="hidden" name="v_ip" value="<?=htmlentities(trim($v_ip, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Netmask');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_netmask" value="<?=htmlentities(trim($v_netmask, "'"))?>" disabled>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Interface'); ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_netmask" value="<?=htmlentities(trim($v_interace, "'"))?>" disabled>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <label><input type="checkbox" size="20" class="vst-checkbox" name="v_shared" <?php if (empty($v_dedicated)) echo "checked=yes" ?> onclick="javascript:elementHideShow('usrtable');"><?=_('Shared')?></label>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <table style="display:<?php if (empty($v_dedicated)) { echo 'none';} else {echo 'block';}?> ;" id="usrtable">
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Assigned user');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="step-bottom">
-                                                <select class="vst-list" name="v_owner">
-                                                    <?php
-                                                        foreach ($users as $key => $value) {
-                                                            echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
-                                                            if ((!empty($v_owner)) && ( $value == $v_owner )) echo ' selected';
-                                                            echo ">".htmlentities($value)."</option>\n";
-                                                        }
-                                                    ?>
-                                                </select>
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Assigned domain');?> <span class="optional">(<?php print _('optional');?>)</span>
-                                </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 _('NAT IP association');?> <span class="optional">(<?php print _('optional');?>)</span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_nat" value="<?=htmlentities(trim($v_nat, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr style="<?php if ($_SESSION['MAIL_SYSTEM'] != 'exim4') { echo 'display: none;';}?>">
-                                <td class="vst-text input-label">
-                                    <?php print _('HELO/SMTP Banner');?> <span class="optional">(<?php print _('optional');?>)</span>
-                                </td>
-                            </tr>
-                            <tr style="<?php if ($_SESSION['MAIL_SYSTEM'] != 'exim4') { echo 'display: none;';}?>">
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_helo" value="<?=htmlentities(trim($v_helo, "'"))?>">
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+	<form id="vstobjects" name="v_edit_ip" method="post" 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" width="600px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Editing IP Address');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('IP address'); ?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_ip" value="<?=htmlentities(trim($v_ip, "'"))?>" disabled>
+								<input type="hidden" name="v_ip" value="<?=htmlentities(trim($v_ip, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Netmask');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_netmask" value="<?=htmlentities(trim($v_netmask, "'"))?>" disabled>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Interface'); ?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_netmask" value="<?=htmlentities(trim($v_interace, "'"))?>" disabled>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<label><input type="checkbox" size="20" class="vst-checkbox" name="v_shared" <?php if (empty($v_dedicated)) echo "checked=yes" ?> onclick="javascript:elementHideShow('usrtable');"><?=_('Shared');?></label>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<table style="display:<?php if (empty($v_dedicated)) { echo 'none';} else {echo 'block';}?> ;" id="usrtable">
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('Assigned user');?>
+										</td>
+									</tr>
+									<tr>
+										<td class="step-bottom">
+											<select class="vst-list" name="v_owner">
+												<?php
+													foreach ($users as $key => $value) {
+														echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
+														if ((!empty($v_owner)) && ( $value == $v_owner )) echo ' selected';
+														echo ">".htmlentities($value)."</option>\n";
+													}
+												?>
+											</select>
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Assigned domain');?> <span class="optional">(<?=_('optional');?>)</span>
+							</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">
+								<?=_('NAT IP association');?> <span class="optional">(<?=_('optional');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_nat" value="<?=htmlentities(trim($v_nat, "'"))?>">
+							</td>
+						</tr>
+						<tr style="<?php if ($_SESSION['MAIL_SYSTEM'] != 'exim4') { echo 'display: none;';}?>">
+							<td class="vst-text input-label">
+								<?=_('HELO/SMTP Banner');?> <span class="optional">(<?=_('optional');?>)</span>
+							</td>
+						</tr>
+						<tr style="<?php if ($_SESSION['MAIL_SYSTEM'] != 'exim4') { echo 'display: none;';}?>">
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_helo" value="<?=htmlentities(trim($v_helo, "'"))?>">
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 307 - 308
web/templates/pages/edit_mail.html

@@ -1,311 +1,310 @@
+<!-- Begin toolbar -->
 <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/mail/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/mail/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-            $back = $_SESSION['back'];
-            if (empty($back)) {
-                $back = "location.href='/list/mail/'";
-            } else {
-                $back = "location.href='".$back."'";
-            }
-        ?>
-        <form id="vstobjects" name="v_edit_mail" method="post" 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 Mail Domain')?></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 _('Domain');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                  <input type="text" size="20" class="vst-input" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>" disabled>
-                                  <input type="hidden" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>">
-                                </td>
-                            </tr>
-                            <?php if($_SESSION['WEBMAIL_SYSTEM']){?>                            
-                                <tr>
-                                    <td class="vst-text step-top">
-                                        <?php print _('Webmail Client');?>
-                                    </td>
-                                </tr>
-                                <tr>
-                                    <td>
-                                        <select class="vst-list" name="v_webmail" tabindex="6" >
-                                            <?php foreach ($webmail_clients as $client){
-                                            echo "\t\t\t\t<option value=\"".htmlentities($client)."\"";
-                                            if ((!empty($v_webmail)) && ( $v_webmail == $client )) {
-                                                echo ' selected' ;
-                                            }
-                                            echo ">".htmlentities(ucfirst($client))."</option>\n";
-                                            }
-                                            ?>
-                                            <option value="" <?php if (empty($v_webmail)){ echo "selected";}?>><?php print _('Disabled');?></option>
-                                        </select>
-                                    </td>
-                                </tr>
-                            <?php } ?>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Catchall email');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_catchall" value="<?=htmlentities(trim($v_catchall, "'"))?>" > <?php /*'*/ ?>
-                                </td>
-                            </tr>
-                            <? if (!empty($_SESSION['ANTISPAM_SYSTEM'])) {?>
-                            <tr>
-                                <td class="vst-text input-label step-top">
-                                    <label><input type="checkbox" size="20" class="vst-checkbox" name="v_antispam" <?php if ($v_antispam == 'yes') echo "checked=yes"; ?>><?php print _('AntiSpam Support');?></label>
-                                </td>
-                            </tr>
-                            <? } ?>
-                            <? if (!empty($_SESSION['ANTIVIRUS_SYSTEM'])) {?>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <label><input type="checkbox" size="20" class="vst-checkbox" name="v_antivirus" <?php if ($v_antivirus == 'yes') echo "checked=yes"; ?>><?php print _('AntiVirus Support');?></label>
-                                </td>
-                            </tr>
-                            <? } ?>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <label><input type="checkbox" size="20" class="vst-checkbox" name="v_dkim" <?php if ($v_dkim == 'yes') echo "checked=yes"; ?>><?php print _('DKIM Support');?></label>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl" <?php if ($v_ssl == 'yes') echo "checked=yes" ?> onclick="javascript:elementHideShow('ssltable');"><?php print _('SSL Support');?></label>
-                                </td>
-                            </tr>
-                            <tr id="ssltable" style="display:<?php if ($v_ssl == 'no' ) { echo 'none';} else {echo 'block';}?> ;" class="step-left">
-                                <td>
-                                    <table>
-                                        <tr>
-                                            <td class="input-label vst-text">
-                                                <label><input type="checkbox" size="20" class="vst-checkbox" name="v_letsencrypt" onclick="javascript:elementHideShow('ssl-details');App.Actions.MAIL.toggle_letsencrypt(this);" <?php if($v_letsencrypt == 'yes' || $v_letencrypt == 'on') echo "checked=yes" ?>"><?php print _('Lets Encrypt Support');?></label>
-                                            </td>
-                                        </tr>
-                                        <tr id="le-warning" class="step-top">
-                                            <td>
-                                                <span class="alert alert-info alert-with-icon">
-                                                    <i class="fas fa-exclamation"></i>
-                                                    <?=_("To enable Let's Encrypt SSL, ensure that DNS records exist for mail.$v_domain and $v_webmail_alias!")?><br/>
-                                                </span>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <table id="ssl-details" style="<? if ($v_letsencrypt == 'yes' || $v_letsencrypt == 'on') { echo 'display: none;'; } ?>">
-                                                    <tr>
-                                                        <td class="vst-text input-label step-top">
-                                                            <?php print _('SSL Certificate');?>
-                                                            <span id="generate-csr"> / <a class="generate" target="_blank" href="/generate/ssl/?domain=<?=$v_domain?>"><?=_('Generate CSR')?></a></span>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <textarea size="20" class="vst-textinput short console" <?php if ($v_letsencrypt == 'yes') echo 'disabled' ?> name="v_ssl_crt"><?=htmlentities(trim($v_ssl_crt, "'"))?></textarea>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="vst-text input-label">
-                                                            <?php print _('SSL Key');?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <textarea size="20" class="vst-textinput short console" <?php if ($v_letsencrypt == 'yes') echo 'disabled' ?> name="v_ssl_key"><?=htmlentities(trim($v_ssl_key, "'"))?></textarea>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="vst-text input-label">
-                                                            <?php print _('SSL Certificate Authority / Intermediate');?> <span class="optional">(<?php print _('optional');?>)</span>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <textarea size="20" class="vst-textinput short console" <?php if ($v_letsencrypt == 'yes') echo 'disabled' ?> name="v_ssl_ca"><?=htmlentities(trim($v_ssl_ca, "'"))?></textarea>
-                                                        </td>
-                                                    </tr>
-                                                </table>
-                                                
-                                                <?
-                                                if ($v_ssl != 'no' ) { ?>
-                                                    <tr>
-                                                        <td>
-                                                            <table class="additional-info">
-                                                                <tr>
-                                                                    <td>
-                                                                        <b><?=_('SUBJECT')?>:</b>
-                                                                    </td>
-                                                                    <td class="details">
-                                                                        <?=$v_ssl_subject?>
-                                                                    </td>
-                                                                </tr>
-                                                                <? if($v_ssl_aliases){?>
-                                                                    <tr>
-                                                                        <td>
-                                                                            <b><?=_('Aliases')?>:</b>
-                                                                        </td>
-                                                                        <td class="details">
-                                                                            <?=$v_ssl_aliases?>
-                                                                        </td>
-                                                                    </tr>
-                                                                <? } ?>
-                                                                <tr>
-                                                                    <td>
-                                                                        <b><?=_('NOT_BEFORE')?>:</b>
-                                                                    </td>
-                                                                    <td class="details">
-                                                                        <?=$v_ssl_not_before?>
-                                                                    </td>
-                                                                </tr>
-                                                                <tr>
-                                                                    <td>
-                                                                        <b><?=_('NOT_AFTER')?>:</b>
-                                                                    </td>
-                                                                    <td class="details">
-                                                                        <?=$v_ssl_not_after?>
-                                                                    </td>
-                                                                </tr>
-                                                                <tr>
-                                                                    <td>
-                                                                        <b><?=_('SIGNATURE')?>:</b>
-                                                                    </td>
-                                                                    <td class="details">
-                                                                        <?=$v_ssl_signature?>
-                                                                    </td>
-                                                                </tr>
-                                                                <tr>
-                                                                    <td>
-                                                                        <b><?=_('PUB_KEY')?>:</b>
-                                                                    </td>
-                                                                    <td class="details">
-                                                                        <?=$v_ssl_pub_key?>
-                                                                    </td>
-                                                                </tr>
-                                                                <tr>
-                                                                    <td>
-                                                                        <b><?=_('ISSUER')?>:</b>
-                                                                    </td>
-                                                                    <td class="details">
-                                                                        <?=$v_ssl_issuer?>
-                                                                    </td>
-                                                                </tr>
-                                                            </table>
-                                                        </td>
-                                                    </tr>
-                                                <? } // if ssl is enabled ?>
-                                            </td>
-                                        </tr>
-				                    </table>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <label>
-                                        <input type="checkbox" size="20" class="vst-checkbox" name="v_smtp_relay" <?php if ($v_smtp_relay == 'true') echo "checked=yes"; ?> onclick="javascript:elementHideShow('smtp_relay_table');"><?php print _('SMTP Relay');?>
-                                    </label>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="step-left">
-                                    <table style="display:<?php if ($v_smtp_relay == 'true') {echo 'block';} else {echo 'none';} ?>;" id="smtp_relay_table">
-                                        <tr>
-                                            <td class="input-label vst-text">
-                                                <?php print _('Host');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_smtp_relay_host" value="<?=htmlentities(trim($v_smtp_relay_host, "'"))?>">
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="input-label vst-text">
-                                                <?php print _('Port');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_smtp_relay_port" value="<?=htmlentities(trim($v_smtp_relay_port, "'"))?>">
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="input-label vst-text">
-                                                <?php print _('Username');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_smtp_relay_user" value="<?=htmlentities(trim($v_smtp_relay_user, "'"))?>">
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="input-label vst-text">
-                                                <?php print _('Password');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_smtp_relay_pass">
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <br>
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+<div class="l-center animated fadeIn">
+
+	<form id="vstobjects" name="v_edit_mail" method="post" 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 Mail Domain');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Domain');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>" disabled>
+								<input type="hidden" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>">
+							</td>
+						</tr>
+						<?php if($_SESSION['WEBMAIL_SYSTEM']){?>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Webmail Client');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" name="v_webmail" tabindex="6">
+									<?php foreach ($webmail_clients as $client){
+										echo "\t\t\t\t<option value=\"".htmlentities($client)."\"";
+										if ((!empty($v_webmail)) && ( $v_webmail == $client )) {
+											echo ' selected' ;
+										}
+										echo ">".htmlentities(ucfirst($client))."</option>\n";
+										}
+									?>
+									<option value="" <?php if (empty($v_webmail)){ echo "selected";}?>><?=_('Disabled');?></option>
+								</select>
+							</td>
+						</tr>
+						<?php } ?>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Catchall email');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_catchall" value="<?=htmlentities(trim($v_catchall, "'"))?>"> <?php /*'*/ ?>
+							</td>
+						</tr>
+						<?php if (!empty($_SESSION['ANTISPAM_SYSTEM'])) {?>
+							<tr>
+								<td class="vst-text input-label step-top">
+									<label><input type="checkbox" size="20" class="vst-checkbox" name="v_antispam" <?php if ($v_antispam == 'yes') echo "checked=yes"; ?>><?=_('AntiSpam Support');?></label>
+								</td>
+							</tr>
+						<?php } ?>
+						<?php if (!empty($_SESSION['ANTIVIRUS_SYSTEM'])) {?>
+							<tr>
+								<td class="vst-text input-label">
+									<label><input type="checkbox" size="20" class="vst-checkbox" name="v_antivirus" <?php if ($v_antivirus == 'yes') echo "checked=yes"; ?>><?=_('AntiVirus Support');?></label>
+								</td>
+							</tr>
+						<?php } ?>
+						<tr>
+							<td class="vst-text input-label">
+								<label><input type="checkbox" size="20" class="vst-checkbox" name="v_dkim" <?php if ($v_dkim == 'yes') echo "checked=yes"; ?>><?=_('DKIM Support');?></label>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl" <?php if ($v_ssl == 'yes') echo "checked=yes" ?> onclick="javascript:elementHideShow('ssltable');"><?=_('SSL Support');?></label>
+							</td>
+						</tr>
+						<tr id="ssltable" style="display:<?php if ($v_ssl == 'no' ) { echo 'none';} else {echo 'block';}?> ;" class="step-left">
+							<td>
+								<table>
+									<tr>
+										<td class="input-label vst-text">
+											<label><input type="checkbox" size="20" class="vst-checkbox" name="v_letsencrypt" onclick="javascript:elementHideShow('ssl-details');App.Actions.MAIL.toggle_letsencrypt(this);" <?php if($v_letsencrypt == 'yes' || $v_letencrypt == 'on') echo "checked=yes" ?>"><?=_('Lets Encrypt Support');?></label>
+										</td>
+									</tr>
+									<tr id="le-warning" class="step-top">
+										<td>
+											<span class="alert alert-info alert-with-icon">
+												<i class="fas fa-exclamation"></i>
+												<?=_("To enable Let's Encrypt SSL, ensure that DNS records exist for mail.$v_domain and $v_webmail_alias!")?><br />
+											</span>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<table id="ssl-details" style="<?php if ($v_letsencrypt == 'yes' || $v_letsencrypt == 'on') { echo 'display: none;'; } ?>">
+												<tr>
+													<td class="vst-text input-label step-top">
+														<?=_('SSL Certificate');?>
+														<span id="generate-csr"> / <a class="generate" target="_blank" href="/generate/ssl/?domain=<?=$v_domain?>"><?=_('Generate CSR');?></a></span>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<textarea size="20" class="vst-textinput short console" <?php if ($v_letsencrypt == 'yes') echo 'disabled' ?> name="v_ssl_crt"><?=htmlentities(trim($v_ssl_crt, "'"))?></textarea>
+													</td>
+												</tr>
+												<tr>
+													<td class="vst-text input-label">
+														<?=_('SSL Key');?>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<textarea size="20" class="vst-textinput short console" <?php if ($v_letsencrypt == 'yes') echo 'disabled' ?> name="v_ssl_key"><?=htmlentities(trim($v_ssl_key, "'"))?></textarea>
+													</td>
+												</tr>
+												<tr>
+													<td class="vst-text input-label">
+														<?=_('SSL Certificate Authority / Intermediate');?> <span class="optional">(<?=_('optional');?>)</span>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<textarea size="20" class="vst-textinput short console" <?php if ($v_letsencrypt == 'yes') echo 'disabled' ?> name="v_ssl_ca"><?=htmlentities(trim($v_ssl_ca, "'"))?></textarea>
+													</td>
+												</tr>
+											</table>
+											<?php if ($v_ssl != 'no' ) { ?>
+												<tr>
+													<td>
+														<table class="additional-info">
+															<tr>
+																<td>
+																	<b><?=_('SUBJECT');?>:</b>
+																</td>
+																<td class="details">
+																	<?=$v_ssl_subject?>
+																</td>
+															</tr>
+															<?php if ($v_ssl_aliases){?>
+																<tr>
+																	<td>
+																		<b><?=_('Aliases');?>:</b>
+																	</td>
+																	<td class="details">
+																		<?=$v_ssl_aliases?>
+																	</td>
+																</tr>
+															<?php } ?>
+															<tr>
+																<td>
+																	<b><?=_('NOT_BEFORE');?>:</b>
+																</td>
+																<td class="details">
+																	<?=$v_ssl_not_before?>
+																</td>
+															</tr>
+															<tr>
+																<td>
+																	<b><?=_('NOT_AFTER');?>:</b>
+																</td>
+																<td class="details">
+																	<?=$v_ssl_not_after?>
+																</td>
+															</tr>
+															<tr>
+																<td>
+																	<b><?=_('SIGNATURE');?>:</b>
+																</td>
+																<td class="details">
+																	<?=$v_ssl_signature?>
+																</td>
+															</tr>
+															<tr>
+																<td>
+																	<b><?=_('PUB_KEY');?>:</b>
+																</td>
+																<td class="details">
+																	<?=$v_ssl_pub_key?>
+																</td>
+															</tr>
+															<tr>
+																<td>
+																	<b><?=_('ISSUER');?>:</b>
+																</td>
+																<td class="details">
+																	<?=$v_ssl_issuer?>
+																</td>
+															</tr>
+														</table>
+													</td>
+												</tr>
+											<? } // if ssl is enabled ?>
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<label>
+									<input type="checkbox" size="20" class="vst-checkbox" name="v_smtp_relay" <?php if ($v_smtp_relay == 'true') echo "checked=yes"; ?> onclick="javascript:elementHideShow('smtp_relay_table');"><?=_('SMTP Relay');?>
+								</label>
+							</td>
+						</tr>
+						<tr>
+							<td class="step-left">
+								<table style="display:<?php if ($v_smtp_relay == 'true') {echo 'block';} else {echo 'none';} ?>;" id="smtp_relay_table">
+									<tr>
+										<td class="input-label vst-text">
+											<?=_('Host');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_smtp_relay_host" value="<?=htmlentities(trim($v_smtp_relay_host, "'"))?>">
+										</td>
+									</tr>
+									<tr>
+										<td class="input-label vst-text">
+											<?=_('Port');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_smtp_relay_port" value="<?=htmlentities(trim($v_smtp_relay_port, "'"))?>">
+										</td>
+									</tr>
+									<tr>
+										<td class="input-label vst-text">
+											<?=_('Username');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_smtp_relay_user" value="<?=htmlentities(trim($v_smtp_relay_user, "'"))?>">
+										</td>
+									</tr>
+									<tr>
+										<td class="input-label vst-text">
+											<?=_('Password');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_smtp_relay_pass">
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<br>
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 257 - 235
web/templates/pages/edit_mail_acc.html

@@ -1,239 +1,261 @@
+<!-- Begin toolbar -->
 <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/mail/?domain=<?=htmlentities(trim($v_domain, "'"))?>&token=<?=$_SESSION['token']?>"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/mail/?domain=<?=htmlentities(trim($v_domain, "'"))?>&token=<?=$_SESSION['token']?>"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-      <?php
-        $back = $_SESSION['back'];
-        if (empty($back)) {
-            $back = "location.href='/list/mail/?domain=".$_GET['domain']."'";
-        } else {
-            $back = "location.href='".$back."'";
-        }
-      ?>
-      <form id="vstobjects" name="v_edit_mail_acc" method="post"  class="<?=$v_status?>">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="save" value="save" />
+<div class="l-center animated fadeIn">
 
-            <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" width="420px">
-                        <tr>
-                            <td class="step-top">
-                                <span class="page-title"><?=_('Editing Mail Account')?></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 input-label">
-                                <?php print _('Account');?>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td>
-                                <input type="text" size="20" class="vst-input" name="v_email" value="<?=htmlentities($_GET['account'])."@".htmlentities($_GET['domain'])?>" disabled >
-                                <input type="hidden" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>">
-                                <input type="hidden" name="v_account" value="<?=htmlentities(trim($v_account, "'"))?>">
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="vst-text input-type 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 class="vst-text input-label">
-                                <?php print _('Send login credentials to email address') ?>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td>
-                                <input type="text"  class="vst-input" name="v_send_email" value="<?=htmlentities(trim($v_send_email, "'"))?>">
-                                <input type="hidden" name="v_credentials" id="v_credentials">
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="vst-text input-type input-label">
-                                <?php print _('Quota');?> <span class="optional">(<?=_('in megabytes')?>)</span>
-                            </td>
-                        </tr>
-                        <tr>
-                          <td>
-                                <input type="text" size="20" class="vst-input" name="v_quota" value="<? if (!empty($v_quota)) {echo htmlentities(trim($v_quota, "'"));} else { echo "0"; } ?>">
-                                <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-quota"></i>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="vst-text input-type input-label">
-                                <?php print _('Aliases');?> <span class="optional">(<?=_('use local-part')?>)</span>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td>
-                                <textarea size="20" class="vst-textinput short" name="v_aliases"><?=htmlentities(trim($v_aliases, "'"))?></textarea>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="vst-text input-label">
-                                <label><input type="checkbox" size="20" class="vst-checkbox" onclick="javascript:elementHideShow('v-fwd-opt');" id="v_blackhole" name="v_blackhole" <?php if ($v_blackhole == 'yes') echo "checked=yes" ?>><?php print _('Discard all mail');?></label>
-                            </td>
-                        </tr>
-                        <tr <?php if ($v_blackhole == 'yes') echo 'style="display:none"'; ?> id="id_fwd_for">
-                            <td class="vst-text input-type input-label">
-                                <label><input type="checkbox" size="20" class="vst-checkbox" id="v_fwd_for" name="v_fwd_only" <?php if ($v_fwd_only == 'yes') echo "checked=yes" ?>><?php print _('Do not store forwarded mail');?></label>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="vst-text input-type input-label">
-                                <label><input type="checkbox" size="20" class="vst-checkbox" name="v_autoreply" <?php if ($v_autoreply == 'yes') echo "checked=yes" ?> onclick="javascript:elementHideShow('autoreplytable');"><?php print _('Autoreply');?></label>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td>
-                                <table style="display:<?php if ($v_autoreply == 'yes') { echo 'block';} else {echo 'none';}?> ;" id="autoreplytable">
-                                    <tr>
-                                        <td class="vst-text" style="padding: 12px 0 0 0;">
-                                            <?php print _('Message');?>
-                                        </td>
-                                    </tr>
-                                    <tr>
-                                        <td>
-                                            <textarea size="20" class="vst-textinput short" name="v_autoreply_message"><?=htmlentities(trim($v_autoreply_message, "'"))?></textarea>
-                                        </td>
-                                    </tr>
-                                </table>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td>
-                                <table id="v-fwd-opt">
-                                    <tr>
-                                        <td class="vst-text input-type input-label">
-                                            <?php print _('Forward to');?> <span class="optional">(<?=_('one or more email addresses')?>)</span>
-                                        </td>
-                                    </tr>
-                                    <tr>
-                                        <td>
-                                            <textarea size="20" class="vst-textinput short" name="v_fwd"  id="v_fwd" <?php if($v_blackhole == 'yes') echo "disabled";?>><?=htmlentities(trim($v_fwd, "'"))?></textarea>
-                                        </td>
-                                    </tr>
-                                </table>
-                            </td>
-                        </tr>
-                    </table>
-                    <table class="data-col2">
-                    </table>
-                </td>
-                <td class="mail-infoblock-td">
-                    <div class="mail-infoblock">
-                        <table>
-                        <?php $uname_arr=posix_uname(); $hostname=$uname_arr['nodename']; ?>
-                            <tr>
-                                <td colspan="2">
-                                    <select id="mail_configuration" class="vst-list flat">
-                                        <option v_type="hostname" domain="<?=$v_domain?>"><?=_('Use domain hostname')?></option>
-                                        <option v_type="starttls"><?=_('Use STARTTLS')?></option>
-                                        <option v_type="ssl"><?=_('Use SSL / TLS')?></option>
-                                        <option v_type="no_encryption" domain="<?=htmlentities(trim($v_domain, "'"))?>" no_encryption="<?=_('No encryption')?>"><?=_('No encryption')?></option>
-                                    </select>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td><?=_('Username')?>:</td>
-                                <td><div><span id="v_account">example</span>@<?=htmlentities(trim($v_domain, "'"))?></div></td>
-                            </tr>
-                            <tr>
-                                <td><?=_('Password')?>:</td>
-                                <td><div id="v_password">******</div></td>
-                            </tr>
-                            <tr>
-                                <td><?=_('IMAP hostname')?>:</td>
-                                <td><div id="td_imap_hostname">mail.<?=$v_domain?></div></td>
-                            </tr>
-                            <tr>
-                                <td><?=_('IMAP port')?>:</td>
-                                <td><div id="td_imap_port">143</div></td>
-                            </tr>
-                            <tr>
-                                <td><?=_('IMAP security')?>:</td>
-                                <td><div id="td_imap_encryption"><?=_('STARTTLS')?></div></td>
-                            </tr>
-                            <tr>
-                                <td><?=_('IMAP auth method')?>:</td>
-                                <td><div><?=_('Normal password')?></div></td>
-                            </tr>
-                            <tr>
-                                <td><?=_('SMTP hostname')?>:</td>
-                                <td><div id="td_smtp_hostname">mail.<?=$v_domain?></div></td>
-                            </tr>
-                            <tr>
-                                <td><?=_('SMTP port')?>:</td>
-                                <td><div id="td_smtp_port">587</div></td>
-                            </tr>
-                            <tr>
-                                <td><?=_('SMTP security')?>:</td>
-                                <td><div id="td_smtp_encryption"><?=_('STARTTLS')?></div></td>
-                            </tr>
-                            <tr>
-                                <td><?=_('SMTP auth method')?>:</td>
-                                <td><div><?=_('Normal password')?></div></td>
-                            </tr>
-                            <?php if($_SESSION['WEBMAIL_SYSTEM']){?>
-                            <tr>
-                                <td><?=_('Webmail URL')?>:</td>
-                                <td><div><a class="vst" href="http://<?=$v_webmail_alias?>" target="_blank">http://<?=$v_webmail_alias?> <i></i></a></div></td>
-                            </tr>
-                            <?php } ?>
-                        </table>
-                    </div>
-                </td>
-            </tr>
-        </table>
-    </form>
-</div>
+	<form id="vstobjects" name="v_edit_mail_acc" method="post" 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" width="420px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Editing Mail Account');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top input-label">
+								<?=_('Account');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_email" value="<?=htmlentities($_GET['account'])."@".htmlentities($_GET['domain'])?>" disabled>
+								<input type="hidden" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>">
+								<input type="hidden" name="v_account" value="<?=htmlentities(trim($v_account, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-type input-label">
+								<?=_('Password');?> <a href="javascript:randomString();" title="<?=_('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">
+								<?=_('Your password must have at least');?>:
+								<ul>
+									<li><?=_('8 characters long');?></li>
+									<li><?=_('1 uppercase & 1 lowercase character');?></li>
+									<li><?=_('1 number');?></li>
+								</ul>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Send login credentials to email address') ?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" class="vst-input" name="v_send_email" value="<?=htmlentities(trim($v_send_email, "'"))?>">
+								<input type="hidden" name="v_credentials" id="v_credentials">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-type input-label">
+								<?=_('Quota');?> <span class="optional">(<?=_('in megabytes');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_quota" value="<?php if (!empty($v_quota)) {echo htmlentities(trim($v_quota, "'"));} else { echo "0"; } ?>">
+								<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-quota"></i>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-type input-label">
+								<?=_('Aliases');?> <span class="optional">(<?=_('use local-part');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea size="20" class="vst-textinput short" name="v_aliases"><?=htmlentities(trim($v_aliases, "'"))?></textarea>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<label><input type="checkbox" size="20" class="vst-checkbox" onclick="javascript:elementHideShow(' v-fwd-opt');" id="v_blackhole" name="v_blackhole" <?php if ($v_blackhole == 'yes') echo "checked=yes" ?>><?=_('Discard all mail');?></label>
+							</td>
+						</tr>
+						<tr <?php if ($v_blackhole == 'yes') echo 'style="display:none"'; ?> id="id_fwd_for">
+							<td class="vst-text input-type input-label">
+								<label><input type="checkbox" size="20" class="vst-checkbox" id="v_fwd_for" name="v_fwd_only" <?php if ($v_fwd_only == 'yes') echo "checked=yes" ?>><?=_('Do not store forwarded mail');?></label>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-type input-label">
+								<label><input type="checkbox" size="20" class="vst-checkbox" name="v_autoreply" <?php if ($v_autoreply == 'yes') echo "checked=yes" ?> onclick="javascript:elementHideShow('autoreplytable');"><?=_('Autoreply');?></label>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<table style="display:<?php if ($v_autoreply == 'yes') { echo 'block';} else {echo 'none';}?> ;" id="autoreplytable">
+									<tr>
+										<td class="vst-text" style="padding: 12px 0 0 0;">
+											<?=_('Message');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<textarea size="20" class="vst-textinput short" name="v_autoreply_message"><?=htmlentities(trim($v_autoreply_message, "'"))?></textarea>
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<table id="v-fwd-opt">
+									<tr>
+										<td class="vst-text input-type input-label">
+											<?=_('Forward to');?> <span class="optional">(<?=_('one or more email addresses');?>)</span>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<textarea size="20" class="vst-textinput short" name="v_fwd" id="v_fwd" <?php if($v_blackhole == 'yes') echo "disabled";?>><?=htmlentities(trim($v_fwd, "'"))?></textarea>
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2">
+					</table>
+				</td>
+				<td class="mail-infoblock-td">
+					<div class="mail-infoblock">
+						<table>
+							<?php $uname_arr=posix_uname(); $hostname=$uname_arr['nodename']; ?>
+							<tr>
+								<td colspan="2">
+									<select id="mail_configuration" class="vst-list flat">
+										<option v_type="hostname" domain="<?=$v_domain?>"><?=_('Use domain hostname');?></option>
+										<option v_type="starttls"><?=_('Use STARTTLS');?></option>
+										<option v_type="ssl"><?=_('Use SSL / TLS');?></option>
+										<option v_type="no_encryption" domain="<?=htmlentities(trim($v_domain, "'"))?>" no_encryption="<?=_('No encryption');?>"><?=_('No encryption');?></option>
+									</select>
+								</td>
+							</tr>
+							<tr>
+								<td><?=_('Username');?>:</td>
+								<td>
+									<div><span id="v_account">example</span>@<?=htmlentities(trim($v_domain, "'"))?></div>
+								</td>
+							</tr>
+							<tr>
+								<td><?=_('Password');?>:</td>
+								<td>
+									<div id="v_password">******</div>
+								</td>
+							</tr>
+							<tr>
+								<td><?=_('IMAP hostname');?>:</td>
+								<td>
+									<div id="td_imap_hostname">mail.<?=$v_domain?></div>
+								</td>
+							</tr>
+							<tr>
+								<td><?=_('IMAP port');?>:</td>
+								<td>
+									<div id="td_imap_port">143</div>
+								</td>
+							</tr>
+							<tr>
+								<td><?=_('IMAP security');?>:</td>
+								<td>
+									<div id="td_imap_encryption"><?=_('STARTTLS');?></div>
+								</td>
+							</tr>
+							<tr>
+								<td><?=_('IMAP auth method');?>:</td>
+								<td>
+									<div><?=_('Normal password');?></div>
+								</td>
+							</tr>
+							<tr>
+								<td><?=_('SMTP hostname');?>:</td>
+								<td>
+									<div id="td_smtp_hostname">mail.<?=$v_domain?></div>
+								</td>
+							</tr>
+							<tr>
+								<td><?=_('SMTP port');?>:</td>
+								<td>
+									<div id="td_smtp_port">587</div>
+								</td>
+							</tr>
+							<tr>
+								<td><?=_('SMTP security');?>:</td>
+								<td>
+									<div id="td_smtp_encryption"><?=_('STARTTLS');?></div>
+								</td>
+							</tr>
+							<tr>
+								<td><?=_('SMTP auth method');?>:</td>
+								<td>
+									<div><?=_('Normal password');?></div>
+								</td>
+							</tr>
+							<?php if ($_SESSION['WEBMAIL_SYSTEM']) { ?>
+								<tr>
+									<td><?=_('Webmail URL');?>:</td>
+									<td>
+										<div><a class="vst" href="http://<?=$v_webmail_alias?>" target="_blank">http://<?=$v_webmail_alias?> <i></i></a></div>
+									</td>
+								</tr>
+							<?php } ?>
+						</table>
+					</div>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 456 - 450
web/templates/pages/edit_package.html

@@ -1,453 +1,459 @@
+<!-- Begin toolbar -->
 <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/package/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/package/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
- 
-    <div class="l-center animated fadeIn">
-        <?php
-            $back = "location.href='/list/package/'";
-        ?>
-        <form id="vstobjects" name="v_edit_package" method="post"  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 Package')?></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 _('Package Name');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_package" value="<?=htmlentities(trim($v_package, "'"))?>" disabled>
-                                    <input type="hidden" name="v_package" value="<?=htmlentities(trim($v_package, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Quota');?> <span class="optional">(<?=_('in megabytes')?>)</span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_disk_quota" value="<?=htmlentities(trim($v_disk_quota, "'"))?>">
-                                    <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-disk-quota"></i>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Bandwidth');?> <span class="optional">(<?=_('in megabytes')?>)</span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_bandwidth" value="<?=htmlentities(trim($v_bandwidth, "'"))?>">
-                                    <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-bandwidth"></i>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Backups');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_backups" value="<?=htmlentities(trim($v_backups, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="section-title" onclick="javascript:elementHideShow('web-options')">
-                                    <?=_('Web');?>
-                                </td>
-                                <td class="section-hide-button">
-                                    <a href="javascript:elementHideShow('web-options');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <table id="web-options" style="display: none;">
-                                        <tr>
-                                            <td class="vst-text input-label step-top">
-                                                <?php print _('Web Domains');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_web_domains" value="<?=htmlentities(trim($v_web_domains, "'"))?>">
-                                                <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-web-domains"></i>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Web Aliases');?> <span class="optional">(<?=_('per domain')?>)</span>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_web_aliases" value="<?=htmlentities(trim($v_web_aliases, "'"))?>">
-                                                <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-web-aliases"></i>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Web Template')  . " <span class='optional'> " .strtoupper($_SESSION['WEB_SYSTEM']) . "</span>";?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_web_template">
-                                                    <?php
-                                                        foreach ($web_templates as $key => $value) {
-                                                            echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
-                                                            if ((!empty($v_web_template)) && ( $value == $v_web_template)){
-                                                                echo ' selected' ;
-                                                            }
-                                                            if ((!empty($v_web_template)) && ( $value == $_POST['v_web_template'])){
-                                                                echo ' selected' ;
-                                                            }
-                                                            echo ">".htmlentities($value)."</option>\n";
-                                                        }
-                                                    ?>
-                                                </select>
-                                            </td>
-                                        </tr>
-                                        <?php if (!empty($_SESSION['WEB_BACKEND'])) { echo ""; ?>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Backend Template')  . "<span class='optional'>" .strtoupper($_SESSION['WEB_BACKEND']) . "</span>";?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_backend_template">
-                                                    <?php
-                                                        foreach ($backend_templates as $key => $value) {
-                                                            echo "\t\t\t\t<option value=\"".$value."\"";
-                                                            if ((!empty($v_backend_template)) && ( $value == $v_backend_template)){
-                                                                echo ' selected' ;
-                                                            }
-                                                            if ((!empty($v_backend_template)) && ( $value == $_POST['v_backend_template'])){
-                                                                echo ' selected' ;
-                                                            }
-                                                            echo ">".htmlentities($value)."</option>\n";
-                                                        }
-                                                    ?>
-                                                </select>
-                                            </td>
-                                        </tr>
-                                        <?php echo ""; }?>
-                                        <?php if (!empty($_SESSION['PROXY_SYSTEM'])) { echo ""; ?>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Proxy Template')  . "<span class='optional'>" .strtoupper($_SESSION['PROXY_SYSTEM']) . "</span>";?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_proxy_template">
-                                                    <?php
-                                                        foreach ($proxy_templates as $key => $value) {
-                                                            echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
-                                                            if ((!empty($v_proxy_template)) && ( $value == $v_proxy_template)){
-                                                                echo ' selected' ;
-                                                            }
-                                                            if ((!empty($v_proxy_template)) && ( $value == $_POST['v_proxy_template'])){
-                                                                echo ' selected' ;
-                                                            }
-                                                            echo ">".htmlentities($value)."</option>\n";
-                                                        }
-                                                    ?>
-                                                </select>
-                                            </td>
-                                        </tr>
-                                        <?php echo ""; }?>
-                                    </table>
-                                </td>
-                            </tr>
+<div class="l-separator"></div>
 
-                            <tr>
-                                <td class="section-title" onclick="javascript:elementHideShow('dns-options')">
-                                    <?=_('DNS');?>
-                                </td>
-                                <td class="section-hide-button">
-                                    <a href="javascript:elementHideShow('dns-options');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <table id="dns-options" style="display: none;">
-                                        <tr>
-                                            <td class="vst-text input-label step-top">
-                                                <?php print _('DNS Template')  . "<span class='optional'>" .strtoupper($_SESSION['DNS_SYSTEM']) . "</span>";?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_dns_template">
-                                                    <?php
-                                                        foreach ($dns_templates as $key => $value) {
-                                                            echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
-                                                            if ((!empty($v_dns_template)) && ( $value == $v_dns_template)){
-                                                                echo ' selected' ;
-                                                            }
-                                                            if ((!empty($v_dns_template)) && ( $value == $_POST['v_dns_template'])){
-                                                                echo ' selected' ;
-                                                            }
-                                                            echo ">".htmlentities($value)."</option>\n";
-                                                        }
-                                                    ?>
-                                                </select>
-                                            </td>
-                                        </tr>
-            
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('DNS domains');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_dns_domains" value="<?=htmlentities(trim($v_dns_domains, "'"))?>">
-                                                <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-dns-domain"></i>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('DNS records');?> <span class="optional">(<?=_('per domain')?>)</span>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_dns_records" value="<?=htmlentities(trim($v_dns_records, "'"))?>">
-                                                <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-dns-records"></i>
-                                            </td>
-                                        </tr>
-                                        
-                                    <?php if ((isset($_SESSION['DNS_SYSTEM'])) && (!empty($_SESSION['DNS_SYSTEM']))) {?>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></span>
-                                                </td>
-                                            </tr>';
-                                            ?>
-            
-                                            <tr class="add-ns" <? if($v_ns8) echo 'style="display:none;"'; ?> >
-                                                <td class="step-top-small">
-                                                  <span class="add-ns-button additional-control add"><?=_('Add one more Name Server')?></span>
-                                                </td>
-                                            </tr>
-                                        <?php } ?>
-                                    </table>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="section-title" onclick="javascript:elementHideShow('mail-options')">
-                                    <?=_('Mail');?>
-                                </td>
-                                <td class="section-hide-button">
-                                    <a href="javascript:elementHideShow('mail-options');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <table id="mail-options" style="display: none;">
-                                        <tr>
-                                            <td class="vst-text input-label step-top">
-                                                <?php print _('Mail Domains');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_mail_domains" value="<?=htmlentities(trim($v_mail_domains, "'"))?>">
-                                                <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-mail-domains"></i>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Mail Accounts');?> <span class="optional">(<?=_('per domain')?>)</span>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_mail_accounts" value="<?=htmlentities(trim($v_mail_accounts, "'"))?>">
-                                                <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-mail-accounts"></i>
-                                            <td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="section-title" onclick="javascript:elementHideShow('database-options')">
-                                    <?=_('Databases');?>
-                                </td>
-                                <td class="section-hide-button">
-                                    <a href="javascript:elementHideShow('database-options');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <table id="database-options" style="display: none;">
-                                        <tr>
-                                            <td class="vst-text input-label step-top">
-                                                <?php print _('Databases');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_databases" value="<?=htmlentities(trim($v_databases, "'"))?>">
-                                                <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-databases"></i>
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="section-title" onclick="javascript:elementHideShow('system-options')">
-                                    <?=_('System');?>
-                                </td>
-                                <td class="section-hide-button">
-                                    <a href="javascript:elementHideShow('system-options');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <table id="system-options" style="display: none;">
-                                        <tr>
-                                            <td class="vst-text input-label step-top">
-                                                <?php print _('Cron Jobs');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_cron_jobs" value="<?=htmlentities(trim($v_cron_jobs, "'"))?>">
-                                                <i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited')?>" id="unlim-cron-jobs"></i>
-                                            </td>
-                                        </tr>
-                                        <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)."\"";
-                                                            if ((!empty($v_shell)) && ( $value == $v_shell)){
-                                                                echo ' selected' ;
-                                                            }
-                                                            if ((!empty($v_shell)) && ( $value == $_POST['v_shell'])){
-                                                                echo ' selected' ;
-                                                            }
-                                                            echo ">".htmlentities($value)."</option>\n";
-                                                        }
-                                                    ?>
-                                                </select>
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+<div class="l-center animated fadeIn">
+
+	<form id="vstobjects" name="v_edit_package" method="post" 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 Package');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Package Name');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_package" value="<?=htmlentities(trim($v_package, "'"))?>" disabled>
+								<input type="hidden" name="v_package" value="<?=htmlentities(trim($v_package, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Quota');?> <span class="optional">(<?=_('in megabytes');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_disk_quota" value="<?=htmlentities(trim($v_disk_quota, "'"))?>">
+								<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-disk-quota"></i>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Bandwidth');?> <span class="optional">(<?=_('in megabytes');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_bandwidth" value="<?=htmlentities(trim($v_bandwidth, "'"))?>">
+								<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-bandwidth"></i>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Backups');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_backups" value="<?=htmlentities(trim($v_backups, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="section-title" onclick="javascript:elementHideShow('web-options')">
+								<?=_('Web');?>
+							</td>
+							<td class="section-hide-button">
+								<a href="javascript:elementHideShow('web-options');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<table id="web-options" style="display: none;">
+									<tr>
+										<td class="vst-text input-label step-top">
+											<?=_('Web Domains');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_web_domains" value="<?=htmlentities(trim($v_web_domains, "'"))?>">
+											<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-web-domains"></i>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('Web Aliases');?> <span class="optional">(<?=_('per domain');?>)</span>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_web_aliases" value="<?=htmlentities(trim($v_web_aliases, "'"))?>">
+											<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-web-aliases"></i>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('Web Template')  . " <span class='optional'> " .strtoupper($_SESSION['WEB_SYSTEM']) . "</span>";?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<select class="vst-list" name="v_web_template">
+												<?php
+													foreach ($web_templates as $key => $value) {
+														echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
+														if ((!empty($v_web_template)) && ( $value == $v_web_template)){
+															echo ' selected' ;
+														}
+														if ((!empty($v_web_template)) && ( $value == $_POST['v_web_template'])){
+															echo ' selected' ;
+														}
+														echo ">".htmlentities($value)."</option>\n";
+													}
+												?>
+											</select>
+										</td>
+									</tr>
+									<?php if (!empty($_SESSION['WEB_BACKEND'])) { echo ""; ?>
+										<tr>
+											<td class="vst-text input-label">
+												<?=_('Backend Template')  . "<span class='optional'>" .strtoupper($_SESSION['WEB_BACKEND']) . "</span>";?>
+											</td>
+										</tr>
+										<tr>
+											<td>
+												<select class="vst-list" name="v_backend_template">
+													<?php
+															foreach ($backend_templates as $key => $value) {
+																echo "\t\t\t\t<option value=\"".$value."\"";
+																if ((!empty($v_backend_template)) && ( $value == $v_backend_template)){
+																	echo ' selected' ;
+																}
+																if ((!empty($v_backend_template)) && ( $value == $_POST['v_backend_template'])){
+																	echo ' selected' ;
+																}
+																echo ">".htmlentities($value)."</option>\n";
+															}
+														?>
+												</select>
+											</td>
+										</tr>
+									<?=""; }?>
+									<?php if (!empty($_SESSION['PROXY_SYSTEM'])) { echo ""; ?>
+										<tr>
+											<td class="vst-text input-label">
+												<?=_('Proxy Template')  . "<span class='optional'>" .strtoupper($_SESSION['PROXY_SYSTEM']) . "</span>";?>
+											</td>
+										</tr>
+										<tr>
+											<td>
+												<select class="vst-list" name="v_proxy_template">
+													<?php
+															foreach ($proxy_templates as $key => $value) {
+																echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
+																if ((!empty($v_proxy_template)) && ( $value == $v_proxy_template)){
+																	echo ' selected' ;
+																}
+																if ((!empty($v_proxy_template)) && ( $value == $_POST['v_proxy_template'])){
+																	echo ' selected' ;
+																}
+																echo ">".htmlentities($value)."</option>\n";
+															}
+														?>
+												</select>
+											</td>
+										</tr>
+									<?=""; }?>
+								</table>
+							</td>
+						</tr>
+
+						<tr>
+							<td class="section-title" onclick="javascript:elementHideShow('dns-options')">
+								<?=_('DNS');?>
+							</td>
+							<td class="section-hide-button">
+								<a href="javascript:elementHideShow('dns-options');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<table id="dns-options" style="display: none;">
+									<tr>
+										<td class="vst-text input-label step-top">
+											<?=_('DNS Template')  . "<span class='optional'>" .strtoupper($_SESSION['DNS_SYSTEM']) . "</span>";?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<select class="vst-list" name="v_dns_template">
+												<?php
+													foreach ($dns_templates as $key => $value) {
+														echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
+														if ((!empty($v_dns_template)) && ( $value == $v_dns_template)){
+															echo ' selected' ;
+														}
+														if ((!empty($v_dns_template)) && ( $value == $_POST['v_dns_template'])){
+															echo ' selected' ;
+														}
+														echo ">".htmlentities($value)."</option>\n";
+													}
+												?>
+											</select>
+										</td>
+									</tr>
+
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('DNS domains');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_dns_domains" value="<?=htmlentities(trim($v_dns_domains, "'"))?>">
+											<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-dns-domain"></i>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('DNS records');?> <span class="optional">(<?=_('per domain');?>)</span>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_dns_records" value="<?=htmlentities(trim($v_dns_records, "'"))?>">
+											<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-dns-records"></i>
+										</td>
+									</tr>
+									<?php if ((isset($_SESSION['DNS_SYSTEM'])) && (!empty($_SESSION['DNS_SYSTEM']))) {?>
+										<tr>
+											<td class="vst-text input-label">
+												<?=_('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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></span>
+											</td>
+										</tr>
+										<?php 
+											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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></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"><i class="fas fa-trash status-icon dim red"></i></span>
+													</td>
+												</tr>';
+											}
+										?>
+										<tr class="add-ns" <?php if ($v_ns8) echo 'style="display:none;"' ; ?> >
+											<td class="step-top-small">
+												<span class="add-ns-button additional-control add"><?=_('Add one more Name Server');?></span>
+											</td>
+										</tr>
+									<?php } ?>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td class="section-title" onclick="javascript:elementHideShow('mail-options')">
+								<?=_('Mail');?>
+							</td>
+							<td class="section-hide-button">
+								<a href="javascript:elementHideShow('mail-options');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<table id="mail-options" style="display: none;">
+									<tr>
+										<td class="vst-text input-label step-top">
+											<?=_('Mail Domains');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_mail_domains" value="<?=htmlentities(trim($v_mail_domains, "'"))?>">
+											<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-mail-domains"></i>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('Mail Accounts');?> <span class="optional">(<?=_('per domain');?>)</span>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_mail_accounts" value="<?=htmlentities(trim($v_mail_accounts, "'"))?>">
+											<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-mail-accounts"></i>
+										<td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td class="section-title" onclick="javascript:elementHideShow('database-options')">
+								<?=_('Databases');?>
+							</td>
+							<td class="section-hide-button">
+								<a href="javascript:elementHideShow('database-options');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<table id="database-options" style="display: none;">
+									<tr>
+										<td class="vst-text input-label step-top">
+											<?=_('Databases');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_databases" value="<?=htmlentities(trim($v_databases, "'"))?>">
+											<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-databases"></i>
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td class="section-title" onclick="javascript:elementHideShow('system-options')">
+								<?=_('System');?>
+							</td>
+							<td class="section-hide-button">
+								<a href="javascript:elementHideShow('system-options');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<table id="system-options" style="display: none;">
+									<tr>
+										<td class="vst-text input-label step-top">
+											<?=_('Cron Jobs');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_cron_jobs" value="<?=htmlentities(trim($v_cron_jobs, "'"))?>">
+											<i class="unlim-trigger fas fa-infinity" title="<?=_('Unlimited');?>" id="unlim-cron-jobs"></i>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('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)."\"";
+														if ((!empty($v_shell)) && ( $value == $v_shell)){
+															echo ' selected' ;
+														}
+														if ((!empty($v_shell)) && ( $value == $_POST['v_shell'])){
+															echo ' selected' ;
+														}
+														echo ">".htmlentities($value)."</option>\n";
+													}
+												?>
+											</select>
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 1292 - 1278
web/templates/pages/edit_server.html

@@ -1,1294 +1,1308 @@
+<!-- Begin toolbar -->
 <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/server/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/server/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-            $back = $_SESSION['back'];
-            if (empty($back)) {
-                $back = "location.href='/list/server/'";
-            } else {
-                $back = "location.href='".$back."'";
-            }
-        ?>
+<div class="l-center animated fadeIn">
 
-        <form id="vstobjects" name="v_configure_server" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="save" value="save" />
+	<form id="vstobjects" name="v_configure_server" method="post">
+		<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+		<input type="hidden" name="save" value="save" />
 
-            <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" width="600px">
-                          <tr>
-                            <td class="step-top">
-                                <span class="page-title"><?=_('Configuring Server')?></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>";
-                                        }
-                                    }
-                                ?>
-                                <br /><br />
-                            </td>
-                        </tr>
-                          <tr>
-                                <td class="vst-text input-label step-top advanced-options">
-                                    <a href="javascript:elementHideShow('basic');" class="vst-text">
-                                        <i class="fas fa-cog"></i><b><?php print _('Basic options');?> <img src="/images/arrow.png"></b>
-                                    </a>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label step-left">
-                                     <table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="basic">
-                                            <td class="vst-text step-top">
-                                                <?php print _('Hostname') ?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_hostname" value="<?=htmlentities(trim($v_hostname, "'"))?>">
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Time Zone');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_timezone">
-                                                    <?php
-                                                        foreach ($v_timezones as $key => $value) {
-                                                            echo "\t\t\t\t<option value=\"".$key."\"";
-                                                            if ((!empty($v_timezone)) && ( $key == $v_timezone)){
-                                                                echo ' selected' ;
-                                                            }
-                                                            if ((!empty($v_timezone)) && ( $key == $_POST['v_timezone'])){
-                                                                echo ' selected' ;
-                                                            }
-                                                            echo ">".$value."</option>\n";
-                                                        }
-                                                    ?>
-                                                </select>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Theme') ?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_theme">
-                                                    <?php
-                                                        foreach ($theme as $key => $value) {
-                                                            echo "\t\t\t\t<option value=\"".$value."\"";
-                                                            if ((!empty($_SESSION['THEME'])) && ( $value == $_SESSION['THEME'])){
-                                                                echo ' selected' ;
-                                                            }
-                                                            if ((!empty($_SESSION['THEME'])) && ( $value == $_POST['v_theme'])){
-                                                                echo ' selected' ;
-                                                            }
-                                                            echo ">".$value."</option>\n";
-                                                        }
-                                                    ?>
-                                                </select>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <label><input type="checkbox" size="20" class="vst-checkbox" name="v_policy_user_change_theme" <?php if ((isset($_SESSION['POLICY_USER_CHANGE_THEME'])) && (!empty($_SESSION['POLICY_USER_CHANGE_THEME'])) && ($_SESSION['POLICY_USER_CHANGE_THEME'] == "no")) echo "checked=yes" ?>><?php print _('Set as selected theme for all users');?></label>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label step-top">
-                                                <?php print _('Default 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."\"";
-                                                            if ( $key == $v_language ){
-                                                                echo 'selected' ;
-                                                            }
-                                                            if (( $key == $_SESSION['LANGUAGE'] && (empty($v_language)) )) {
-                                                                echo 'selected' ;
-                                                            }
-                                                            echo ">".htmlentities($value)."</option>\n";
-                                                        }
-                                                    ?>
-                                                </select>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                        <td class="vst-text input-label">
-                                                <label><input type="checkbox" size="20" class="vst-checkbox" name="v_language_update"><?php print _('SYSTEM_SET_DEFAULT_LANGUAGE');?></label>
-                                                
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label step-top advanced-options">
-                                    <a href="javascript:elementHideShow('version');" class="vst-text">
-                                        <i class="fas fa-code-branch"></i><b><?php print _('Updates');?> <img src="/images/arrow.png"></b>
-                                    </a>
-                                </td>
-                            </tr>
-                            <td class="vst-text input-label step-left">
-                                    <table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="version">
-                                        <tr>
-                                            <td class="vst-text step-top">
-                                                <?php print _('Version'); ?>: <span class="optional"><?php echo $_SESSION['VERSION']; ?></span>
-                                            </td>
-                                        </tr>
-                                        <?php if ($_SESSION['RELEASE_BRANCH'] !== 'release') {?>
-                                        <tr>
-                                            <td class="vst-text">
-                                                <?php print _('Release'); ?>: <span class="optional"><?php echo $_SESSION['RELEASE_BRANCH'] ?></span>
-                                            </td>
-                                        </tr>
-                                        <?}?>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Options'); ?>
-                                            </td>
-                                        </tr>
-                                        <?php if ($_SESSION['RELEASE_BRANCH'] != "release") { ?>
-                                            <tr>
-                                                <td>
-                                                    <label><input type="checkbox" size="20" class="vst-checkbox" name="v_debug_mode" <?php if ((isset($_SESSION['DEBUG_MODE'])) && (!empty($_SESSION['DEBUG_MODE'])) && ($_SESSION['DEBUG_MODE'] == "true")) echo "checked=yes" ?>><?php print _('Enable debug mode');?></label>
-                                                </td>
-                                            </tr>
-                                        <?php } ?>
-                                        <tr>
-                                            <td>
-                                                <label><input type="checkbox" size="20" class="vst-checkbox" name="v_experimental_features" <?php if ((isset($_SESSION['POLICY_SYSTEM_ENABLE_BACON'])) && (!empty($_SESSION['POLICY_SYSTEM_ENABLE_BACON'])) && ($_SESSION['POLICY_SYSTEM_ENABLE_BACON'] == "true")) echo "checked=yes" ?>><?php print _('Enable preview features');?></label> <span class="hint">(<a href="/list/server/preview/"><?=_('View');?></a>)</span>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <label><input type="checkbox" size="20" class="vst-checkbox" name="v_upgrade_send_notification_email" <?php if ((isset($_SESSION['UPGRADE_SEND_EMAIL'])) && (!empty($_SESSION['UPGRADE_SEND_EMAIL'])) && ($_SESSION['UPGRADE_SEND_EMAIL'] == "true")) echo "checked=yes" ?>><?php print _('SYSTEM_UPGRADE_SEND_NOTIFICATION_EMAIL');?></label>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <label><input type="checkbox" size="20" class="vst-checkbox" name="v_upgrade_send_email_log" <?php if ((isset($_SESSION['UPGRADE_SEND_EMAIL_LOG'])) && (!empty($_SESSION['UPGRADE_SEND_EMAIL_LOG'])) && ($_SESSION['UPGRADE_SEND_EMAIL_LOG'] == "true")) echo "checked=yes" ?>><?php print _('SYSTEM_UPGRADE_SEND_EMAIL_LOG');?></label>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <br />
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label step-top advanced-options">
-                                    <a href="javascript:elementHideShow('web');" class="vst-text">
-                                        <i class="fas fa-globe-americas"></i><b><?php print _('Web Server');?> <img src="/images/arrow.png"></b>
-                                    </a>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label step-left">
-                                    <table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="web" class="step-top">
-                                        <?php if (!empty($_SESSION['PROXY_SYSTEM'])) { ?>
-                                        <tr>
-                                            <td class="vst-text">
-                                                <?php print _('Proxy Server') ?>: <span class="optional"><?php echo $_SESSION['PROXY_SYSTEM']; ?> <a href="/edit/server/<? echo $_SESSION['PROXY_SYSTEM'] ?>/"><i class="fas fa-pencil-alt status-icon orange icon-pad-right"></i></a></span>
-                                            </td>
-                                        </tr>
-                                        <?php } ?>
-                                        <?php if (!empty($_SESSION['WEB_SYSTEM'])) { ?>
-                                        <tr>
-                                            <td class="vst-text">
-                                                <?php print _('Web Server') ?>: <span class="optional"><?php echo $_SESSION['WEB_SYSTEM']; ?> <a href="/edit/server/<? echo $_SESSION['WEB_SYSTEM'] ?>/"><i class="fas fa-pencil-alt status-icon orange icon-pad-right"></i></a></span>
-                                            </td>
-                                        </tr>
-                                        <?php } ?>
-                                        <?php if (!empty($_SESSION['WEB_BACKEND'])) { ?>
-                                        <tr>
-                                            <td class="vst-text">
-                                                <?php print _('Backend Server') ?>: <span class="optional"><?php echo $_SESSION['WEB_BACKEND']; ?> <a href="/edit/server/<? echo $_SESSION['WEB_BACKEND'] ?>/"><i class="fas fa-pencil-alt status-icon orange icon-pad-right"></i></a></span>
-                                            </td>
-                                        </tr>
-                                        <?php } ?>
-                                        <?php if (!empty($_SESSION['WEB_BACKEND_POOL'])) { ?>
-                                        <tr>
-                                            <td class="vst-text">
-                                                <?php print _('Backend Pool Mode') ?>: <span class="optional"><?php echo $_SESSION['WEB_BACKEND_POOL']; ?></span>
-                                            </td>
-                                        </tr>
-                                        <?php } ?>
-                                        <?php if(count($v_php_versions)): ?>
-                                        <tr>
-                                            <td class="vst-text step-top">
-                                                <?php print _('Enabled multi PHP versions') ?>
-
-                                                <span class="alert alert-info alert-with-icon">
-                                                    <i class="fas fa-info"></i>
-                                                    <?=_('Please wait while php is installed or removed')?>
-                                                </span>
-                                            </td>
-                                        </tr>
-                                        <?php foreach($v_php_versions as $php_version): ?>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <input type="checkbox" size="20" class="vst-checkbox"
-                                                    <?=$php_version->installed?'checked':''; ?>
-                                                    <?=$php_version->protected?'disabled':''; ?>
-                                                    id="<?=$php_version->name?>"
-                                                    name="v_php_versions[<?=$php_version->tpl?>]">
-                                                <label for="<?=$php_version->name?>"><?=$php_version->name?></label>
-                                            </td>
-                                        </tr>
-                                            <?php foreach($php_version->usedby as $wd_user => $wd_domains ): ?>
-                                                <?php foreach($wd_domains as $wd_domain ): ?>
-                                                <tr>
-                                                    <td class="vst-text" style="border: 1px lightgrey; padding:0 10px;">
-                                                        <span>
-                                                            <i class="fas fa-user"></i>
-                                                            <?=$wd_user;?>
-                                                        </span>
-                                                        <span class="optional" style="float:right"><?=$wd_domain;?></span>
-                                                    </td>
-                                                </tr>
-                                                <?php endforeach; ?>
-                                            <?php endforeach; ?>
-                                        <?php endforeach; ?>
-                                        <?php endif; ?>
-                                        <tr><td><br /></td></tr>
-                                    </table>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label step-top advanced-options">
-                                    <a href="javascript:elementHideShow('dns');" class="vst-text">
-                                        <i class="fas fa-atlas"></i><b><?php print _('DNS Server');?> <img src="/images/arrow.png"></b>
-                                    </a>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label step-left">
-                                    <table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="dns">
-                                        <tr>
-                                            <td class="vst-text step-top">
-                                                <?php print _('DNS Server') ?>: <span class="optional"><?php echo $_SESSION['DNS_SYSTEM']; ?> <a href="/edit/server/<? echo $_SESSION['DNS_SYSTEM'] ?>/"><i class="fas fa-pencil-alt status-icon orange icon-pad-right"></i></a></span>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text">
-                                                <?php print _('DNS Cluster');?>: <span class="optional"><? if ($v_dns_cluster == 'yes') { echo 'Yes'; } else { echo 'No'; } ?></span>
-                                            </td>
-                                        </tr>
-                                        <?php if ($v_dns_cluster = 'yes') {
-                                                  $i = 0;
-                                                  foreach ($dns_cluster as $key => $value) {
-                                                      $i++;
-                                         ?>
-                                        <tr>
-                                            <td class="vst-text">
-                                                <?php print _('Host'). ' #'.$i  ?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text">
-                                                <input type="text" size="20" class="vst-input" name="v_dns_remote_host" value="<?php echo $key; ?>" disabled>
-                                            </td>
-                                        </tr>
-                                        <?php }} ?>
-                                        <tr>
-                                            <td><br></td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label step-top advanced-options">
-                                    <a href="javascript:elementHideShow('mail');" class="vst-text">
-                                        <i class="fas fa-mail-bulk"></i><b><?php print _('Mail Server');?> <img src="/images/arrow.png"></b>
-                                    </a>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label step-left">
-                                    <table style="display:<?php if (empty($v_mail_adv)) echo 'none';?> ;" id="mail">
-                                        <tr>
-                                            <td class="vst-text step-top">
-                                                <?php print _('Mail Server') ?>: <span class="optional"><?php echo $_SESSION['MAIL_SYSTEM']; ?> <a href="/edit/server/<? echo $_SESSION['MAIL_SYSTEM'] ?>/"><i class="fas fa-pencil-alt status-icon orange icon-pad-right"></i></a></span>
-                                            </td>
-                                        </tr>
-                                        <?php if (!empty($_SESSION['ANTIVIRUS_SYSTEM'])) { ?>
-                                        <tr>
-                                            <td class="vst-text">
-                                                <?php print _('Antivirus') ?>: <span class="optional"><?php echo $_SESSION['ANTIVIRUS_SYSTEM']; ?> <a href="/edit/server/<? echo $_SESSION['ANTIVIRUS_SYSTEM'] ?>/"><i class="fas fa-pencil-alt status-icon orange icon-pad-right"></i></a></span>
-                                            </td>
-                                        </tr>
-                                        <?php } ?>
-                                        <?php if (!empty($_SESSION['ANTISPAM_SYSTEM'])) { ?>
-                                        <tr>
-                                            <td class="vst-text">
-                                                <?php print _('AntiSpam') ?>: <span class="optional"><?php echo $_SESSION['ANTISPAM_SYSTEM']; ?> <a href="/edit/server/<? echo $_SESSION['ANTISPAM_SYSTEM'] ?>/"><i class="fas fa-pencil-alt status-icon orange icon-pad-right"></i></a></span>
-                                            </td>
-                                        </tr>
-                                        <?php } ?>
-                                        <?php if($_SESSION['WEBMAIL_SYSTEM']){?>   
-                                        <tr>
-                                            <td class="vst-text step-top">
-                                                <?php print _('Webmail URL') ?> <span class="hint">(<?php echo $_SESSION['WEBMAIL_ALIAS'];?>.example.com)</span>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_webmail_alias" value="<?php echo $_SESSION['WEBMAIL_ALIAS']; ?>">
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <?php } ?>
-					                    <tr>
-                                            <td class="vst-text">
-                                                <label>
-                                                    <input type="checkbox" size="20" class="vst-checkbox" name="v_smtp_relay" <?php if ($v_smtp_relay == 'true') echo "checked=yes"; ?> onclick="javascript:elementHideShow('smtp_relay_table');"><?php print _('Global SMTP Relay');?>
-                                                </label>
-					                        </td>
-					                    </tr>
-					<tr>
-					    <td class="step-left">
-					        <table style="display:<?php if ($v_smtp_relay == 'true') {echo 'block';} else {echo 'none';} ?>;" id="smtp_relay_table">
-						    <tr>
-						        <td class="input-label vst-text">
-							    <?php print _('Host');?>
+		<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" width="600px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Configuring Server');?></span>
 							</td>
-						    </tr>
-						    <tr>
+						</tr>
+						<tr>
 							<td>
-							    <input type="text" size="20" class="vst-input" name="v_smtp_relay_host" value="<?=htmlentities(trim($v_smtp_relay_host, "'"))?>">
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+								<br><br>
+							</td>
+						</tr>
+
+						<!-- Basic options tab -->
+						<tr>
+							<td class="vst-text input-label step-top advanced-options">
+								<a href="javascript:elementHideShow('basic');" class="vst-text">
+									<i class="fas fa-cog"></i><b><?=_('Basic options');?> <img src="/images/arrow.png"></b>
+								</a>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label step-left">
+								<table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="basic">
+									<tr>
+										<td class="vst-text step-top">
+											<?=_('Hostname');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_hostname" value="<?=htmlentities(trim($v_hostname, "'"))?>">
+											<br><br>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('Time Zone');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<select class="vst-list" name="v_timezone">
+												<?php
+													foreach ($v_timezones as $key => $value) {
+														echo "\t\t\t\t<option value=\"".$key."\"";
+														if ((!empty($v_timezone)) && ( $key == $v_timezone)){
+															echo ' selected' ;
+														}
+														if ((!empty($v_timezone)) && ( $key == $_POST['v_timezone'])){
+															echo ' selected' ;
+														}
+														echo ">".$value."</option>\n";
+													}
+												?>
+											</select>
+											<br><br>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('Theme');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<select class="vst-list" name="v_theme">
+												<?php
+													foreach ($theme as $key => $value) {
+														echo "\t\t\t\t<option value=\"".$value."\"";
+														if ((!empty($_SESSION['THEME'])) && ( $value == $_SESSION['THEME'])){
+															echo ' selected' ;
+														}
+														if ((!empty($_SESSION['THEME'])) && ( $value == $_POST['v_theme'])){
+															echo ' selected' ;
+														}
+														echo ">".$value."</option>\n";
+													}
+												?>
+											</select>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<label><input type="checkbox" size="20" class="vst-checkbox" name="v_policy_user_change_theme" <?php if ((isset($_SESSION['POLICY_USER_CHANGE_THEME'])) && (!empty($_SESSION['POLICY_USER_CHANGE_THEME'])) && ($_SESSION['POLICY_USER_CHANGE_THEME'] == "no")) echo "checked=yes" ?>><?=_('Set as selected theme for all users');?></label>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label step-top">
+											<?=_('Default 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."\"";
+														if ( $key == $v_language ){
+															echo 'selected' ;
+														}
+														if (( $key == $_SESSION['LANGUAGE'] && (empty($v_language)) )) {
+															echo 'selected' ;
+														}
+														echo ">".htmlentities($value)."</option>\n";
+													}
+												?>
+											</select>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<label><input type="checkbox" size="20" class="vst-checkbox" name="v_language_update"><?=_('Set as default language for all users');?></label>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<br><br>
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+						<!-- Updates tab -->
+						<tr>
+							<td class="vst-text input-label step-top advanced-options">
+								<a href="javascript:elementHideShow('version');" class="vst-text">
+									<i class="fas fa-code-branch"></i><b><?=_('Updates');?> <img src="/images/arrow.png"></b>
+								</a>
 							</td>
-						    </tr>
-						    <tr>
-                                                        <td class="input-label vst-text">
-                                                            <?php print _('Port');?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <input type="text" size="20" class="vst-input" name="v_smtp_relay_port" value="<?=htmlentities(trim($v_smtp_relay_port, "'"))?>">
-                                                        </td>
-                                                    </tr>
-						    <tr>
-                                                        <td class="input-label vst-text">
-                                                            <?php print _('Username');?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <input type="text" size="20" class="vst-input" name="v_smtp_relay_user" value="<?=htmlentities(trim($v_smtp_relay_user, "'"))?>">
-                                                        </td>
-                                                    </tr>
-						    <tr>
-                                                        <td class="input-label vst-text">
-                                                            <?php print _('Password');?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <input type="text" size="20" class="vst-input" name="v_smtp_relay_pass">
-                                                        </td>
-                                                    </tr>
-						</table>
-					    </td>
-					</tr>
-					<tr>
-					    <td>
-						<br>
-					    </td>
-					</tr>
+						</tr>
+						<tr>
+							<td class="vst-text input-label step-left">
+								<table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="version">
+									<tr>
+										<td class="vst-text step-top">
+											<?=_('Version'); ?>: <span class="optional"><?=$_SESSION['VERSION'];?></span>
+										</td>
+									</tr>
+									<?php if ($_SESSION['RELEASE_BRANCH'] !== 'release') {?>
+										<tr>
+											<td class="vst-text">
+												<?=_('Release'); ?>: <span class="optional"><?=$_SESSION['RELEASE_BRANCH'];?></span>
+											</td>
+										</tr>
+									<?php } ?>
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('Options'); ?>
+										</td>
+									</tr>
+									<?php if ($_SESSION['RELEASE_BRANCH'] != "release") { ?>
+										<tr>
+											<td>
+												<label><input type="checkbox" size="20" class="vst-checkbox" name="v_debug_mode" <?php if ((isset($_SESSION['DEBUG_MODE'])) && (!empty($_SESSION['DEBUG_MODE'])) && ($_SESSION['DEBUG_MODE'] == "true")) echo "checked=yes" ?>><?=_('Enable debug mode');?></label>
+											</td>
+										</tr>
+									<?php } ?>
+									<tr>
+										<td>
+											<label><input type="checkbox" size="20" class="vst-checkbox" name="v_experimental_features" <?php if ((isset($_SESSION['POLICY_SYSTEM_ENABLE_BACON'])) && (!empty($_SESSION['POLICY_SYSTEM_ENABLE_BACON'])) && ($_SESSION['POLICY_SYSTEM_ENABLE_BACON'] == "true")) echo "checked=yes" ?>><?=_('Enable preview features');?></label> <span class="hint">(<a href="/list/server/preview/"><?=_('View');?></a>)</span>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<label><input type="checkbox" size="20" class="vst-checkbox" name="v_upgrade_send_notification_email" <?php if ((isset($_SESSION['UPGRADE_SEND_EMAIL'])) && (!empty($_SESSION['UPGRADE_SEND_EMAIL'])) && ($_SESSION['UPGRADE_SEND_EMAIL'] == "true")) echo "checked=yes" ?>><?=_('SYSTEM_UPGRADE_SEND_NOTIFICATION_EMAIL');?></label>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<label><input type="checkbox" size="20" class="vst-checkbox" name="v_upgrade_send_email_log" <?php if ((isset($_SESSION['UPGRADE_SEND_EMAIL_LOG'])) && (!empty($_SESSION['UPGRADE_SEND_EMAIL_LOG'])) && ($_SESSION['UPGRADE_SEND_EMAIL_LOG'] == "true")) echo "checked=yes" ?>><?=_('SYSTEM_UPGRADE_SEND_EMAIL_LOG');?></label>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<br />
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+						<!-- Web Server tab -->
+						<tr>
+							<td class="vst-text input-label step-top advanced-options">
+								<a href="javascript:elementHideShow('web');" class="vst-text">
+									<i class="fas fa-globe-americas"></i><b><?=_('Web Server');?> <img src="/images/arrow.png"></b>
+								</a>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label step-left">
+								<table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="web" class="step-top">
+									<?php if (!empty($_SESSION['PROXY_SYSTEM'])) { ?>
+										<tr>
+											<td class="vst-text">
+												<?=_('Proxy Server');?>: <span class="optional"><?=$_SESSION['PROXY_SYSTEM']; ?> <a href="/edit/server/<? echo $_SESSION['PROXY_SYSTEM'] ?>/"><i class="fas fa-pencil-alt status-icon orange icon-pad-right"></i></a></span>
+											</td>
+										</tr>
+									<?php } ?>
+									<?php if (!empty($_SESSION['WEB_SYSTEM'])) { ?>
+										<tr>
+											<td class="vst-text">
+												<?=_('Web Server');?>: <span class="optional"><?=$_SESSION['WEB_SYSTEM']; ?> <a href="/edit/server/<? echo $_SESSION['WEB_SYSTEM'] ?>/"><i class="fas fa-pencil-alt status-icon orange icon-pad-right"></i></a></span>
+											</td>
+										</tr>
+									<?php } ?>
+									<?php if (!empty($_SESSION['WEB_BACKEND'])) { ?>
+										<tr>
+											<td class="vst-text">
+												<?=_('Backend Server');?>: <span class="optional"><?=$_SESSION['WEB_BACKEND']; ?> <a href="/edit/server/<? echo $_SESSION['WEB_BACKEND'] ?>/"><i class="fas fa-pencil-alt status-icon orange icon-pad-right"></i></a></span>
+											</td>
+										</tr>
+									<?php } ?>
+									<?php if (!empty($_SESSION['WEB_BACKEND_POOL'])) { ?>
+										<tr>
+											<td class="vst-text">
+												<?=_('Backend Pool Mode');?>: <span class="optional"><?=$_SESSION['WEB_BACKEND_POOL']; ?></span>
+											</td>
+										</tr>
+									<?php } ?>
+									<?php if(count($v_php_versions)): ?>
+										<tr>
+											<td class="vst-text step-top">
+												<?=_('Enabled multi PHP versions');?>
 
-                                    </table>
-                                </td>
-                            </tr>
+												<span class="alert alert-info alert-with-icon">
+													<i class="fas fa-info"></i>
+													<?=_('Please wait while php is installed or removed');?>
+												</span>
+											</td>
+										</tr>
+										<?php foreach($v_php_versions as $php_version): ?>
+											<tr>
+												<td class="vst-text input-label">
+													<input type="checkbox" size="20" class="vst-checkbox"
+														<?=$php_version->installed?'checked':''; ?>
+														<?=$php_version->protected?'disabled':''; ?>
+														id="<?=$php_version->name?>"
+														name="v_php_versions[<?=$php_version->tpl?>]">
+													<label for="<?=$php_version->name?>"><?=$php_version->name?></label>
+												</td>
+											</tr>
+											<?php foreach($php_version->usedby as $wd_user => $wd_domains ): ?>
+												<?php foreach($wd_domains as $wd_domain ): ?>
+													<tr>
+														<td class="vst-text" style="border: 1px lightgrey; padding:0 10px;">
+															<span>
+																<i class="fas fa-user"></i>
+																<?=$wd_user;?>
+															</span>
+															<span class="optional" style="float:right"><?=$wd_domain;?></span>
+														</td>
+													</tr>
+												<?php endforeach; ?>
+											<?php endforeach; ?>
+										<?php endforeach; ?>
+									<?php endif; ?>
+									<tr>
+										<td>
+											<br />
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
 
+						<!-- DNS Server tab -->
+						<tr>
+							<td class="vst-text input-label step-top advanced-options">
+								<a href="javascript:elementHideShow('dns');" class="vst-text">
+									<i class="fas fa-atlas"></i><b><?=_('DNS Server');?> <img src="/images/arrow.png"></b>
+								</a>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label step-left">
+								<table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="dns">
+									<tr>
+										<td class="vst-text step-top">
+											<?=_('DNS Server');?>: <span class="optional"><?=$_SESSION['DNS_SYSTEM']; ?> <a href="/edit/server/<? echo $_SESSION['DNS_SYSTEM'] ?>/"><i class="fas fa-pencil-alt status-icon orange icon-pad-right"></i></a></span>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text">
+											<?=_('DNS Cluster');?>: <span class="optional"><?php if ($v_dns_cluster == 'yes') { echo 'Yes'; } else { echo 'No'; } ?></span>
+										</td>
+									</tr>
+									<?php if ($v_dns_cluster = 'yes') {
+										$i = 0;
+										foreach ($dns_cluster as $key => $value) {
+											$i++;
+										?>
+										<tr>
+											<td class="vst-text">
+												<?=_('Host'). ' #'.$i  ?>
+											</td>
+										</tr>
+										<tr>
+											<td class="vst-text">
+												<input type="text" size="20" class="vst-input" name="v_dns_remote_host" value="<?=$key; ?>" disabled>
+											</td>
+										</tr>
+									<?php } } ?>
+									<tr>
+										<td><br></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
 
-                            <tr>
-                                <td class="vst-text input-label step-top advanced-options">
-                                    <a href="javascript:elementHideShow('db');" class="vst-text">
-                                        <i class="fas fa-database"></i><b><?php print _('Databases');?> <img src="/images/arrow.png"></b>
-                                    </a>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label step-left">
-                                    <table style="display:<?php if (empty($v_db_adv)) echo 'none';?> ;" id="db">
-                                        <tr>
-                                            <td class="vst-text step-top">
-                                                <?php print _('MySQL Support');?> <a href="/edit/server/mysql/"><i class="fas fa-pencil-alt status-icon orange icon-pad-right"></i></a>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_mysql" disabled>
-                                                    <option value='no'><?php print _('no'); ?></option>
-                                                    <option value='yes' <?php if($v_mysql == 'yes') echo 'selected' ?> ><?php print _('yes'); ?></option>
-                                                </select>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <?php if ($v_mysql == 'yes') { ?>
-                                        <tr>
-                                            <td class="vst-text">
-                                                <?php print _('phpMyAdmin URL') ?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_mysql_url" value="<?php echo $_SESSION['DB_PMA_ALIAS']; ?>">
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <? if ($_SESSION['POLICY_SYSTEM_ENABLE_BACON'] === 'true') {?>
-                                        <tr>
-                                            <td class="vst-text">
-                                                <?php print _('phpMyAdmin Single Sign On') ?> <span class="hint">(Preview)</span>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_phpmyadmin_key">
-                                                    <option value='no'><?php print _('Disabled'); ?></option>
-                                                    <option value='yes' <?php if($_POST['v_phpmyadmin_key'] == "yes" || $_SESSION['PHPMYADMIN_KEY'] != ''){ echo 'selected="selected"'; }; ?>><?php print _('Enabled'); ?></option>
-                                                </select>
-                                                <br />
-                                                <br />
-                                            </td>
-                                        </tr>
-                                        <? } ?>
-                                        <?php } ?>
-                                        <?php if ($v_mysql == 'yes') {
-                                                  $i = 0;
-                                                  foreach ($v_mysql_hosts as $value) {
-                                                      $i++;
-                                         ?>
-                                        <tr>
-                                            <td class="vst-text step-left">
-                                                <?php print _('Host'). ' #'.$i  ?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="step-left">
-                                                <input type="text" size="20" class="vst-input" name="v_mysql_host" value="<?=$value['HOST']?>" disabled>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text step-left">
-                                                <?php print _('Password') ?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="step-left">
-                                                <input type="text" size="20" class="vst-input" name="v_mysql_password" value="">
-                                                <br><br>
-                                            </td>
-                                        </tr>
+						<!-- Mail Server tab -->
+						<tr>
+							<td class="vst-text input-label step-top advanced-options">
+								<a href="javascript:elementHideShow('mail');" class="vst-text">
+									<i class="fas fa-mail-bulk"></i><b><?=_('Mail Server');?> <img src="/images/arrow.png"></b>
+								</a>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label step-left">
+								<table style="display:<?php if (empty($v_mail_adv)) echo 'none';?> ;" id="mail">
+									<tr>
+										<td class="vst-text step-top">
+											<?=_('Mail Server');?>: <span class="optional"><?=$_SESSION['MAIL_SYSTEM']; ?> <a href="/edit/server/<? echo $_SESSION['MAIL_SYSTEM'] ?>/"><i class="fas fa-pencil-alt status-icon orange icon-pad-right"></i></a></span>
+										</td>
+									</tr>
+									<?php if (!empty($_SESSION['ANTIVIRUS_SYSTEM'])) { ?>
+										<tr>
+											<td class="vst-text">
+												<?=_('Antivirus');?>: <span class="optional"><?=$_SESSION['ANTIVIRUS_SYSTEM']; ?> <a href="/edit/server/<? echo $_SESSION['ANTIVIRUS_SYSTEM'] ?>/"><i class="fas fa-pencil-alt status-icon orange icon-pad-right"></i></a></span>
+											</td>
+										</tr>
+									<?php } ?>
+									<?php if (!empty($_SESSION['ANTISPAM_SYSTEM'])) { ?>
+										<tr>
+											<td class="vst-text">
+												<?=_('AntiSpam');?>: <span class="optional"><?=$_SESSION['ANTISPAM_SYSTEM']; ?> <a href="/edit/server/<? echo $_SESSION['ANTISPAM_SYSTEM'] ?>/"><i class="fas fa-pencil-alt status-icon orange icon-pad-right"></i></a></span>
+											</td>
+										</tr>
+									<?php } ?>
+									<?php if($_SESSION['WEBMAIL_SYSTEM']){?>
+										<tr>
+											<td class="vst-text step-top">
+												<?=_('Webmail URL');?> <span class="hint">(<?=$_SESSION['WEBMAIL_ALIAS'];?>.example.com)</span>
+											</td>
+										</tr>
+										<tr>
+											<td>
+												<input type="text" size="20" class="vst-input" name="v_webmail_alias" value="<?=$_SESSION['WEBMAIL_ALIAS']; ?>">
+												<br><br>
+											</td>
+										</tr>
+									<?php } ?>
+									<tr>
+										<td class="vst-text">
+											<label>
+												<input type="checkbox" size="20" class="vst-checkbox" name="v_smtp_relay" <?php if ($v_smtp_relay == 'true') echo "checked=yes"; ?> onclick="javascript:elementHideShow('smtp_relay_table');"><?=_('Global SMTP Relay');?>
+											</label>
+										</td>
+									</tr>
+									<tr>
+										<td class="step-left">
+											<table style="display:<?php if ($v_smtp_relay == 'true') {echo 'block';} else {echo 'none';} ?>;" id="smtp_relay_table">
+												<tr>
+													<td class="input-label vst-text">
+														<?=_('Host');?>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<input type="text" size="20" class="vst-input" name="v_smtp_relay_host" value="<?=htmlentities(trim($v_smtp_relay_host, "'"))?>">
+													</td>
+												</tr>
+												<tr>
+													<td class="input-label vst-text">
+														<?=_('Port');?>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<input type="text" size="20" class="vst-input" name="v_smtp_relay_port" value="<?=htmlentities(trim($v_smtp_relay_port, "'"))?>">
+													</td>
+												</tr>
+												<tr>
+													<td class="input-label vst-text">
+														<?=_('Username');?>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<input type="text" size="20" class="vst-input" name="v_smtp_relay_user" value="<?=htmlentities(trim($v_smtp_relay_user, "'"))?>">
+													</td>
+												</tr>
+												<tr>
+													<td class="input-label vst-text">
+														<?=_('Password');?>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<input type="text" size="20" class="vst-input" name="v_smtp_relay_pass">
+													</td>
+												</tr>
+											</table>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<br>
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
 
-                                        <tr>
-                                            <td class="vst-text step-left">
-                                                <?php print _('Maximum Number Of Databases') ?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="step-left">
-                                                <input type="text" size="20" class="vst-input" name="v_mysql_max" value="<?php echo $value['MAX_DB']; ?>" disabled>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text step-left">
-                                                <?php print _('Current Number Of Databases') ?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="step-left">
-                                                <input type="text" size="20" class="vst-input" name="v_mysql_max" value="<?php echo $value['U_DB_BASES']; ?>" disabled>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <?php }} ?>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('PostgreSQL Support');?> <a href="/edit/server/postgresql/"><i class="fas fa-pencil-alt status-icon orange icon-pad-right"></i></a>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_pgsql" disabled>
-                                                    <option value='no'><?php print _('no'); ?></option>
-                                                    <option value='yes' <?php if($v_pgsql == 'yes') echo 'selected' ?> ><?php print _('yes'); ?></option>
-                                                </select>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <?php if ($v_pgsql == 'yes') { ?>
-                                        <tr>
-                                            <td class="vst-text">
-                                                <?php print _('phpPgAdmin URL') ?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_pgsql_url" value="<?php echo $_SESSION['DB_PGA_ALIAS']; ?>">
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <?php } ?>
-                                        <?php if ($v_pgsql == 'yes') {
-                                                  $i = 0;
-                                                  foreach ($v_pgsql_hosts as $value) {
-                                                      $i++;
-                                         ?>
-                                        <tr>
-                                            <td class="vst-text step-left">
-                                                <?php print _('Host'). ' #'.$i  ?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="step-left">
-                                                <input type="text" size="20" class="vst-input" name="v_pgsql_host" value="<?=$value['HOST']?>" disabled>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text step-left">
-                                                <?php print _('Maximum Number Of Databases') ?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="step-left">
-                                                <input type="text" size="20" class="vst-input" name="v_psql_max" value="<?php echo $value['MAX_DB']; ?>" disabled>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text step-left">
-                                                <?php print _('Current Number Of Databases') ?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="step-left">
-                                                <input type="text" size="20" class="vst-input" name="v_pgsql_max" value="<?php echo $value['U_DB_BASES']; ?>" disabled>
-                                                <br><br><br><br>
-                                            </td>
-                                        </tr>
-                                        <?php }} ?>
-                                    </table>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label step-top advanced-options">
-                                    <a href="javascript:elementHideShow('backup');" class="vst-text">
-                                        <i class="fas fa-undo"></i><b><?php print _('Backups');?> <img src="/images/arrow.png"></b>
-                                    </a>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label step-left">
-                                    <table style="<?php if (empty($v_backup_adv)) echo 'display:none';?> ;" id="backup">
-                                        <tr>
-                                            <td class="vst-text step-top">
-                                                <?php print _('Local backup') ?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_backup">
-                                                    <option value='no'><?php print _('no'); ?></option>
-                                                    <option value='yes' <?php if($v_backup == 'yes') echo 'selected' ?> ><?php print _('yes'); ?></option>
-                                                </select>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text">
-                                                <?php print _('Compression') ?> <a href="https://docs.hestiacp.com/admin_docs/backups.html"><i class="fas fa-question-circle"></i></a>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_backup_mode">
-                                                    <option value='gzip' <?php if($v_backup_mode != 'zstd') echo 'selected' ?>>gzip</option>
-                                                    <option value='zstd' <?php if($v_backup_mode == 'zstd') echo 'selected' ?>>zstd</option>
-                                                </select>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text">
-                                                <?php print _('Compression level') ?> <a href="https://docs.hestiacp.com/admin_docs/backups.html"><i class="fas fa-question-circle"></i></a>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_backup_gzip">
-                                                <?php for($level = 1; $level < 20; $level++){
-                                                ?>
-                                                <option value='<?=$level;?>' <?php if($v_backup_gzip == $level) echo 'selected' ?>><?=$level;?><?php if($level > 9){ echo sprintf(' (%s)', _('zstd only')); } ?></option>
-                                                <?php
-                                                }
-                                                ?>
-                                                </select>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text">
-                                                <?php print _('Directory') ?> <a href="https://docs.hestiacp.com/admin_docs/backups.html"><i class="fas fa-question-circle"></i></a>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input type="text" size="20" class="vst-input" name="v_backup_dir" value="<?=trim($v_backup_dir, "'")?>" disabled="disabled">
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                    <label><input type="checkbox" size="20" class="vst-checkbox" name="v_backup_remote_adv" <?php if (!empty($v_backup_remote_adv)) echo "checked=yes" ?> onclick="javascript:elementHideShow('remote_backup');"><?php print _('Remote backup');?></label>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label step-left">
-                                                <table style="display:<?php if (empty($v_backup_remote_adv)) echo 'none';?> ;" id="remote_backup">
-                                                    <td class="vst-text">
-                                                        <?php print _('Protocol') ?> <a href="https://docs.hestiacp.com/admin_docs/backups.html"><i class="fas fa-question-circle"></i></a>
-                                                    </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <select class="vst-list" name="v_backup_type" id="backup_type">
-                                                                <option value='ftp'><?php print _('ftp'); ?></option>
-                                                                <option value='sftp' <?php if((!empty($v_backup_type)) && (trim($v_backup_type,"'")  == 'sftp' )) echo 'selected="selected"'; ?>><?php print _('sftp'); ?></option>
-                                                                <option value="b2" <?php if((!empty($v_backup_type)) && (trim($v_backup_type,"'")  == 'b2' )) echo 'selected="selected"'; ?>><?php print _('Backblaze '); ?>
-                                                            </select>
-                                                            <br><br>
-                                                        </td>
-                                                    </tr>
-                                                    <tr style="display: <?php if ((!empty($v_backup_type)) && !in_array(trim($v_backup_type, "'"),array('ftp','sftp'))){ echo 'none';} else {echo 'block';} ?>" id="backup_sftp">
-                                                        <td>
-                                                            <table>
-                                                            <tr>
-                                                                <td class="vst-text">
-                                                                    <?php print _('Host') ?>
-                                                                </td>
-                                                            </tr>
-                                                            <tr>
-                                                                <td>
-                                                                    <input type="text" size="20" class="vst-input" name="v_backup_host" value="<?=trim($v_backup_host, "'")?>">
-                                                                    <br><br>
-                                                                </td>
-                                                            </tr>
-                                                            <tr>
-                                                                <td class="vst-text">
-                                                                    <?php print _('Port') ?>
-                                                                </td>
-                                                            </tr>
-                                                            <tr>
-                                                                <td>
-                                                                    <input type="text" size="20" class="vst-input" name="v_backup_port" value="<?=trim($v_backup_port, "'")?>">
-                                                                    <br><br>
-                                                                </td>
-                                                            </tr>
-                                                            <tr>
-                                                                <td class="vst-text">
-                                                                    <?php print _('Username') ?>
-                                                                </td>
-                                                            </tr>
-                                                            <tr>
-                                                                <td>
-                                                                    <input type="text" size="20" class="vst-input" name="v_backup_username" value="<?=trim($v_backup_username, "'")?>">
-                                                                    <br><br>
-                                                                </td>
-                                                            </tr>
-                                                            <tr>
-                                                                <td class="vst-text">
-                                                                    <?php print _('Password') ?>
-                                                                </td>
-                                                            </tr>
-                                                            <tr>
-                                                                <td>
-                                                                    <input type="text" size="20" class="vst-input" name="v_backup_password" value="<?=trim($v_backup_password, "'")?>">
-                                                                    <br><br>
-                                                                </td>
-                                                            </tr>
-                                                            <tr>
-                                                                <td class="vst-text">
-                                                                    <?php print _('Directory') ?>
-                                                                </td>
-                                                            </tr>
-                                                            <tr>
-                                                                <td>
-                                                                    <input type="text" size="20" class="vst-input" name="v_backup_bpath" value="<?=trim($v_backup_bpath, "'")?>">
-                                                                    <br><br>
-                                                                </td>
-                                                            </tr>
-                                                            </table>
-                                                        </td>
-                                                    </tr>
-                                                    <tr style="display: <?php if ((empty($v_backup_type)) || !in_array(trim($v_backup_type, "'"),array('b2'))){ echo 'none';} else {echo 'block';} ?>"  id="backup_bucket">
-                                                        <td>
-                                                            <table>
-                                                            <tr>
-                                                                <td class="vst-text">
-                                                                    <?php print _('Bucket') ?>
-                                                                </td>
-                                                            </tr>
-                                                            <tr>
-                                                                <td>
-                                                                    <input type="text" size="20" class="vst-input" name="v_backup_bucket" value="<?=trim($v_backup_bucket, "'")?>">
-                                                                    <br><br>
-                                                                </td>
-                                                            </tr>
-                                                            <tr>
-                                                                <td class="vst-text">
-                                                                    <?php print _('Application ID') ?>
-                                                                </td>
-                                                            </tr>
-                                                            <tr>
-                                                                <td>
-                                                                    <input type="text" size="20" class="vst-input" name="v_backup_application_id" value="<?=trim($v_backup_application_id, "'")?>">
-                                                                    <br><br>
-                                                                </td>
-                                                            </tr>
-                                                            <tr>
-                                                                <td class="vst-text">
-                                                                    <?php print _('Application Key') ?>
-                                                                </td>
-                                                            </tr>
-                                                            <tr>
-                                                                <td>
-                                                                    <input type="text" size="20" class="vst-input" name="v_backup_application_key" value="<?=trim($v_backup_application_key, "'")?>">
-                                                                    <br><br>
-                                                                </td>
-                                                            </tr>
-                                                            </table>
-                                                        </td>
-                                                    </tr>
-                                                </table>
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
+						<!-- Databases tab -->
+						<tr>
+							<td class="vst-text input-label step-top advanced-options">
+								<a href="javascript:elementHideShow('db');" class="vst-text">
+									<i class="fas fa-database"></i><b><?=_('Databases');?> <img src="/images/arrow.png"></b>
+								</a>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label step-left">
+								<table style="display:<?php if (empty($v_db_adv)) echo 'none';?> ;" id="db">
+									<tr>
+										<td class="vst-text step-top">
+											<?=_('MySQL Support');?> <a href="/edit/server/mysql/"><i class="fas fa-pencil-alt status-icon orange icon-pad-right"></i></a>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<select class="vst-list" name="v_mysql" disabled>
+												<option value='no'><?=_('no'); ?></option>
+												<option value='yes' <?php if($v_mysql == 'yes') echo 'selected' ?>><?=_('yes'); ?></option>
+											</select>
+											<br><br>
+										</td>
+									</tr>
 
-                            <tr>
-                                <td class="vst-text input-label step-top advanced-options">
-                                    <a href="javascript:elementHideShow('ssl');" class="vst-text">
-                                        <i class="fas fa-lock"></i><b><?php print _('Hestia SSL');?><img src="/images/arrow.png"></b>
-                                    </a>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label step-left">
-                                    <table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="ssl">
-                                        <tr>
-                                            <td class="vst-text step-top">
-                                                <?php print _('SSL Certificate');?>
-                                                <span id="generate-csr"> / <a class="generate" target="_blank" href="/generate/ssl/?domain=<?=$v_hostname?>"><?=_('Generate CSR')?></a></span>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <textarea size="20" class="vst-textinput short console" name="v_ssl_crt"><?=htmlentities(trim($v_ssl_crt, "'"))?></textarea>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('SSL Key');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <textarea size="20" class="vst-textinput short console" name="v_ssl_key"><?=htmlentities(trim($v_ssl_key, "'"))?></textarea>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <table class="additional-info">
-                                                    <tr>
-                                                        <td>
-                                                            <b><?=_('SUBJECT')?>:</b>
-                                                        </td>
-                                                        <td class="details">
-                                                            <?=$v_ssl_subject?>
-                                                        </td>
-                                                    </tr>
-                                                    <? if($v_ssl_aliases){?>
-                                                    <tr>
-                                                        <td>
-                                                            <b><?=_('Aliases')?>:</b>
-                                                        </td>
-                                                        <td class="details">
-                                                            <?=$v_ssl_aliases?>
-                                                        </td>
-                                                    </tr>
-                                                    <? } ?>
-                                                    <tr>
-                                                        <td>
-                                                            <b><?=_('NOT_BEFORE')?>:</b>
-                                                        </td>
-                                                        <td class="details">
-                                                            <?=$v_ssl_not_before?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <b><?=_('NOT_AFTER')?>:</b>
-                                                        </td>
-                                                        <td class="details">
-                                                            <?=$v_ssl_not_after?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <b><?=_('SIGNATURE')?>:</b>
-                                                        </td>
-                                                        <td class="details">
-                                                            <?=$v_ssl_signature?>
-                                                        </td>
-                                                    </tr>
+									<!-- MySQL / MariaDB Options-->
+									<?php if ($v_mysql == 'yes') { ?>
+										<tr>
+											<td class="vst-text">
+												<?=_('phpMyAdmin URL');?>
+											</td>
+										</tr>
+										<tr>
+											<td>
+												<input type="text" size="20" class="vst-input" name="v_mysql_url" value="<?=$_SESSION['DB_PMA_ALIAS']; ?>">
+												<br><br>
+											</td>
+										</tr>
+										<?php if ($_SESSION['POLICY_SYSTEM_ENABLE_BACON'] === 'true') {?>
+											<tr>
+												<td class="vst-text">
+													<?=_('phpMyAdmin Single Sign On');?> <span class="hint">(Preview)</span>
+												</td>
+											</tr>
+											<tr>
+												<td>
+													<select class="vst-list" name="v_phpmyadmin_key">
+														<option value='no'><?=_('Disabled'); ?></option>
+														<option value='yes' <?php if($_POST['v_phpmyadmin_key'] == "yes" || $_SESSION['PHPMYADMIN_KEY'] != ''){ echo 'selected="selected"'; }; ?>><?=_('Enabled'); ?></option>
+													</select>
+													<br />
+													<br />
+												</td>
+											</tr>
+										<?php } ?>
+									<?php } ?>
+									<?php if ($v_mysql == 'yes') {
+										$i = 0;
+										foreach ($v_mysql_hosts as $value) {
+											$i++;
+										?>
+										<tr>
+											<td class="vst-text step-left">
+												<?=_('Host'). ' #'.$i  ?>
+											</td>
+										</tr>
+										<tr>
+											<td class="step-left">
+												<input type="text" size="20" class="vst-input" name="v_mysql_host" value="<?=$value['HOST']?>" disabled>
+												<br><br>
+											</td>
+										</tr>
+										<tr>
+											<td class="vst-text step-left">
+												<?=_('Password');?>
+											</td>
+										</tr>
+										<tr>
+											<td class="step-left">
+												<input type="text" size="20" class="vst-input" name="v_mysql_password" value="">
+												<br><br>
+											</td>
+										</tr>
 
-                                                    <tr>
-                                                        <td>
-                                                            <b><?=_('PUB_KEY')?>:</b>
-                                                        </td>
-                                                        <td class="details">
-                                                            <?=$v_ssl_pub_key?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <b><?=_('ISSUER')?>:</b>
-                                                        </td>
-                                                        <td class="details">
-                                                            <?=$v_ssl_issuer?>
-                                                        </td>
-                                                    </tr>
-                                                </table>
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label step-top advanced-options">
-                                    <a href="javascript:elementHideShow('security');" class="vst-text">
-                                        <i class="fas fa-key"></i><b><?php print _('Security');?> <img src="/images/arrow.png"></b>
-                                    </a>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label step-left">
-                                    <table style="<?php if (empty($v_security_adv)) echo 'display:none;';?>" id="security">
-                                        <tr>
-                                            <td class="section-title" onclick="javascript:elementHideShow('security-system-table');">
-                                                <?=('System');?>
-                                            </td>
-                                            <td class="section-hide-button">
-                                                <a href="javascript:elementHideShow('security-system-table');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <table id="security-system-table" style="display: none;">
-                                                    <td class="vst-text input-label step-top" style="font-size:1rem;padding-bottom:12px;">
-                                                        <?=_('API');?>
-                                                    </td>
-                                                    <tr>
-                                                        <td class="vst-text input-label">
-                                                            <?php print _('Enable API access');?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <select class="vst-list" name="v_api" id="api">
-                                                                <option value='yes'><?php print _('yes'); ?></option>
-                                                                <option value='no' <?php if($_SESSION['API'] == 'no') echo 'selected' ?> ><?php print _('no'); ?></option>
-                                                            </select>
-                                                            <br><br>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                    <table id="security_ip" style="<?php if ($_SESSION['API'] == "no") echo 'display:none;';?>">
-                                                    <tr>
-                                                        <td class="vst-text input-label">
-                                                            <?php print _('Allowed IP addresses for API');?> <span class="optional" style="float:right">1 IP address per line</span>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <textarea size="20" class="vst-textinput short" name="v_api_allowed_ip"><?php 
-                                                                foreach(explode(',',$_SESSION['API_ALLOWED_IP']) as $ip ){
-                                                                    echo $ip."\n";
-                                                                }
-                                                                ?></textarea>
-                                                            <br><br>
-                                                        </td>
-                                                    </tr>
-                                                    </table>
-                                                        </td>
-                                                    </tr>
-                                                    <td class="vst-text input-label step-top" style="font-size:1rem;padding-bottom:12px;">
-                                                        <?=_('Login');?>
-                                                    </td>
-                                                    <tr>
-                                                        <td class="vst-text input-label">
-                                                            <?php print _('Login screen style');?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <select class="vst-list" name="v_login_style">
-                                                                <option value='default'><?php print _('Default'); ?></option>
-                                                                <option value='old' <?php if($_SESSION['LOGIN_STYLE'] == 'old') echo 'selected' ?> ><?php print _('Old Style'); ?></option>
-                                                            </select>
-                                                            <br><br>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="vst-text input-label">
-                                                            <?php print _('Allow users to reset their passwords');?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <select class="vst-list" name="v_policy_system_password_reset">
-                                                                <option value='yes'><?php print _('yes'); ?></option>
-                                                                <option value='no' <?php if($_SESSION['POLICY_SYSTEM_PASSWORD_RESET'] == 'no') echo 'selected' ?> ><?php print _('no'); ?></option>
-                                                            </select>
-                                                            <br><br>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="vst-text input-label">
-                                                            <?php print _('Inactive session timeout');?> (<?php print _('Minutes');?>)
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <input type="text" size="20" class="vst-input" name="v_inactive_session_timeout" value="<?=trim($_SESSION['INACTIVE_SESSION_TIMEOUT'], "'")?>">
-                                                            <br><br>
-                                                        </td>
-                                                    </tr>
-                                                </table>
-                                            </td>
-                                        </tr>
-                                        <? if (($_SESSION['userContext'] === "admin") && ($_SESSION['user'] === 'admin')) {?>
-                                            <tr>
-                                                <td class="section-title" onclick="javascript:elementHideShow('security-sysadminprotect-table');">
-                                                    <?=('System Protection');?>
-                                                </td>
-                                                <td class="section-hide-button">
-                                                    <a href="javascript:elementHideShow('security-sysadminprotect-table');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td>
-                                                    <table id="security-sysadminprotect-table" class="step-top" style="display: none;">
-                                                        <tr>
-                                                            <td class="vst-text input-label step-top" style="font-size:1rem;padding-bottom:12px;">
-                                                                <?=_('System Administrator account');?>
-                                                            </td>
-                                                            
-                                                        </tr>
-                                                        <tr>
-                                                            <td class="vst-text input-label">
-                                                                <?=_('Restrict access to read-only for other administrators');?>
-                                                            </td>
-                                                        </tr>
-                                                        <tr>
-                                                            <td>
-                                                                <select class="vst-list" name="v_policy_system_protected_admin">
-                                                                    <option value='yes'><?php print _('yes'); ?></option>
-                                                                    <option value='no' <?php if($_SESSION['POLICY_SYSTEM_PROTECTED_ADMIN'] !== 'yes') echo 'selected' ?>><?php print _('no'); ?></option>
-                                                                </select>
-                                                                <br><br>
-                                                            </td>
-                                                        </tr>
-                                                        <tr>
-                                                            <td class="vst-text input-label">
-                                                                <?php print _('Hide account from other administrators');?>
-                                                            </td>
-                                                        </tr>
-                                                        <tr>
-                                                            <td>
-                                                                <select class="vst-list" name="v_policy_system_hide_admin">
-                                                                    <option value='yes'><?php print _('yes'); ?></option>
-                                                                    <option value='no' <?php if($_SESSION['POLICY_SYSTEM_HIDE_ADMIN'] !== 'yes') echo 'selected' ?>><?php print _('no'); ?></option>
-                                                                </select>
-                                                                <br><br>
-                                                            </td>
-                                                        </tr>
-                                                        <tr>
-                                                            <td class="vst-text input-label">
-                                                                <?php print _('Do not allow other administrators to access Server Settings');?>
-                                                            </td>
-                                                        </tr>
-                                                        <tr>
-                                                            <td>
-                                                                <select class="vst-list" name="v_policy_system_hide_services">
-                                                                    <option value='yes'><?php print _('yes'); ?></option>
-                                                                    <option value='no' <?php if($_SESSION['POLICY_SYSTEM_HIDE_SERVICES'] !== 'yes') echo 'selected' ?>><?php print _('no'); ?></option>
-                                                                </select>
-                                                                <br><br>
-                                                            </td>
-                                                        </tr>
-                                                    </table>
-                                                </td>
-                                            </tr>
-                                        <?}?>
-                                        <tr>
-                                            <td class="section-title" onclick="javascript:elementHideShow('security-policies-table');">
-                                                <?=('Policies');?>
-                                            </td>
-                                            <td class="section-hide-button">
-                                                <a href="javascript:elementHideShow('security-policies-table');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <table id="security-policies-table" style="display: none;">
-                                                    <tr>
-                                                        <td class="vst-text input-label step-top" style="font-size:1rem;padding-bottom:12px;">
-                                                            <?=_('Users');?>
-                                                        </td>
-                                                        
-                                            </tr>
-                                            <? if ($_SESSION['POLICY_SYSTEM_ENABLE_BACON'] === 'true') { ?>
-                                              <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Allow suspended users to log in with read-only access');?> <span class="hint">(Preview)</span>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_policy_user_view_suspended">
-                                                    <option value='yes' <?php if($_SESSION['POLICY_USER_VIEW_SUSPENDED'] !== 'no') echo 'selected' ?>><?php print _('yes'); ?></option>
-                                                    <option value='no' <?php if($_SESSION['POLICY_USER_VIEW_SUSPENDED'] == 'no') echo 'selected' ?>><?php print _('no'); ?></option>
-                                                </select>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <? } ?>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Allow users to edit their account details');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_policy_user_edit_details">
-                                                    <option value='yes' <?php if($_SESSION['POLICY_USER_EDIT_DETAILS'] !== 'no') echo 'selected' ?>><?php print _('yes'); ?></option>
-                                                    <option value='no' <?php if($_SESSION['POLICY_USER_EDIT_DETAILS'] == 'no') echo 'selected' ?>><?php print _('no'); ?></option>
-                                                </select>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Allow users to change templates when editing web domains');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_policy_user_edit_web_templates">
-                                                    <option value='yes' <?php if($_SESSION['POLICY_USER_EDIT_WEB_TEMPLATES'] !== 'no') echo 'selected' ?>><?php print _('yes'); ?></option>
-                                                    <option value='no' <?php if($_SESSION['POLICY_USER_EDIT_WEB_TEMPLATES'] == 'no') echo 'selected' ?>><?php print _('no'); ?></option>
-                                                </select>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Allow users to change templates when editing DNS zones');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_policy_user_edit_web_templates">
-                                                    <option value='yes' <?php if($_SESSION['POLICY_USER_EDIT_DNS_TEMPLATES'] !== 'no') echo 'selected' ?>><?php print _('yes'); ?></option>
-                                                    <option value='no' <?php if($_SESSION['POLICY_USER_EDIT_DNS_TEMPLATES'] == 'no') echo 'selected' ?>><?php print _('no'); ?></option>
-                                                </select>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Allow users to view action and login history logs');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_policy_user_view_logs">
-                                                    <option value='yes' <?php if($_SESSION['POLICY_USER_VIEW_LOGS'] !== 'no') echo 'selected' ?>><?php print _('yes'); ?></option>
-                                                    <option value='no' <?php if($_SESSION['POLICY_USER_VIEW_LOGS'] == 'no') echo 'selected' ?>><?php print _('no'); ?></option>
-                                                </select>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Allow users to delete log history');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_policy_user_delete_logs">
-                                                    <option value='yes' <?php if($_SESSION['POLICY_USER_DELETE_LOGS'] !== 'no') echo 'selected' ?>><?php print _('yes'); ?></option>
-                                                    <option value='no' <?php if($_SESSION['POLICY_USER_DELETE_LOGS'] == 'no') echo 'selected' ?>><?php print _('no'); ?></option>
-                                                </select>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label step-top" style="font-size:1rem;padding-bottom:12px;">
-                                                <?=_('Domains');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Enforce subdomain ownership');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_enforce_subdomain_ownership">
-                                                    <option value='yes'><?php print _('yes'); ?></option>
-                                                    <option value='no' <?php if($_SESSION['ENFORCE_SUBDOMAIN_OWNERSHIP'] == 'no') echo 'selected' ?> ><?php print _('no'); ?></option>
-                                                </select>
-                                            </td>
-                                        </tr>
+										<tr>
+											<td class="vst-text step-left">
+												<?=_('Maximum Number Of Databases');?>
+											</td>
+										</tr>
+										<tr>
+											<td class="step-left">
+												<input type="text" size="20" class="vst-input" name="v_mysql_max" value="<?=$value['MAX_DB']; ?>" disabled>
+												<br><br>
+											</td>
+										</tr>
+										<tr>
+											<td class="vst-text step-left">
+												<?=_('Current Number Of Databases');?>
+											</td>
+										</tr>
+										<tr>
+											<td class="step-left">
+												<input type="text" size="20" class="vst-input" name="v_mysql_max" value="<?=$value['U_DB_BASES']; ?>" disabled>
+												<br><br>
+											</td>
+										</tr>
+									<?php }} ?>
 
-                                                </table>
-                                            </td>
-                                            <tr>
-                                                <td>
-                                                    <br><br>
-                                                </td>
-                                            </tr>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
+									<!-- PostgreSQL Options-->
+									<?php if ($v_pgsql == 'yes') { ?>
+										<tr>
+											<td class="vst-text input-label">
+												<?=_('PostgreSQL Support');?> <a href="/edit/server/postgresql/"><i class="fas fa-pencil-alt status-icon orange icon-pad-right"></i></a>
+											</td>
+										</tr>
+										<tr>
+											<td>
+												<select class="vst-list" name="v_pgsql" disabled>
+													<option value='no'><?=_('no'); ?></option>
+													<option value='yes' <?php if($v_pgsql == 'yes') echo 'selected' ?>><?=_('yes'); ?></option>
+												</select>
+												<br><br>
+											</td>
+										</tr>
+										<tr>
+											<td class="vst-text">
+												<?=_('phpPgAdmin URL');?>
+											</td>
+										</tr>
+										<tr>
+											<td>
+												<input type="text" size="20" class="vst-input" name="v_pgsql_url" value="<?=$_SESSION['DB_PGA_ALIAS']; ?>">
+												<br><br>
+											</td>
+										</tr>
+									<?php } ?>
+									<?php if ($v_pgsql == 'yes') {
+										$i = 0;
+										foreach ($v_pgsql_hosts as $value) {
+											$i++;
+										?>
+										<tr>
+											<td class="vst-text step-left">
+												<?=_('Host'). ' #'.$i  ?>
+											</td>
+										</tr>
+										<tr>
+											<td class="step-left">
+												<input type="text" size="20" class="vst-input" name="v_pgsql_host" value="<?=$value['HOST']?>" disabled>
+												<br><br>
+											</td>
+										</tr>
+										<tr>
+											<td class="vst-text step-left">
+												<?=_('Maximum Number Of Databases');?>
+											</td>
+										</tr>
+										<tr>
+											<td class="step-left">
+												<input type="text" size="20" class="vst-input" name="v_psql_max" value="<?=$value['MAX_DB']; ?>" disabled>
+												<br><br>
+											</td>
+										</tr>
+										<tr>
+											<td class="vst-text step-left">
+												<?=_('Current Number Of Databases');?>
+											</td>
+										</tr>
+										<tr>
+											<td class="step-left">
+												<input type="text" size="20" class="vst-input" name="v_pgsql_max" value="<?=$value['U_DB_BASES']; ?>" disabled>
+												<br><br><br><br>
+											</td>
+										</tr>
+									<?php }} ?>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label step-top advanced-options">
+								<a href="javascript:elementHideShow('backup');" class="vst-text">
+									<i class="fas fa-undo"></i><b><?=_('Backups');?> <img src="/images/arrow.png"></b>
+								</a>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label step-left">
+								<table style="<?php if (empty($v_backup_adv)) echo 'display:none';?> ;" id="backup">
+									<tr>
+										<td class="vst-text step-top">
+											<?=_('Local backup');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<select class="vst-list" name="v_backup">
+												<option value='no'><?=_('no'); ?></option>
+												<option value='yes' <?php if($v_backup == 'yes') echo 'selected' ?>><?=_('yes'); ?></option>
+											</select>
+											<br><br>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text">
+											<?=_('Compression');?> <a href="https://docs.hestiacp.com/admin_docs/backups.html"><i class="fas fa-question-circle"></i></a>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<select class="vst-list" name="v_backup_mode">
+												<option value='gzip' <?php if($v_backup_mode != 'zstd') echo 'selected' ?>>gzip</option>
+												<option value='zstd' <?php if($v_backup_mode == 'zstd') echo 'selected' ?>>zstd</option>
+											</select>
+											<br><br>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text">
+											<?=_('Compression level');?> <a href="https://docs.hestiacp.com/admin_docs/backups.html"><i class="fas fa-question-circle"></i></a>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<select class="vst-list" name="v_backup_gzip">
+												<?php for ($level = 1; $level < 20; $level++) { ?>
+													<option value='<?=$level;?>' <?php if($v_backup_gzip == $level) echo 'selected' ?>><?=$level;?><?php if($level > 9){ echo sprintf(' (%s)', _('zstd only')); } ?></option>
+												<?php } ?>
+											</select>
+											<br><br>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text">
+											<?=_('Directory');?> <a href="https://docs.hestiacp.com/admin_docs/backups.html"><i class="fas fa-question-circle"></i></a>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input type="text" size="20" class="vst-input" name="v_backup_dir" value="<?=trim($v_backup_dir, "'")?>" disabled="disabled">
+											<br><br>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<label><input type="checkbox" size="20" class="vst-checkbox" name="v_backup_remote_adv" <?php if (!empty($v_backup_remote_adv)) echo "checked=yes" ?> onclick="javascript:elementHideShow('remote_backup');"><?=_('Remote backup');?></label>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label step-left">
+											<table style="display:<?php if (empty($v_backup_remote_adv)) echo 'none';?> ;" id="remote_backup">
+												<tr>
+													<td class="vst-text">
+														<?=_('Protocol');?> <a href="https://docs.hestiacp.com/admin_docs/backups.html"><i class="fas fa-question-circle"></i></a>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<select class="vst-list" name="v_backup_type" id="backup_type">
+															<option value='ftp'><?=_('ftp'); ?></option>
+															<option value='sftp' <?php if((!empty($v_backup_type)) && (trim($v_backup_type,"'")  == 'sftp' )) echo 'selected="selected"'; ?>><?=_('sftp'); ?></option>
+															<option value="b2" <?php if((!empty($v_backup_type)) && (trim($v_backup_type,"'")  == 'b2' )) echo 'selected="selected"'; ?>><?=_('Backblaze '); ?>
+														</select>
+														<br><br>
+													</td>
+												</tr>
+												<tr style="display: <?php if ((!empty($v_backup_type)) && !in_array(trim($v_backup_type, "'"),array('ftp','sftp'))){ echo 'none';} else {echo 'block';} ?>" id="backup_sftp">
+													<td>
+														<table>
+															<tr>
+																<td class="vst-text">
+																	<?=_('Host');?>
+																</td>
+															</tr>
+															<tr>
+																<td>
+																	<input type="text" size="20" class="vst-input" name="v_backup_host" value="<?=trim($v_backup_host, "'")?>">
+																	<br><br>
+																</td>
+															</tr>
+															<tr>
+																<td class="vst-text">
+																	<?=_('Port');?>
+																</td>
+															</tr>
+															<tr>
+																<td>
+																	<input type="text" size="20" class="vst-input" name="v_backup_port" value="<?=trim($v_backup_port, "'")?>">
+																	<br><br>
+																</td>
+															</tr>
+															<tr>
+																<td class="vst-text">
+																	<?=_('Username');?>
+																</td>
+															</tr>
+															<tr>
+																<td>
+																	<input type="text" size="20" class="vst-input" name="v_backup_username" value="<?=trim($v_backup_username, "'")?>">
+																	<br><br>
+																</td>
+															</tr>
+															<tr>
+																<td class="vst-text">
+																	<?=_('Password');?>
+																</td>
+															</tr>
+															<tr>
+																<td>
+																	<input type="text" size="20" class="vst-input" name="v_backup_password" value="<?=trim($v_backup_password, "'")?>">
+																	<br><br>
+																</td>
+															</tr>
+															<tr>
+																<td class="vst-text">
+																	<?=_('Directory');?>
+																</td>
+															</tr>
+															<tr>
+																<td>
+																	<input type="text" size="20" class="vst-input" name="v_backup_bpath" value="<?=trim($v_backup_bpath, "'")?>">
+																	<br><br>
+																</td>
+															</tr>
+														</table>
+													</td>
+												</tr>
+												<tr style="display: <?php if ((empty($v_backup_type)) || !in_array(trim($v_backup_type, "'"),array('b2'))){ echo 'none';} else {echo 'block';} ?>" id="backup_bucket">
+													<td>
+														<table>
+															<tr>
+																<td class="vst-text">
+																	<?=_('Bucket');?>
+																</td>
+															</tr>
+															<tr>
+																<td>
+																	<input type="text" size="20" class="vst-input" name="v_backup_bucket" value="<?=trim($v_backup_bucket, "'")?>">
+																	<br><br>
+																</td>
+															</tr>
+															<tr>
+																<td class="vst-text">
+																	<?=_('Application ID');?>
+																</td>
+															</tr>
+															<tr>
+																<td>
+																	<input type="text" size="20" class="vst-input" name="v_backup_application_id" value="<?=trim($v_backup_application_id, "'")?>">
+																	<br><br>
+																</td>
+															</tr>
+															<tr>
+																<td class="vst-text">
+																	<?=_('Application Key');?>
+																</td>
+															</tr>
+															<tr>
+																<td>
+																	<input type="text" size="20" class="vst-input" name="v_backup_application_key" value="<?=trim($v_backup_application_key, "'")?>">
+																	<br><br>
+																</td>
+															</tr>
+														</table>
+													</td>
+												</tr>
+											</table>
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label step-top advanced-options">
+								<a href="javascript:elementHideShow('ssl');" class="vst-text">
+									<i class="fas fa-lock"></i><b><?=_('Hestia SSL');?><img src="/images/arrow.png"></b>
+								</a>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label step-left">
+								<table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="ssl">
+									<tr>
+										<td class="vst-text step-top">
+											<?=_('SSL Certificate');?>
+											<span id="generate-csr"> / <a class="generate" target="_blank" href="/generate/ssl/?domain=<?=$v_hostname?>"><?=_('Generate CSR');?></a></span>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<textarea size="20" class="vst-textinput short console" name="v_ssl_crt"><?=htmlentities(trim($v_ssl_crt, "'"))?></textarea>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('SSL Key');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<textarea size="20" class="vst-textinput short console" name="v_ssl_key"><?=htmlentities(trim($v_ssl_key, "'"))?></textarea>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<table class="additional-info">
+												<tr>
+													<td>
+														<b><?=_('SUBJECT');?>:</b>
+													</td>
+													<td class="details">
+														<?=$v_ssl_subject?>
+													</td>
+												</tr>
+												<?php if ($v_ssl_aliases){?>
+													<tr>
+														<td>
+															<b><?=_('Aliases');?>:</b>
+														</td>
+														<td class="details">
+															<?=$v_ssl_aliases?>
+														</td>
+													</tr>
+												<?php } ?>
+												<tr>
+													<td>
+														<b><?=_('NOT_BEFORE');?>:</b>
+													</td>
+													<td class="details">
+														<?=$v_ssl_not_before?>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<b><?=_('NOT_AFTER');?>:</b>
+													</td>
+													<td class="details">
+														<?=$v_ssl_not_after?>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<b><?=_('SIGNATURE');?>:</b>
+													</td>
+													<td class="details">
+														<?=$v_ssl_signature?>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<b><?=_('PUB_KEY');?>:</b>
+													</td>
+													<td class="details">
+														<?=$v_ssl_pub_key?>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<b><?=_('ISSUER');?>:</b>
+													</td>
+													<td class="details">
+														<?=$v_ssl_issuer?>
+													</td>
+												</tr>
+											</table>
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label step-top advanced-options">
+								<a href="javascript:elementHideShow('security');" class="vst-text">
+									<i class="fas fa-key"></i><b><?=_('Security');?> <img src="/images/arrow.png"></b>
+								</a>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label step-left">
+								<table style="<?php if (empty($v_security_adv)) echo 'display:none;';?>" id="security">
+									<tr>
+										<td class="section-title" onclick="javascript:elementHideShow('security-system-table');">
+											<?=('System');?>
+										</td>
+										<td class="section-hide-button">
+											<a href="javascript:elementHideShow('security-system-table');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<table id="security-system-table" style="display: none;">
+												<td class="vst-text input-label step-top" style="font-size:1rem;padding-bottom:12px;">
+													<?=_('API');?>
+												</td>
+												<tr>
+													<td class="vst-text input-label">
+														<?=_('Enable API access');?>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<select class="vst-list" name="v_api" id="api">
+															<option value='yes'><?=_('yes'); ?></option>
+															<option value='no' <?php if($_SESSION['API'] == 'no') echo 'selected' ?>><?=_('no'); ?></option>
+														</select>
+														<br><br>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<table id="security_ip" style="<?php if ($_SESSION['API'] == "no") echo 'display:none;';?>">
+															<tr>
+																<td class="vst-text input-label">
+																	<?=_('Allowed IP addresses for API');?> <span class="optional" style="float:right">1 IP address per line</span>
+																</td>
+															</tr>
+															<tr>
+																<td>
+																	<textarea size="20" class="vst-textinput short" name="v_api_allowed_ip">
+																		<?php 
+																			foreach(explode(',',$_SESSION['API_ALLOWED_IP']) as $ip ){
+																				echo $ip."\n";
+																			}
+																		?>
+																	</textarea>
+																	<br><br>
+																</td>
+															</tr>
+														</table>
+													</td>
+												</tr>
+												<td class="vst-text input-label step-top" style="font-size:1rem;padding-bottom:12px;">
+													<?=_('Login');?>
+												</td>
+												<tr>
+													<td class="vst-text input-label">
+														<?=_('Login screen style');?>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<select class="vst-list" name="v_login_style">
+															<option value='default'><?=_('Default'); ?></option>
+															<option value='old' <?php if($_SESSION['LOGIN_STYLE'] == 'old') echo 'selected' ?>><?=_('Old Style'); ?></option>
+														</select>
+														<br><br>
+													</td>
+												</tr>
+												<tr>
+													<td class="vst-text input-label">
+														<?=_('Allow users to reset their passwords');?>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<select class="vst-list" name="v_policy_system_password_reset">
+															<option value='yes'><?=_('yes'); ?></option>
+															<option value='no' <?php if($_SESSION['POLICY_SYSTEM_PASSWORD_RESET'] == 'no') echo 'selected' ?>><?=_('no'); ?></option>
+														</select>
+														<br><br>
+													</td>
+												</tr>
+												<tr>
+													<td class="vst-text input-label">
+														<?=_('Inactive session timeout');?> (<?=_('Minutes');?>)
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<input type="text" size="20" class="vst-input" name="v_inactive_session_timeout" value="<?=trim($_SESSION['INACTIVE_SESSION_TIMEOUT'], "'")?>">
+														<br><br>
+													</td>
+												</tr>
+											</table>
+										</td>
+									</tr>
+									<?php if (($_SESSION['userContext'] === "admin") && ($_SESSION['user'] === 'admin')) {?>
+										<tr>
+											<td class="section-title" onclick="javascript:elementHideShow('security-sysadminprotect-table');">
+												<?=('System Protection');?>
+											</td>
+											<td class="section-hide-button">
+												<a href="javascript:elementHideShow('security-sysadminprotect-table');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
+											</td>
+										</tr>
+										<tr>
+											<td>
+												<table id="security-sysadminprotect-table" class="step-top" style="display: none;">
+													<tr>
+														<td class="vst-text input-label step-top" style="font-size:1rem;padding-bottom:12px;">
+															<?=_('System Administrator account');?>
+														</td>
 
-                            <tr>
-                                <td class="vst-text input-label step-top advanced-options">
-                                    <a href="javascript:elementHideShow('hestia');" class="vst-text">
-                                        <i class="fas fa-puzzle-piece"></i><b><?php print _('Hestia Control Panel Plugins');?> <img src="/images/arrow.png"></b>
-                                    </a>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label step-left">
-                                    <table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="hestia">
-                                        <tr>
-                                            <td class="vst-text step-top">
-                                                <?php print _('Quick App Installer');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_plugin_app_installer">
-                                                    <option value='false'><?php print _('no'); ?></option>
-                                                    <option value='true' <?php if($_SESSION['PLUGIN_APP_INSTALLER'] == 'true') echo 'selected' ?> ><?php print _('yes'); ?></option>
-                                                </select>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Filemanager');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_filemanager">
-                                                    <option value='false'><?php print _('no'); ?></option>
-                                                    <option value='true' <?php if($_SESSION['FILE_MANAGER'] == 'true') echo 'selected' ?> ><?php print _('yes'); ?></option>
-                                                </select>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('FileSystem Disk Quota');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_quota">
-                                                    <option value='no'><?php print _('no'); ?></option>
-                                                    <option value='yes' <?php if($_SESSION['DISK_QUOTA'] == 'yes') echo 'selected' ?> ><?php print _('yes'); ?></option>
-                                                </select>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <?php print _('Firewall');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <select class="vst-list" name="v_firewall">
-                                                    <option value='no'><?php print _('no'); ?></option>
-                                                    <option value='yes' <?php if($_SESSION['FIREWALL_SYSTEM'] == 'iptables') echo 'selected' ?> ><?php print _('yes'); ?></option>
-                                                </select>
-                                                <br><br>
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+													</tr>
+													<tr>
+														<td class="vst-text input-label">
+															<?=_('Restrict access to read-only for other administrators');?>
+														</td>
+													</tr>
+													<tr>
+														<td>
+															<select class="vst-list" name="v_policy_system_protected_admin">
+																<option value='yes'><?=_('yes'); ?></option>
+																<option value='no' <?php if($_SESSION['POLICY_SYSTEM_PROTECTED_ADMIN'] !== 'yes') echo 'selected' ?>><?=_('no'); ?></option>
+															</select>
+															<br><br>
+														</td>
+													</tr>
+													<tr>
+														<td class="vst-text input-label">
+															<?=_('Hide account from other administrators');?>
+														</td>
+													</tr>
+													<tr>
+														<td>
+															<select class="vst-list" name="v_policy_system_hide_admin">
+																<option value='yes'><?=_('yes'); ?></option>
+																<option value='no' <?php if($_SESSION['POLICY_SYSTEM_HIDE_ADMIN'] !== 'yes') echo 'selected' ?>><?=_('no'); ?></option>
+															</select>
+															<br><br>
+														</td>
+													</tr>
+													<tr>
+														<td class="vst-text input-label">
+															<?=_('Do not allow other administrators to access Server Settings');?>
+														</td>
+													</tr>
+													<tr>
+														<td>
+															<select class="vst-list" name="v_policy_system_hide_services">
+																<option value='yes'><?=_('yes'); ?></option>
+																<option value='no' <?php if($_SESSION['POLICY_SYSTEM_HIDE_SERVICES'] !== 'yes') echo 'selected' ?>><?=_('no'); ?></option>
+															</select>
+															<br><br>
+														</td>
+													</tr>
+												</table>
+											</td>
+										</tr>
+									<?php } ?>
+									<tr>
+										<td class="section-title" onclick="javascript:elementHideShow('security-policies-table');">
+											<?=('Policies');?>
+										</td>
+										<td class="section-hide-button">
+											<a href="javascript:elementHideShow('security-policies-table');"><i class="fas fa-minus-square status-icon dim maroon"></i></a>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<table id="security-policies-table" style="display: none;">
+												<tr>
+													<td class="vst-text input-label step-top" style="font-size:1rem;padding-bottom:12px;">
+														<?=_('Users');?>
+													</td>
+												</tr>
+												<?php if ($_SESSION['POLICY_SYSTEM_ENABLE_BACON'] === 'true') { ?>
+												<tr>
+													<td class="vst-text input-label">
+														<?=_('Allow suspended users to log in with read-only access');?> <span class="hint">(Preview)</span>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<select class="vst-list" name="v_policy_user_view_suspended">
+															<option value='yes' <?php if($_SESSION['POLICY_USER_VIEW_SUSPENDED'] !== 'no') echo 'selected' ?>><?=_('yes'); ?></option>
+															<option value='no' <?php if($_SESSION['POLICY_USER_VIEW_SUSPENDED'] == 'no') echo 'selected' ?>><?=_('no'); ?></option>
+														</select>
+														<br><br>
+													</td>
+												</tr>
+												<?php } ?>
+												<tr>
+													<td class="vst-text input-label">
+														<?=_('Allow users to edit their account details');?>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<select class="vst-list" name="v_policy_user_edit_details">
+															<option value='yes' <?php if($_SESSION['POLICY_USER_EDIT_DETAILS'] !== 'no') echo 'selected' ?>><?=_('yes'); ?></option>
+															<option value='no' <?php if($_SESSION['POLICY_USER_EDIT_DETAILS'] == 'no') echo 'selected' ?>><?=_('no'); ?></option>
+														</select>
+														<br><br>
+													</td>
+												</tr>
+												<tr>
+													<td class="vst-text input-label">
+														<?=_('Allow users to change templates when editing web domains');?>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<select class="vst-list" name="v_policy_user_edit_web_templates">
+															<option value='yes' <?php if($_SESSION['POLICY_USER_EDIT_WEB_TEMPLATES'] !== 'no') echo 'selected' ?>><?=_('yes'); ?></option>
+															<option value='no' <?php if($_SESSION['POLICY_USER_EDIT_WEB_TEMPLATES'] == 'no') echo 'selected' ?>><?=_('no'); ?></option>
+														</select>
+														<br><br>
+													</td>
+												</tr>
+												<tr>
+													<td class="vst-text input-label">
+														<?=_('Allow users to change templates when editing DNS zones');?>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<select class="vst-list" name="v_policy_user_edit_web_templates">
+															<option value='yes' <?php if($_SESSION['POLICY_USER_EDIT_DNS_TEMPLATES'] !== 'no') echo 'selected' ?>><?=_('yes'); ?></option>
+															<option value='no' <?php if($_SESSION['POLICY_USER_EDIT_DNS_TEMPLATES'] == 'no') echo 'selected' ?>><?=_('no'); ?></option>
+														</select>
+														<br><br>
+													</td>
+												</tr>
+												<tr>
+													<td class="vst-text input-label">
+														<?=_('Allow users to view action and login history logs');?>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<select class="vst-list" name="v_policy_user_view_logs">
+															<option value='yes' <?php if($_SESSION['POLICY_USER_VIEW_LOGS'] !== 'no') echo 'selected' ?>><?=_('yes'); ?></option>
+															<option value='no' <?php if($_SESSION['POLICY_USER_VIEW_LOGS'] == 'no') echo 'selected' ?>><?=_('no'); ?></option>
+														</select>
+														<br><br>
+													</td>
+												</tr>
+												<tr>
+													<td class="vst-text input-label">
+														<?=_('Allow users to delete log history');?>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<select class="vst-list" name="v_policy_user_delete_logs">
+															<option value='yes' <?php if($_SESSION['POLICY_USER_DELETE_LOGS'] !== 'no') echo 'selected' ?>><?=_('yes'); ?></option>
+															<option value='no' <?php if($_SESSION['POLICY_USER_DELETE_LOGS'] == 'no') echo 'selected' ?>><?=_('no'); ?></option>
+														</select>
+														<br><br>
+													</td>
+												</tr>
+												<tr>
+													<td class="vst-text input-label step-top" style="font-size:1rem;padding-bottom:12px;">
+														<?=_('Domains');?>
+													</td>
+												</tr>
+												<tr>
+													<td class="vst-text input-label">
+														<?=_('Enforce subdomain ownership');?>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<select class="vst-list" name="v_enforce_subdomain_ownership">
+															<option value='yes'><?=_('yes'); ?></option>
+															<option value='no' <?php if($_SESSION['ENFORCE_SUBDOMAIN_OWNERSHIP'] == 'no') echo 'selected' ?>><?=_('no'); ?></option>
+														</select>
+													</td>
+												</tr>
+											</table>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<br><br>
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label step-top advanced-options">
+								<a href="javascript:elementHideShow('hestia');" class="vst-text">
+									<i class="fas fa-puzzle-piece"></i><b><?=_('Hestia Control Panel Plugins');?> <img src="/images/arrow.png"></b>
+								</a>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label step-left">
+								<table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="hestia">
+									<tr>
+										<td class="vst-text step-top">
+											<?=_('Quick App Installer');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<select class="vst-list" name="v_plugin_app_installer">
+												<option value='false'><?=_('no'); ?></option>
+												<option value='true' <?php if($_SESSION['PLUGIN_APP_INSTALLER'] == 'true') echo 'selected' ?>><?=_('yes'); ?></option>
+											</select>
+											<br><br>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('Filemanager');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<select class="vst-list" name="v_filemanager">
+												<option value='false'><?=_('no'); ?></option>
+												<option value='true' <?php if($_SESSION['FILE_MANAGER'] == 'true') echo 'selected' ?>><?=_('yes'); ?></option>
+											</select>
+											<br><br>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('FileSystem Disk Quota');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<select class="vst-list" name="v_quota">
+												<option value='no'><?=_('no'); ?></option>
+												<option value='yes' <?php if($_SESSION['DISK_QUOTA'] == 'yes') echo 'selected' ?>><?=_('yes'); ?></option>
+											</select>
+											<br><br>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<?=_('Firewall');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<select class="vst-list" name="v_firewall">
+												<option value='no'><?=_('no'); ?></option>
+												<option value='yes' <?php if($_SESSION['FIREWALL_SYSTEM'] == 'iptables') echo 'selected' ?>><?=_('yes'); ?></option>
+											</select>
+											<br><br>
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 82 - 80
web/templates/pages/edit_server_bind9.html

@@ -1,83 +1,85 @@
-    <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/server/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-          </div>
-      </div>
-    </div>
+<!-- Begin toolbar -->
+<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/server/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-            $back = $_SESSION['back'];
-            if (empty($back)) {
-                $back = "location.href='/list/server/'";
-            } else {
-                $back = "location.href='".$back."'";
-            }
-        ?>
-        <form id="vstobjects" name="v_configure_server" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="save" value="save" />
+<div class="l-center animated fadeIn">
 
-            <table class="data mode-add">
-                <tr class="data-add">
-                    <td class="data-dotted">
-                        <table class="data-col1">
-                            <tr><td></td></tr>
-                        </table>
-                    </td>
-                    <td>
-                        <table class="data-col2" width="600px">
-                            <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Configuring Server')?>: <?php print $v_service_name ?></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 $v_options_path ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput console" name="v_options"><?=$v_options?></textarea>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text step-top">
-                                    <?=$v_config_path?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput console" name="v_config"><?=$v_config?></textarea>
-                                </td>
-                            </tr>
-                            <td class="vst-text input-label" style="text-transform: capitalize;">
-                                <label><input type="checkbox" size="20" class="vst-checkbox" name="v_restart" checked="yes"><?php print _('restart');?></label>
-                            </td>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+	<form id="vstobjects" name="v_configure_server" method="post">
+		<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+		<input type="hidden" name="save" value="save" />
+
+		<table class="data mode-add">
+			<tr class="data-add">
+				<td class="data-dotted">
+					<table class="data-col1">
+						<tr>
+							<td></td>
+						</tr>
+					</table>
+				</td>
+				<td>
+					<table class="data-col2" width="600px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Configuring Server');?>: <?=$v_service_name;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=$v_options_path;?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea class="vst-textinput console" name="v_options"><?=$v_options;?></textarea>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=$v_config_path;?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea class="vst-textinput console" name="v_config"><?=$v_config;?></textarea>
+							</td>
+						</tr>
+						<td class="vst-text input-label" style="text-transform: capitalize;">
+							<label><input type="checkbox" size="20" class="vst-checkbox" name="v_restart" checked="yes"><?=_('restart');?></label>
+						</td>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 153 - 155
web/templates/pages/edit_server_dovecot.html

@@ -1,159 +1,157 @@
-    <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/server/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-        </div>
-      </div>
-    </div>
+<!-- Begin toolbar -->
+<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/server/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
-  
-    <div class="l-center animated fadeIn">
-        <?php
-            $back = $_SESSION['back'];
-            if (empty($back)) {
-                $back = "location.href='/list/server/'";
-            } else {
-                $back = "location.href='".$back."'";
-            }
-        ?>
-        <form id="vstobjects" name="v_configure_server" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="save" value="save" />
+<div class="l-separator"></div>
 
-            <table class="data mode-add">
-                <tr class="data-add">
-                    <td class="data-dotted">
-                        <table class="data-col1">
-                            <tr><td></td></tr>
-                        </table>
-                    </td>
-                    <td>
-                        <table class="data-col2" width="600px">
-                            <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Configuring Server')?>: <?php print $v_service_name ?></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">
-                                    <?=$v_config_path ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput console" name="v_config"><?=$v_config?></textarea>
-                                </td>
-                            </tr>
-                            <?php if (!empty($v_config_path1)) {
-                            ?>
-                            <tr>
-                                <td class="vst-text step-top">
-                                    <?=$v_config_path1 ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput console" name="v_config1"><?=$v_config1?></textarea>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text step-top">
-                                    <?=$v_config_path2?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput console" name="v_config2"><?=$v_config2?></textarea>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text step-top">
-                                    <?=$v_config_path3 ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput console" name="v_config3"><?=$v_config3?></textarea>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text step-top">
-                                    <?=$v_config_path4 ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput console" name="v_config4"><?=$v_config4?></textarea>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text step-top">
-                                    <?=$v_config_path5 ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput console" name="v_config5"><?=$v_config5?></textarea>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text step-top">
-                                    <?=$v_config_path6 ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput console" name="v_config6"><?=$v_config6?></textarea>
-                                </td>
-                            </tr>
+<div class="l-center animated fadeIn">
 
-                            <tr>
-                                <td class="vst-text step-top">
-                                    <?=$v_config_path7 ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput console" name="v_config7"><?=$v_config7?></textarea>
-                                </td>
-                            </tr>
+	<form id="vstobjects" name="v_configure_server" method="post">
+		<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+		<input type="hidden" name="save" value="save" />
 
-                            <tr>
-                                <td class="vst-text step-top">
-                                    <?=$v_config_path8 ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput console" name="v_config8"><?=$v_config8?></textarea>
-                                </td>
-                            </tr>
-                            <?php } ?>
-                            
-                            <td class="vst-text input-label" style="text-transform: capitalize;">
-                                <label><input type="checkbox" size="20" class="vst-checkbox" name="v_restart" checked="yes"><?php print _('restart');?></label>
-                            </td>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+		<table class="data mode-add">
+			<tr class="data-add">
+				<td class="data-dotted">
+					<table class="data-col1">
+						<tr>
+							<td></td>
+						</tr>
+					</table>
+				</td>
+				<td>
+					<table class="data-col2" width="600px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Configuring Server');?>: <?=$v_service_name;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=$v_config_path;?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea class="vst-textinput console" name="v_config"><?=$v_config?></textarea>
+							</td>
+						</tr>
+						<?php if (!empty($v_config_path1)) { ?>
+							<tr>
+								<td class="vst-text step-top">
+									<?=$v_config_path1;?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<textarea class="vst-textinput console" name="v_config1"><?=$v_config1?></textarea>
+								</td>
+							</tr>
+							<tr>
+								<td class="vst-text step-top">
+									<?=$v_config_path2;?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<textarea class="vst-textinput console" name="v_config2"><?=$v_config2?></textarea>
+								</td>
+							</tr>
+							<tr>
+								<td class="vst-text step-top">
+									<?=$v_config_path3;?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<textarea class="vst-textinput console" name="v_config3"><?=$v_config3?></textarea>
+								</td>
+							</tr>
+							<tr>
+								<td class="vst-text step-top">
+									<?=$v_config_path4;?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<textarea class="vst-textinput console" name="v_config4"><?=$v_config4?></textarea>
+								</td>
+							</tr>
+							<tr>
+								<td class="vst-text step-top">
+									<?=$v_config_path5;?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<textarea class="vst-textinput console" name="v_config5"><?=$v_config5?></textarea>
+								</td>
+							</tr>
+							<tr>
+								<td class="vst-text step-top">
+									<?=$v_config_path6;?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<textarea class="vst-textinput console" name="v_config6"><?=$v_config6?></textarea>
+								</td>
+							</tr>
+							<tr>
+								<td class="vst-text step-top">
+									<?=$v_config_path7;?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<textarea class="vst-textinput console" name="v_config7"><?=$v_config7?></textarea>
+								</td>
+							</tr>
+							<tr>
+								<td class="vst-text step-top">
+									<?=$v_config_path8;?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<textarea class="vst-textinput console" name="v_config8"><?=$v_config8?></textarea>
+								</td>
+							</tr>
+						<?php } ?>
+						<td class="vst-text input-label" style="text-transform: capitalize;">
+							<label><input type="checkbox" size="20" class="vst-checkbox" name="v_restart" checked="yes"><?=_('restart');?></label>
+						</td>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 76 - 74
web/templates/pages/edit_server_httpd.html

@@ -1,76 +1,78 @@
-    <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/server/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-          <a href="/edit/server/php/" class="ui-button cancel" dir="ltr"><i class="fas fa-pencil-alt status-icon orange"></i><?=_('Configure')?> PHP</a>
-        </div>
-        <div class="l-unit-toolbar__buttonstrip float-right">
-            <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>
+<!-- Begin toolbar -->
+<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/server/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+			<a href="/edit/server/php/" class="ui-button cancel" dir="ltr"><i class="fas fa-pencil-alt status-icon orange"></i><?=_('Configure');?> PHP</a>
+		</div>
+		<div class="l-unit-toolbar__buttonstrip float-right">
+			<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>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
-  
-    <div class="l-center animated fadeIn">
-        <?php
-            $back = $_SESSION['back'];
-            if (empty($back)) {
-                $back = "location.href='/list/server/'";
-            } else {
-                $back = "location.href='".$back."'";
-            }
-        ?>
-        <form id="vstobjects" name="v_configure_server" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="save" value="save" />
+<div class="l-separator"></div>
 
-            <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" width="600px">
-                          <tr class="step-top">
-                            <td class="step-top">
-                              <span class="page-title"><?=_('Configuring Server')?>: <?php print $v_service_name ?></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 $v_config_path ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput console" name="v_config"><?=$v_config?></textarea>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label" style="text-transform: capitalize;">
-                                    <label><input type="checkbox" size="20" class="vst-checkbox" name="v_restart" checked="yes"><?php print _('restart');?></label>
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+<div class="l-center animated fadeIn">
+
+	<form id="vstobjects" name="v_configure_server" method="post">
+		<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+		<input type="hidden" name="save" value="save" />
+
+		<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" width="600px">
+						<tr class="step-top">
+							<td class="step-top">
+								<span class="page-title"><?=_('Configuring Server');?>: <?=$v_service_name;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=$v_config_path;?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea class="vst-textinput console" name="v_config"><?=$v_config;?></textarea>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label" style="text-transform: capitalize;">
+								<label><input type="checkbox" size="20" class="vst-checkbox" name="v_restart" checked="yes"><?=_('restart');?></label>
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 142 - 140
web/templates/pages/edit_server_mysql.html

@@ -1,144 +1,146 @@
-    <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/server/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-        </div>
-      </div>
-    </div>
+<!-- Begin toolbar -->
+<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/server/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-            $back = $_SESSION['back'];
-            if (empty($back)) {
-                $back = "location.href='/list/server/'";
-            } else {
-                $back = "location.href='".$back."'";
-            }
-        ?>
-        <form id="vstobjects" name="v_configure_server" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="save" value="save" />
+<div class="l-center animated fadeIn">
 
-            <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" width="600px"  id="basic-options">
-                            <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Configuring Server')?>: <?php print $v_service_name ?></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">
-                                    max_connections
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="max_connections" prev_value="<?=htmlentities($v_max_connections)?>" name="v_max_connections" value="<?=htmlentities($v_max_connections)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text">
-                                    max_user_connections
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="max_user_connections" prev_value="<?=htmlentities($v_max_user_connections)?>" name="v_max_user_connections" value="<?=htmlentities($v_max_user_connections)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text">
-                                    wait_timeout
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="wait_timeout" prev_value="<?=htmlentities($v_wait_timeout)?>" name="v_wait_timeout" value="<?=htmlentities($v_wait_timeout)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
+	<form id="vstobjects" name="v_configure_server" method="post">
+		<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+		<input type="hidden" name="save" value="save" />
 
-                            <tr>
-                                <td class="vst-text">
-                                    interactive_timeout
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="interactive_timeout" prev_value="<?=htmlentities($v_interactive_timeout)?>" name="v_interactive_timeout" value="<?=htmlentities($v_interactive_timeout)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text">
-                                    max_allowed_packet
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="max_allowed_packet" prev_value="<?=htmlentities($v_max_allowed_packet)?>" name="v_display_errors" value="<?=htmlentities($v_max_allowed_packet)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
-                            <tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <a href="javascript:toggleOptions();" class="vst-advanced"><?=_('Advanced options')?></a>
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2" width="600px" style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="advanced-options">
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <a href="javascript:toggleOptions();" class="vst-advanced"><?=_('Basic options')?></a>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text step-top">
-                                    <?=$v_config_path?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput console" name="v_config"><?=$v_config?></textarea>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label" style="text-transform: capitalize;">
-                                    <label><input type="checkbox" size="20" class="vst-checkbox" name="v_restart" checked="yes"><?php print _('restart');?></label>
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+		<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" width="600px" id="basic-options">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Configuring Server');?>: <?=$v_service_name;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								max_connections
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="max_connections" prev_value="<?=htmlentities($v_max_connections)?>" name="v_max_connections" value="<?=htmlentities($v_max_connections)?>">
+								<br><br>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text">
+								max_user_connections
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="max_user_connections" prev_value="<?=htmlentities($v_max_user_connections)?>" name="v_max_user_connections" value="<?=htmlentities($v_max_user_connections)?>">
+								<br><br>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text">
+								wait_timeout
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="wait_timeout" prev_value="<?=htmlentities($v_wait_timeout)?>" name="v_wait_timeout" value="<?=htmlentities($v_wait_timeout)?>">
+								<br><br>
+							</td>
+						</tr>
+
+						<tr>
+							<td class="vst-text">
+								interactive_timeout
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="interactive_timeout" prev_value="<?=htmlentities($v_interactive_timeout)?>" name="v_interactive_timeout" value="<?=htmlentities($v_interactive_timeout)?>">
+								<br><br>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text">
+								max_allowed_packet
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="max_allowed_packet" prev_value="<?=htmlentities($v_max_allowed_packet)?>" name="v_display_errors" value="<?=htmlentities($v_max_allowed_packet)?>">
+								<br><br>
+							</td>
+						</tr>
+						<tr>
+						<tr>
+							<td class="vst-text input-label">
+								<a href="javascript:toggleOptions();" class="vst-advanced"><?=_('Advanced options');?></a>
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2" width="600px" style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="advanced-options">
+						<tr>
+							<td class="vst-text input-label">
+								<a href="javascript:toggleOptions();" class="vst-advanced"><?=_('Basic options');?></a>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=$v_config_path;?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea class="vst-textinput console" name="v_config"><?=$v_config;?></textarea>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label" style="text-transform: capitalize;">
+								<label><input type="checkbox" size="20" class="vst-checkbox" name="v_restart" checked="yes"><?=_('restart');?></label>
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 197 - 195
web/templates/pages/edit_server_nginx.html

@@ -1,202 +1,204 @@
-    <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/server/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-            <a href="/edit/server/php/" class="ui-button cancel" dir="ltr"><i class="fas fa-pencil-alt status-icon orange"></i> <?=_('Configure')?> PHP</a>
-        </div>
-        <div class="l-unit-toolbar__buttonstrip float-right">
-                <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>
+<!-- Begin toolbar -->
+<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/server/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+			<a href="/edit/server/php/" class="ui-button cancel" dir="ltr"><i class="fas fa-pencil-alt status-icon orange"></i> <?=_('Configure');?> PHP</a>
+		</div>
+		<div class="l-unit-toolbar__buttonstrip float-right">
+			<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>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-            $back = $_SESSION['back'];
-            if (empty($back)) {
-                $back = "location.href='/list/server/'";
-            } else {
-                $back = "location.href='".$back."'";
-            }
-        ?>
-        <form id="vstobjects" name="v_configure_server" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="save" value="save" />
+<div class="l-center animated fadeIn">
 
-            <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" width="600px"  id="basic-options">
-                            <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Configuring Server')?>: <?php print $v_service_name ?></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">
-                                    worker_processes
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="worker_processes" prev_value="<?=htmlentities($v_worker_processes)?>" name="v_worker_processes" value="<?=htmlentities($v_worker_processes)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text">
-                                    worker_connections
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="worker_connections" prev_value="<?=htmlentities($v_worker_connections)?>" name="v_worker_connections" value="<?=htmlentities($v_worker_connections)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text">
-                                    client_max_body_size
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="client_max_body_size" prev_value="<?=htmlentities($v_client_max_body_size)?>" name="v_client_max_body_size" value="<?=htmlentities($v_client_max_body_size)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
+	<form id="vstobjects" name="v_configure_server" method="post">
+		<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+		<input type="hidden" name="save" value="save" />
 
-                            <tr>
-                                <td class="vst-text">
-                                    send_timeout
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="send_timeout" prev_value="<?=htmlentities($v_send_timeout)?>" name="v_send_timeout"  value="<?=htmlentities($v_send_timeout)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text">
-                                    proxy_connect_timeout
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="proxy_connect_timeout" prev_value="<?=htmlentities($v_proxy_connect_timeout)?>" name="v_proxy_connect_timeout" value="<?=htmlentities($v_proxy_connect_timeout)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text">
-                                    proxy_send_timeout
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="proxy_send_timeout" prev_value="<?=htmlentities($v_proxy_send_timeout)?>" name="v_proxy_send_timeout" value="<?=htmlentities($v_proxy_send_timeout)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text">
-                                    proxy_read_timeout
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="proxy_read_timeout" prev_value="<?=htmlentities($v_proxy_read_timeout)?>" name="v_proxy_read_timeout" value="<?=htmlentities($v_proxy_read_timeout)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text">
-                                    gzip
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="gzip" prev_value="<?=htmlentities($v_gzip)?>" name="v_gzip" value="<?=htmlentities($v_gzip)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text">
-                                    gzip_comp_level
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="gzip_comp_level" prev_value="<?=htmlentities($v_gzip_comp_level)?>" name="v_gzip_comp_level" value="<?=htmlentities($v_gzip_comp_level)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text">
-                                    charset
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="charset" prev_value="<?=htmlentities($v_charset)?>" name="v_charset" value="<?=htmlentities($v_charset)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <a href="javascript:toggleOptions();" class="vst-advanced"><?php print _('Advanced options');?></a>
-                                </td>
-                            </tr>
-                        </table>
+		<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" width="600px" id="basic-options">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Configuring Server');?>: <?=$v_service_name;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								worker_processes
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="worker_processes" prev_value="<?=htmlentities($v_worker_processes)?>" name="v_worker_processes" value="<?=htmlentities($v_worker_processes)?>">
+								<br><br>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text">
+								worker_connections
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="worker_connections" prev_value="<?=htmlentities($v_worker_connections)?>" name="v_worker_connections" value="<?=htmlentities($v_worker_connections)?>">
+								<br><br>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text">
+								client_max_body_size
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="client_max_body_size" prev_value="<?=htmlentities($v_client_max_body_size)?>" name="v_client_max_body_size" value="<?=htmlentities($v_client_max_body_size)?>">
+								<br><br>
+							</td>
+						</tr>
 
-                        <table class="data-col2" width="600px" style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="advanced-options">
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <a href="javascript:toggleOptions();" class="vst-advanced"><?php print _('Basic options');?></a>
-                                </td>
-                            </tr>
+						<tr>
+							<td class="vst-text">
+								send_timeout
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="send_timeout" prev_value="<?=htmlentities($v_send_timeout)?>" name="v_send_timeout" value="<?=htmlentities($v_send_timeout)?>">
+								<br><br>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text">
+								proxy_connect_timeout
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="proxy_connect_timeout" prev_value="<?=htmlentities($v_proxy_connect_timeout)?>" name="v_proxy_connect_timeout" value="<?=htmlentities($v_proxy_connect_timeout)?>">
+								<br><br>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text">
+								proxy_send_timeout
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="proxy_send_timeout" prev_value="<?=htmlentities($v_proxy_send_timeout)?>" name="v_proxy_send_timeout" value="<?=htmlentities($v_proxy_send_timeout)?>">
+								<br><br>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text">
+								proxy_read_timeout
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="proxy_read_timeout" prev_value="<?=htmlentities($v_proxy_read_timeout)?>" name="v_proxy_read_timeout" value="<?=htmlentities($v_proxy_read_timeout)?>">
+								<br><br>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text">
+								gzip
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="gzip" prev_value="<?=htmlentities($v_gzip)?>" name="v_gzip" value="<?=htmlentities($v_gzip)?>">
+								<br><br>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text">
+								gzip_comp_level
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="gzip_comp_level" prev_value="<?=htmlentities($v_gzip_comp_level)?>" name="v_gzip_comp_level" value="<?=htmlentities($v_gzip_comp_level)?>">
+								<br><br>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text">
+								charset
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="charset" prev_value="<?=htmlentities($v_charset)?>" name="v_charset" value="<?=htmlentities($v_charset)?>">
+								<br><br>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<a href="javascript:toggleOptions();" class="vst-advanced"><?=_('Advanced options');?></a>
+							</td>
+						</tr>
+					</table>
 
-                            <tr>
-                                <td class="vst-text step-top">
-                                    <?=$v_config_path ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput console" name="v_config"><?=$v_config?></textarea>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label" style="text-transform: capitalize;">
-                                    <label><input type="checkbox" size="20" class="vst-checkbox" name="v_restart" checked="yes"><?php print _('restart');?></label>
-                                </td>
-                            </tr>
-                        </table>
+					<table class="data-col2" width="600px" style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="advanced-options">
+						<tr>
+							<td class="vst-text input-label">
+								<a href="javascript:toggleOptions();" class="vst-advanced"><?=_('Basic options');?></a>
+							</td>
+						</tr>
 
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+						<tr>
+							<td class="vst-text step-top">
+								<?=$v_config_path;?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea class="vst-textinput console" name="v_config"><?=$v_config;?></textarea>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label" style="text-transform: capitalize;">
+								<label><input type="checkbox" size="20" class="vst-checkbox" name="v_restart" checked="yes"><?=_('restart');?></label>
+							</td>
+						</tr>
+					</table>
+
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 82 - 80
web/templates/pages/edit_server_pgsql.html

@@ -1,84 +1,86 @@
-    <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/server/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-        </div>
-      </div>
-    </div>
+<!-- Begin toolbar -->
+<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/server/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-            $back = $_SESSION['back'];
-            if (empty($back)) {
-                $back = "location.href='/list/server/'";
-            } else {
-                $back = "location.href='".$back."'";
-            }
-        ?>
-        <form id="vstobjects" name="v_configure_server" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="save" value="save" />
+<div class="l-center animated fadeIn">
 
-            <table class="data mode-add">
-                <tr class="data-add">
-                    <td class="data-dotted">
-                        <table class="data-col1">
-                            <tr><td></td></tr>
-                        </table>
-                    </td>
-                    <td>
-                        <table class="data-col2" width="600px">
-                            <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Configuring Server')?>: <?php print $v_service_name ?></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">
-                                    <?=$v_options_path ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput console" name="v_options"><?=$v_options?></textarea>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text step-top">
-                                    <?=$v_config_path ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput console" name="v_config"><?=$v_config?></textarea>
-                                </td>
-                            </tr>
-                            <td class="vst-text input-label" style="text-transform: capitalize;">
-                                <label><input type="checkbox" size="20" class="vst-checkbox" name="v_restart" checked="yes"><?php print _('restart');?></label>
-                            </td>
-                        </table>
+	<form id="vstobjects" name="v_configure_server" method="post">
+		<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+		<input type="hidden" name="save" value="save" />
 
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+		<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" width="600px" id="basic-options">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Configuring Server');?>: <?=$v_service_name;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=$v_options_path;?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea class="vst-textinput console" name="v_options"><?=$v_options;?></textarea>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=$v_config_path;?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea class="vst-textinput console" name="v_config"><?=$v_config;?></textarea>
+							</td>
+						</tr>
+						<td class="vst-text input-label" style="text-transform: capitalize;">
+							<label><input type="checkbox" size="20" class="vst-checkbox" name="v_restart" checked="yes"><?=_('restart');?></label>
+						</td>
+					</table>
+
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 161 - 159
web/templates/pages/edit_server_php.html

@@ -1,165 +1,167 @@
-    <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/server/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-        </div>
-      </div>
-    </div>
+<!-- Begin toolbar -->
+<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/server/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-            $back = $_SESSION['back'];
-            if (empty($back)) {
-                $back = "location.href='/list/server/'";
-            } else {
-                $back = "location.href='".$back."'";
-            }
-        ?>
-        <form id="vstobjects" name="v_configure_server" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="save" value="save" />
+<div class="l-center animated fadeIn">
 
-            <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" width="600px"  id="basic-options">
-                            <tr>
-                                <td class="step-top">
-                                    <span class="page-title"><?=_('Configuring Server')?>: PHP</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">
-                                    max_execution_time
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="max_execution_time" prev_value="<?=htmlentities($v_max_execution_time)?>" name="v_max_execution_time" value="<?=htmlentities($v_max_execution_time)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text">
-                                    max_input_time
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="max_input_time" prev_value="<?=htmlentities($v_max_input_time)?>" name="v_worker_connections" value="<?=htmlentities($v_max_input_time)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text">
-                                    memory_limit
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="memory_limit" prev_value="<?=htmlentities($v_memory_limit)?>" name="v_memory_limit" value="<?=htmlentities($v_memory_limit)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
+	<form id="vstobjects" name="v_configure_server" method="post">
+		<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+		<input type="hidden" name="save" value="save" />
 
-                            <tr>
-                                <td class="vst-text">
-                                    error_reporting
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="error_reporting" prev_value="<?=htmlentities($v_error_reporting)?>" name="v_error_reporting" value="<?=htmlentities($v_error_reporting)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text">
-                                    display_errors
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="display_errors" prev_value="<?=htmlentities($v_display_errors)?>" name="v_display_errors" value="<?=htmlentities($v_display_errors)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text">
-                                    post_max_size
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="post_max_size" prev_value="<?=htmlentities($v_post_max_size)?>" name="v_post_max_size" value="<?=htmlentities($v_post_max_size)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text">
-                                    upload_max_filesize
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" regexp="upload_max_filesize" prev_value="<?=htmlentities($v_upload_max_filesize)?>" name="v_upload_max_filesize" value="<?=htmlentities($v_upload_max_filesize)?>">
-                                    <br><br>
-                                </td>
-                            </tr>
+		<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" width="600px" id="basic-options">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Configuring Server');?>: PHP</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								max_execution_time
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="max_execution_time" prev_value="<?=htmlentities($v_max_execution_time)?>" name="v_max_execution_time" value="<?=htmlentities($v_max_execution_time)?>">
+								<br><br>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text">
+								max_input_time
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="max_input_time" prev_value="<?=htmlentities($v_max_input_time)?>" name="v_worker_connections" value="<?=htmlentities($v_max_input_time)?>">
+								<br><br>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text">
+								memory_limit
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="memory_limit" prev_value="<?=htmlentities($v_memory_limit)?>" name="v_memory_limit" value="<?=htmlentities($v_memory_limit)?>">
+								<br><br>
+							</td>
+						</tr>
 
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <a href="javascript:toggleOptions();" class="vst-advanced"><?=_('Advanced options')?></a>
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2" width="600px" style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="advanced-options">
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <a href="javascript:toggleOptions();" class="vst-advanced"><?=_('Basic options')?></a>
-                                </td>
-                            </tr>
+						<tr>
+							<td class="vst-text">
+								error_reporting
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="error_reporting" prev_value="<?=htmlentities($v_error_reporting)?>" name="v_error_reporting" value="<?=htmlentities($v_error_reporting)?>">
+								<br><br>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text">
+								display_errors
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="display_errors" prev_value="<?=htmlentities($v_display_errors)?>" name="v_display_errors" value="<?=htmlentities($v_display_errors)?>">
+								<br><br>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text">
+								post_max_size
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="post_max_size" prev_value="<?=htmlentities($v_post_max_size)?>" name="v_post_max_size" value="<?=htmlentities($v_post_max_size)?>">
+								<br><br>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text">
+								upload_max_filesize
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" regexp="upload_max_filesize" prev_value="<?=htmlentities($v_upload_max_filesize)?>" name="v_upload_max_filesize" value="<?=htmlentities($v_upload_max_filesize)?>">
+								<br><br>
+							</td>
+						</tr>
 
-                            <tr>
-                                <td class="vst-text step-top">
-                                    <?=$v_config_path ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput console" name="v_config"><?=$v_config?></textarea>
-                                </td>
-                            </tr>
-                            <td class="vst-text input-label" style="text-transform: capitalize;">
-                                <label><input type="checkbox" size="20" class="vst-checkbox" name="v_restart" checked="yes"><?php print _('restart');?></label>
-                            </td>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+						<tr>
+							<td class="vst-text input-label">
+								<a href="javascript:toggleOptions();" class="vst-advanced"><?=_('Advanced options');?></a>
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2" width="600px" style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="advanced-options">
+						<tr>
+							<td class="vst-text input-label">
+								<a href="javascript:toggleOptions();" class="vst-advanced"><?=_('Basic options');?></a>
+							</td>
+						</tr>
+
+						<tr>
+							<td class="vst-text step-top">
+								<?=$v_config_path;?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea class="vst-textinput console" name="v_config"><?=$v_config;?></textarea>
+							</td>
+						</tr>
+						<td class="vst-text input-label" style="text-transform: capitalize;">
+							<label><input type="checkbox" size="20" class="vst-checkbox" name="v_restart" checked="yes"><?=_('restart');?></label>
+						</td>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 73 - 72
web/templates/pages/edit_server_service.html

@@ -1,76 +1,77 @@
-    <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/server/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save')?></a>
-        </div>
-      </div>
-    </div>
+<!-- Begin toolbar -->
+<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/server/"><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" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-        <?php
-            $back = $_SESSION['back'];
-            if (empty($back)) {
-                $back = "location.href='/list/server/'";
-            } else {
-                $back = "location.href='".$back."'";
-            }
-        ?>
+<div class="l-center animated fadeIn">
 
-        <form id="vstobjects" name="v_configure_server" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="save" value="save" />
+	<form id="vstobjects" name="v_configure_server" method="post">
+		<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+		<input type="hidden" name="save" value="save" />
 
-            <table class="data mode-add">
-                <tr class="data-add">
-                    <td class="data-dotted">
-                        <table class="data-col1">
-                            <tr><td></td></tr>
-                        </table>
-                    </td>
-                    <td>
-                        <table class="data-col2" width="600px">
-                          <tr>
-                            <td class="step-top">
-                                <span class="page-title"><?=_('Configuring Server')?>: <?php print $v_service_name ?></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">
-                                    <?=$v_config_path ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea class="vst-textinput console" name="v_config"><?=$v_config?></textarea>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label" style="text-transform: capitalize;">
-                                    <label><input type="checkbox" size="20" class="vst-checkbox" name="v_restart" checked="yes"><?php print _('restart');?></label>
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+		<table class="data mode-add">
+			<tr class="data-add">
+				<td class="data-dotted">
+					<table class="data-col1">
+						<tr>
+							<td></td>
+						</tr>
+					</table>
+				</td>
+				<td>
+					<table class="data-col2" width="600px">
+						<tr>
+							<td class="step-top">
+								<span class="page-title"><?=_('Configuring Server');?>: <?=$v_service_name;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=$v_config_path;?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea class="vst-textinput console" name="v_config"><?=$v_config;?></textarea>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label" style="text-transform: capitalize;">
+								<label><input type="checkbox" size="20" class="vst-checkbox" name="v_restart" checked="yes"><?=_('restart');?></label>
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 429 - 428
web/templates/pages/edit_user.html

@@ -1,433 +1,434 @@
+<!-- Begin toolbar -->
 <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>
-            <?php if (($_SESSION['userContext'] === 'admin') && (!isset($_SESSION['look'])) && ($_SESSION['user'] !== $v_username)) {
-                $ssh_key_url = "/list/key/?user=".$user."&token=".$_SESSION['token']."";
-                $log_url = "/list/log/?user=".$user."&token=".$_SESSION['token']."";
-            } else {
-                $ssh_key_url = "/list/key/";
-                $log_url = "/list/log/";
-            } ?>
-                <a href="<?php echo $ssh_key_url; ?>" 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>
+	<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>
+			<?php 
+				if (($_SESSION['userContext'] === 'admin') && (!isset($_SESSION['look'])) && ($_SESSION['user'] !== $v_username)) {
+					$ssh_key_url = "/list/key/?user=".$user."&token=".$_SESSION['token']."";
+					$log_url = "/list/log/?user=".$user."&token=".$_SESSION['token']."";
+				} else {
+					$ssh_key_url = "/list/key/";
+					$log_url = "/list/log/";
+				} 
+			?>
+			<a href="<?=$ssh_key_url; ?>" 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>
+			<?php if (($_SESSION['userContext'] == 'admin') || ($_SESSION['userContext'] !== 'admin') && ($_SESSION['POLICY_USER_VIEW_LOGS'] !== 'no')) {?>
+				<a href="<?=$log_url; ?>" id="btn-create" class="ui-button cancel" dir="ltr" title="<?=_('Logs');?>"><i class="fas fa-history status-icon maroon"></i><?=_('Logs');?></a>
+			<?php } ?>
+		</div>
+		<div class="l-unit-toolbar__buttonstrip float-right">
+			<?php 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="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>
+			<?php } ?>
+			<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>
+<!-- End toolbar -->
 
-                <? if (($_SESSION['userContext'] == 'admin') || ($_SESSION['userContext'] !== 'admin') && ($_SESSION['POLICY_USER_VIEW_LOGS'] !== 'no')) {?>
-                    <a href="<?php echo $log_url; ?>" 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="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-separator"></div>
+<div class="l-center animated fadeIn">
 
-    <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" />
+	<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, "'"))?>" <? if (($_SESSION['userContext'] !== 'admin') && ($_SESSION['POLICY_USER_EDIT_DETAILS'] !== 'yes')) { echo 'disabled'; }?> >
-                                    <? if (($_SESSION['userContext'] !== 'admin') && ($_SESSION['POLICY_USER_EDIT_DETAILS'] !== 'yes')) {?>
-                                        <input type="hidden" 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, "'"))?>" <? if (($_SESSION['userContext'] !== 'admin') && ($_SESSION['POLICY_USER_EDIT_DETAILS'] !== 'yes')) { echo 'disabled'; }?>>
-                                    <? if (($_SESSION['userContext'] !== 'admin') && ($_SESSION['POLICY_USER_EDIT_DETAILS'] !== 'yes')) {?>
-                                        <input type="hidden" 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>
-                                    <table id="password-details">
-                                        <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>
-                                        <? if ($_SESSION['userContext'] === 'admin') {?>
-                                            <tr>
-                                                <td>
-                                                    <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>
-                                                </td>
-                                            </tr>
-                                        <? } ?>
-                                        <tr>
-                                            <td id="password-options" style="<?php if ($data[$user]['LOGIN_DISABLED'] == "yes") { echo 'display: none;'; } else { echo 'display: table-cell;'; }?>">
-                                                <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 id="password-options-ip" style="<?php if ($data[$user]['LOGIN_DISABLED'] == "yes") { echo 'display: none;'; } else { echo 'display: table-cell;'; }?>">
-                                                <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>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <table id="ip-allowlist" style="<? if ($data[$user]['LOGIN_USE_IPLIST'] === 'yes') { echo 'display: table-cell;'; } else { echo 'display: none;'; } ?>">
-                                                    <tr>
-                                                        <td>
-                                                            <input type="text" size="20" class="vst-input" placeholder="<?=_('Example: 127.0.0.1,192.168.1.100');?>" name="v_login_allowed_ips" value="<?=htmlentities(trim($v_login_allowed_ips, "'"))?>">
-                                                        </td>
-                                                    </tr>
-                                                </table>
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </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>
-                                <? } ?>
-                            <? } ?>
-                            <? if ($_SESSION['POLICY_USER_CHANGE_THEME'] !== 'no') {?>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Theme') ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <select class="vst-list" name="v_user_theme">
-                                        <?php
-                                            foreach ($themes as $key => $value) {
-                                                echo "\t\t\t\t<option value=\"".$value."\"";
-                                                if ((!empty($_SESSION['userTheme'])) && ( $value == $v_user_theme )) {
-                                                    echo ' selected' ;
-                                                }
-                                                if ((empty($v_user_theme) && (!empty($_SESSION['THEME']))) && ( $value == $_SESSION['THEME'] )) {
-                                                    echo ' selected' ;
-                                                }
-                                                if ((!empty($_SESSION['userTheme'])) && ( $value == $_POST['v_user_theme'])){
-                                                    echo ' selected' ;
-                                                }
-                                                echo ">".$value."</option>\n";
-                                            }
-                                        ?>
-                                    </select>
-                                </td>
-                            </tr>
-                            <?}?>
-                            <? if ($_GET['user'] === $_SESSION['user']) { ?>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Default list sort order');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <select class="vst-list" name="v_sort_order">
-                                        <option value='date' <?php if($_SESSION['userSortOrder'] === 'date') echo 'selected' ?>><?php print _('Date'); ?></option>
-                                        <option value='name' <?php if($_SESSION['userSortOrder'] === 'name') echo 'selected' ?>><?php print _('Name'); ?></option>
-                                    </select>
-                                </td>
-                            </tr>
-                            <? } ?>
-                            <? if ($_SESSION['userContext'] === 'admin') {?>
-                            <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>
-                            <? } ?>
-                            <? if ($_SESSION['userContext'] !== 'admin') {?>
-                            <tr>
-                                <td class="step-top">
-                                </td>
-                            </tr>
-                            <? } ?>
-                        </table>
-                        <table class="data-col2"></table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+		<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'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('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">
+								<?=_('Contact');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_name" value="<?=htmlentities(trim($v_name, "'"))?>" <?php if (($_SESSION['userContext'] !=='admin' ) && ($_SESSION['POLICY_USER_EDIT_DETAILS'] !=='yes' )) { echo 'disabled' ; }?> >
+								<?php if (($_SESSION['userContext'] !== 'admin') && ($_SESSION['POLICY_USER_EDIT_DETAILS'] !== 'yes')) {?>
+									<input type="hidden" name="v_name" value="<?=htmlentities(trim($v_name, "'"))?>">
+								<?php } ?>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Email');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_email" value="<?=htmlentities(trim($v_email, "'"))?>" <?php if (($_SESSION['userContext'] !=='admin' ) && ($_SESSION['POLICY_USER_EDIT_DETAILS'] !=='yes' )) { echo 'disabled' ; }?>>
+								<?php if (($_SESSION['userContext'] !== 'admin') && ($_SESSION['POLICY_USER_EDIT_DETAILS'] !== 'yes')) {?>
+									<input type="hidden" name="v_email" value="<?=htmlentities(trim($v_email, "'"))?>">
+								<?php } ?>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Password');?> <a href="javascript:randomString();" title="<?=_('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>
+								<table id="password-details">
+									<tr>
+										<td class="vst-text">
+											<?=_('Your password must have at least');?>:
+											<ul>
+												<li><?=_('8 characters long');?></li>
+												<li><?=_('1 uppercase & 1 lowercase character');?></li>
+												<li><?=_('1 number');?></li>
+											</ul>
+										</td>
+									</tr>
+									<?php if ($_SESSION['userContext'] === 'admin') {?>
+										<tr>
+											<td>
+												<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" ?>><?=_('Do not allow user to log in to Control Panel');?></label>
+											</td>
+										</tr>
+									<?php } ?>
+									<tr>
+										<td id="password-options" style="<?php if ($data[$user]['LOGIN_DISABLED'] == "yes") { echo 'display: none;'; } else { echo 'display: table-cell;'; }?>">
+											<label><input type="checkbox" class="vst-checkbox password-option" name="v_twofa" <?php if(!empty($v_twofa)) echo "checked=yes" ?>><?=_('Enable 2FA');?></label>
+											<?php if (!empty($v_twofa)) { ?>
+											<p><?=_('2FA Reset Code:').' '.$v_twofa; ?></br></p>
+											<p><?=_('Please scan the code below in your 2FA application:'); ?></p>
+											<div><img class="qr-code" src="<?=$v_qrcode; ?>"></div>
+											<?php } ?>
+										</td>
+									</tr>
+									<tr>
+										<td id="password-options-ip" style="<?php if ($data[$user]['LOGIN_DISABLED'] == "yes") { echo 'display: none;'; } else { echo 'display: table-cell;'; }?>">
+											<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" ?>><?=_('Use IP address allow list for login attempts');?></label>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<table id="ip-allowlist" style="<?php if ($data[$user]['LOGIN_USE_IPLIST'] === 'yes') { echo 'display: table-cell;'; } else { echo 'display: none;'; } ?>">
+												<tr>
+													<td>
+														<input type="text" size="20" class="vst-input" placeholder="<?=_('Example: 127.0.0.1,192.168.1.100');?>" name="v_login_allowed_ips" value="<?=htmlentities(trim($v_login_allowed_ips, "'"))?>">
+													</td>
+												</tr>
+											</table>
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('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-->
+						<?php } else { ?>
+							<?php if (($_SESSION['userContext'] === 'admin') && ($_SESSION['user'] != $v_username)) {?>
+							<tr>
+								<td class="vst-text input-label">
+									<?=_('Role');?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<select class="vst-list" name="v_role">
+										<option value="user"><?=_('User');?>
+										<option value="admin" <?php if($v_role == "admin" ){ echo "selected"; } ?>><?=_('Administrator');?>
+									</select>
+								</td>
+							</tr>
+							<?php } ?>
+						<?php } ?>
+						<?php if ($_SESSION['POLICY_USER_CHANGE_THEME'] !== 'no') {?>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Theme') ?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<select class="vst-list" name="v_user_theme">
+									<?php
+										foreach ($themes as $key => $value) {
+											echo "\t\t\t\t<option value=\"".$value."\"";
+											if ((!empty($_SESSION['userTheme'])) && ( $value == $v_user_theme )) {
+												echo ' selected' ;
+											}
+											if ((empty($v_user_theme) && (!empty($_SESSION['THEME']))) && ( $value == $_SESSION['THEME'] )) {
+												echo ' selected' ;
+											}
+											if ((!empty($_SESSION['userTheme'])) && ( $value == $_POST['v_user_theme'])){
+												echo ' selected' ;
+											}
+											echo ">".$value."</option>\n";
+										}
+									?>
+								</select>
+							</td>
+						</tr>
+						<?php } ?>
+						<?php if ($_GET['user'] === $_SESSION['user']) { ?>
+							<tr>
+								<td class="vst-text input-label">
+									<?=_('Default list sort order');?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<select class="vst-list" name="v_sort_order">
+										<option value='date' <?php if($_SESSION['userSortOrder'] === 'date') echo 'selected' ?>><?=_('Date'); ?></option>
+										<option value='name' <?php if($_SESSION['userSortOrder'] === 'name') echo 'selected' ?>><?=_('Name'); ?></option>
+									</select>
+								</td>
+								</tr>
+						<?php } ?>
+						<?php if ($_SESSION['userContext'] === 'admin') {?>
+							<tr>
+								<td class="vst-text input-label">
+										<?=_('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"><?=_('Advanced options');?></a>
+								</td>
+							</tr>
+							<tr>
+								<td class="step-top">
+									<table id="advanced-opts" style="display: none;">
+										<tr>
+											<td class="vst-text input-label">
+												<?=_('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 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">
+													<?=_('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>
+											<?php
+												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" <?php 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>
+						<?php } ?>
+						<?php if ($_SESSION['userContext'] !== 'admin') {?>
+							<tr>
+								<td class="step-top">
+								</td>
+							</tr>
+						<?php } ?>
+					</table>
+					<table class="data-col2"></table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 672 - 675
web/templates/pages/edit_web.html

@@ -1,685 +1,682 @@
+<!-- Begin toolbar -->
 <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/web/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-        </div>
-        <div class="l-unit-toolbar__buttonstrip float-right">
-            <a href="/delete/web/cache/?domain=<?=$_GET['domain'];?>&token=<?=$_SESSION['token'];?>" class="ui-button cancel <?php if ( $v_nginx_cache == 'yes' || ($v_proxy_template == 'caching' && $_SESSION['PROXY_SYSTEM'] == 'nginx')) { echo "block"; } else{ echo "hidden"; }?>" id="v-clear-cache">
-                <i class="fas fa-trash status-icon red"></i><?=_('Purge Nginx Cache');?>
-            </a>
-            <? if ($_SESSION['PLUGIN_APP_INSTALLER'] !== 'false') {?>
-                <a href="/add/webapp/?domain=<?=$v_domain?>" class="ui-button cancel" dir="ltr">
-                    <i class="fas fa-magic status-icon blue"></i> <?=_('Quick Install App')?>
-                </a>
-            <? } ?>
-            <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-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<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>
+		</div>
+		<div class="l-unit-toolbar__buttonstrip float-right">
+			<a href="/delete/web/cache/?domain=<?=$_GET['domain'];?>&token=<?=$_SESSION['token'];?>" class="ui-button cancel <?php if ( $v_nginx_cache == 'yes' || ($v_proxy_template == 'caching' && $_SESSION['PROXY_SYSTEM'] == 'nginx')) { echo "block"; } else{ echo "hidden"; }?>" id="v-clear-cache">
+				<i class="fas fa-trash status-icon red"></i><?=_('Purge Nginx Cache');?>
+			</a>
+			<?php if ($_SESSION['PLUGIN_APP_INSTALLER'] !== 'false') {?>
+				<a href="/add/webapp/?domain=<?=$v_domain?>" class="ui-button cancel" dir="ltr">
+					<i class="fas fa-magic status-icon blue"></i> <?=_('Quick Install App');?>
+				</a>
+			<?php } ?>
+			<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>
+<!-- End toolbar -->
 
-    <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_edit_web" method="post"  class="<?=$v_status?>">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="save" value="save" />
+<div class="l-separator"></div>
 
-            <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 Domain')?></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 _('Domain');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>" disabled>
-                                    <input type="hidden" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>">
-                                </td>
-                            </tr>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <?php print _('Aliases');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea size="20" class="vst-textinput short" name="v_aliases"><?=htmlentities(trim($v_aliases, "'"))?></textarea>
-                                </td>
-                            </tr>
-                            <? if ($v_letsencrypt == 'yes' || $v_letsencrypt == 'on') {?>
-			                <tr>
-                                <td>
-                                    <span class="alert alert-info alert-with-icon">
-                                        <i class="fas fa-exclamation"></i>
-                                        <?php print _('Lets Encrypt will obtain a new SSL certificate if web domain aliases are changed.');?>
-                                    </span>
-                                </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 == $v_ip) || $v_ip == "'{$ip}'")  ? 'selected' : '';
-                                                echo "\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"{$ip}\" {$ip_selected}>{$display_ip}</option>\n";
-                                            }
-                                        ?>
-                                    </select>
-                                </td>
-                            <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 ($v_stats == 'none') { ?>display:none<? } ?>">
-                                <td class="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');"><?php print _('Statistics Authorization');?></label>
-                                </td>
-                            </tr>
-                            <tr class="stats-auth">
-                                <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="vst-text input-label">
-                                    <label><input type="checkbox" size="20" class="vst-checkbox" name="v-redirect-checkbox" <?php if (!empty($v_redirect)) echo "checked=yes" ?> onclick="javascript:elementHideShow('v_redirect');"><?php print _('Enable domain redirection');?></label>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="step-left">
-                                    <table style="display:<?php if (empty($v_redirect)) { echo 'none';} else {echo 'block';}?> ;" id="v_redirect">
-                                        <tr>
-                                            <td>
-                                                <label><input type="radio" name="v-redirect" value="<?php echo 'www.'.$v_domain;?>" <?php if ($v_redirect == "www.".$v_domain) echo "checked"; ?> class="v-redirect-custom-value"><?=sprintf(_('Redirect visitors to %s'),"www.".$v_domain);?></label></input><br />
-                                                <label><input type="radio" name="v-redirect" value="<?php echo $v_domain;?>" <?php if( $v_redirect == $v_domain) echo "checked";?> class="v-redirect-custom-value"><?=sprintf(_('Redirect visitors to %s'),$v_domain);?></label></input><br />
-                                                <label><input type="radio" name="v-redirect" value="custom" <?php if( !empty($v_redirect_custom)) echo "checked";?> class="v-redirect-custom-value"><?=_("Redirect visitors to a custom domain or web address");?></label></input>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <table id="custom_redirect" style="margin-left: 22px; display:<?php if (empty($v_redirect_custom)) { echo 'none';} else {echo 'block';}?> ;">
-                                                    <tr>
-                                                        <td class="vst-text input-label">
-                                                            <?=_('Target domain or URL');?>:
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="vst-text input-label">
-                                                            <input type="text" name="v-redirect-custom" class="vst-input" value="<?=$v_redirect_custom;?>" />
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="vst-text input-label">
-                                                           <?=_('Status code');?>:
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="vst-text input-label">
-                                                            <select  class="vst-list" name="v-redirect-code">
-                                                                <?php foreach ($redirect_code_options as $status_code): ?>
-                                                                    <option value="<?php echo $status_code;?>"
-                                                                        <?=($v_redirect_code === $status_code || (empty($v_redirect_code) && $status_code === $v_redirect_code))?' selected="selected" ':''; ?>>
-                                                                        <?php echo $status_code;?>
-                                                                    </option>
-                                                                <?php endforeach; ?>
-                                                            </select>
-                                                        </td>
-                                                    </tr>
-                                                </table>   
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl" <?php if ($v_ssl == 'yes') echo "checked=yes" ?> onclick="javascript:App.Actions.WEB.toggle_ssl(this);"><?php print _('SSL Support');?></label>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="step-left">
-                                    <table style="display:<?php if ($v_ssl == 'no' ) { echo 'none';} else {echo 'block';}?> ;" id="ssltable">
-                                     <tr>
-                                          <td class="input-label vst-text">
-                                              <label><input type="checkbox" size="20" class="vst-checkbox" name="v_letsencrypt" id="letsencrypt" <?php if($v_letsencrypt == 'yes' || $v_letencrypt == 'on') echo "checked=yes" ?> onclick="elementHideShow('ssl-details');App.Actions.WEB.toggle_letsencrypt(this)"><?php print _('Lets Encrypt Support');?></label>
-                                          </td>
-                                      </tr>
-                                      <tr>
-                                          <td class="input-label vst-text">
-                                              <label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl_forcessl" id="v_ssl_forcessl" <?php if($v_ssl_forcessl == 'yes') echo "checked=yes" ?> onclick=""><?php print _('Force SSL/HTTPS');?></label>
-                                          </td>
-                                      </tr>
-                                      <tr>
-                                          <td class="input-label vst-text">
-                                              <label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl_hsts" id="ssl_hsts" <?php if($v_ssl_hsts == 'yes') echo "checked=yes" ?> onclick="App.Actions.WEB.toggle_hsts(this)"><?php print _('Enable SSL HSTS');?></label>
-                                          </td>
-                                      </tr>
-                                      <tr style="display: none;">
-                                            <td class="vst-text input-label">
-                                                <?php print _('Home Directory');?>
-                                            </td>
-                                        </tr>
-                                        <tr style="display: none;">
-                                            <td>
-                                                <select class="vst-list" name="v_ssl_home">
-                                                    <option value='same'>
-                                                         public_html
-                                                    </option>
-                                                </select>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <table id="ssl-details"  style="<? if ($v_letsencrypt == 'yes' || $v_letsencrypt == 'on') { echo 'display: none;'; } ?>">
-                                                    <tr>
-                                                        <td class="vst-text input-label step-top">
-                                                            <?php print _('SSL Certificate');?>
-                                                            <span id="generate-csr"> / <a class="generate" target="_blank" href="/generate/ssl/?domain=<?=$v_domain?>"><?=_('Generate CSR')?></a></span>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <textarea size="20" class="vst-textinput short console" name="v_ssl_crt" id="ssl_crt"><?=htmlentities(trim($v_ssl_crt, "'"))?></textarea>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="vst-text input-label">
-                                                            <?php print _('SSL Key');?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <textarea size="20" class="vst-textinput short console" name="v_ssl_key"><?=htmlentities(trim($v_ssl_key, "'"))?></textarea>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="vst-text input-label">
-                                                            <?php print _('SSL Certificate Authority / Intermediate');?> <span class="optional">(<?php print _('optional');?>)</span>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <textarea size="20" class="vst-textinput short console" name="v_ssl_ca"><?=htmlentities(trim($v_ssl_ca, "'"))?></textarea>
-                                                        </td>
-                                                    </tr>
-                                                </table>
-                                            </td>
-                                        </tr>
-                                        <?
-                                        if ($v_ssl != 'no' ) { ?>
-                                        <tr>
-                                            <td>
-                                                <table class="additional-info">
-                                                    <tr>
-                                                        <td>
-                                                            <b><?=_('SUBJECT')?>:</b>
-                                                        </td>
-                                                        <td class="details">
-                                                            <?=$v_ssl_subject?>
-                                                        </td>
-                                                    </tr>
-                                                    <? if($v_ssl_aliases){?>
-                                                    <tr>
-                                                        <td>
-                                                            <b><?=_('ALIASES')?>:</b>
-                                                        </td>
-                                                        <td class="details">
-                                                            <?=$v_ssl_aliases?>
-                                                        </td>
-                                                    </tr>
-                                                    <? } ?>
-                                                    <tr>
-                                                        <td>
-                                                            <b><?=_('NOT_BEFORE')?>:</b>
-                                                        </td>
-                                                        <td class="details">
-                                                            <?=$v_ssl_not_before?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <b><?=_('NOT_AFTER')?>:</b>
-                                                        </td>
-                                                        <td class="details">
-                                                            <?=$v_ssl_not_after?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <b><?=_('SIGNATURE')?>:</b>
-                                                        </td>
-                                                        <td class="details">
-                                                            <?=$v_ssl_signature?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <b><?=_('PUB_KEY')?>:</b>
-                                                        </td>
-                                                        <td class="details">
-                                                            <?=$v_ssl_pub_key?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <b><?=_('ISSUER')?>:</b>
-                                                        </td>
-                                                        <td class="details">
-                                                            <?=$v_ssl_issuer?>
-                                                        </td>
-                                                    </tr>
-                                                </table>
-                                            </td>
-                                        </tr>
-                                        <? } // if ssl is enabled ?>
-                                    </table>
-                                </td>
-                            </tr>
+<div class="l-center animated fadeIn">
 
-                        <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;">
-                                        <? if (($_SESSION['userContext'] === 'admin') || ($_SESSION['userContext'] === 'user') && ($_SESSION['POLICY_USER_EDIT_WEB_TEMPLATES'] === 'yes')) { ?>
-                                            <tr>
-                                                <td class="vst-text input-label">
-                                                    <?php print _('Web Template')  . "<span class='optional'>" .strtoupper($_SESSION['WEB_SYSTEM']) . "</span>";?>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td>
-                                                    <select class="vst-list" name="v_template">
-                                                        <?php
-                                                            foreach ($templates as $key => $value) {
-                                                                echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
-                                                                $svalue = "'".$value."'";
-                                                                if ((!empty($v_template)) && ( $value == $v_template ) || ($svalue == $v_template)){
-                                                                    echo ' selected' ;
-                                                                }
-                                                                echo ">".htmlentities($value)."</option>\n";
-                                                            }
-                                                        ?>
-                                                    </select>
-                                                </td>
-                                            </tr>
-                                            <?php if($_SESSION['WEB_SYSTEM'] == 'nginx'){?>
-                                            <tr>
-                                                <td class="vst-text">
-                                                    <label><input type="checkbox" size="20" class="vst-checkbox" name="v_nginx_cache_check" <?php if ($v_nginx_cache == 'yes') echo "checked=yes" ?> onclick="javascript:elementHideShow('v_nginx_duration');"><?php print _('Enable FastCGI Cache'); ?> <a href="https://docs.hestiacp.com/admin_docs/nginx_caching.html" target="_blank"><i class="fas fa-question-circle"></i></a></label>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td class="step-left">
-                                                    <table id="v_nginx_duration" style="display:<?php if ($v_nginx_cache != 'yes' ) { echo 'none';} else {echo 'block';}?> ;" >
-                                                        <td class="vst-text input-label">
-                                                            <?php print _('Cache Duration'); ?> <span class="optional"><?=_('For example: 30s, 10m or 1d');?>
-                                                        </td>
-                                                        <tr>
-                                                            <td><input type="text" size="20" class="vst-input" name="v_nginx_cache_duration" value="<?=htmlentities(trim($v_nginx_cache_duration, "'"))?>"></td>
-                                                        </tr>
-                                                    </table>
-                                                </td>
-                                            </tr>
-                                            <?php } ?>                          
-                                            <?php if (!empty($_SESSION['WEB_BACKEND'])) { ?>
-                                            <tr>
-                                                <td class="vst-text input-label">
-                                                    <?php print _('Backend Template') . " <span class='optional'>" . strtoupper($_SESSION['WEB_BACKEND']) . "</span>";?>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td>
-                                                    <select class="vst-list" name="v_backend_template">
-                                                        <?php
-                                                            foreach ($backend_templates as $key => $value) {
-                                                                echo "\t\t\t\t<option value=\"".$value."\"";
-                                                                $svalue = "'".$value."'";
-                                                                if ((!empty($v_backend_template)) && ( $value == $v_backend_template ) || ($svalue == $v_backend_template)){
-                                                                    echo ' selected' ;
-                                                                }
-                                                                if ((empty($v_backend_template)) && ($value == 'default')){
-                                                                    echo ' selected' ;
-                                                                }
-                                                                echo ">".htmlentities($value)."</option>\n";
-                                                            }
-                                                        ?>
-                                                    </select>
-                                                </td>
-                                            </tr>
-                                            <?php }?>
-                                            <?php if (!empty($_SESSION['PROXY_SYSTEM'])) { ?>
-                                            <tr style="display: none;">
-                                                <td class="vst-text input-label">
-                                                    <label><input type="checkbox" size="20" class="vst-checkbox" name="v_proxy" <?php if (!empty($v_proxy)) echo "checked=yes" ?> onclick="javascript:elementHideShow('proxytable');"><?php print _('Proxy Support') . "<span class='optional'>" . strtoupper($_SESSION['PROXY_SYSTEM']) . "</span>";?></label>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td>
-                                                    <table style="display:<?php if (empty($v_proxy)) { echo 'none';} else {echo 'block';}?> ;" id="proxytable">
-                                                        <tr>
-                                                            <td class="vst-text input-label">
-                                                                <?php print _('Proxy Template');?>
-                                                            </td>
-                                                        </tr>
-                                                        <tr>
-                                                            <td>
-                                                                <select class="vst-list" name="v_proxy_template">
-                                                                    <?php
-                                                                        foreach ($proxy_templates as $key => $value) {
-                                                                            echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
-                                                                            $svalue = "'".$value."'";
-                                                                            if ((!empty($v_proxy_template)) && ( $value == $v_proxy_template ) || ($svalue == $v_proxy_template)){
-                                                                                echo ' selected' ;
-                                                                            }
-                                                                            if ((empty($v_proxy_template)) && ($value == 'default')){
-                                                                                echo ' selected' ;
-                                                                            }
-                                                                            echo ">".htmlentities($value)."</option>\n";
-                                                                        }
-                                                                    ?>
-                                                                </select>
-                                                            </td>
-                                                        </tr>
-                                                        <tr>
-                                                            <td class="vst-text input-label">
-                                                                <?php print _('Proxy Extensions');?>
-                                                            </td>
-                                                        </tr>
-                                                        <tr>
-                                                            <td>
-                                                                <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 'jpg, jpeg, gif, png, ico, svg, css, zip, tgz, gz, rar, bz2, exe, pdf, doc, xls, ppt, txt, odt, ods, odp, odf, tar, bmp, rtf, js, mp3, avi, mpeg, flv, html, htm'; }  ?></textarea>
-                                                            </td>
-                                                        </tr>
-                                                    </table>
-                                                </td>
-                                            </tr>
-                                        <?php } ?>
-                                        <?php } ?>
-                                        <tr>
-                                            <td class="vst-text input-label">
-                                                <label><input type="checkbox" size="20" class="vst-checkbox" name="v_custom_doc_root_check" <?php if (!empty($v_custom_doc_root)) echo "checked=yes" ?> onclick="javascript:elementHideShow('v_custom_doc_root');"><?php print _('Custom document root');?></label>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td class="step-left">
-                                                <table style="display:<?php if (empty($v_custom_doc_root)) { echo 'none';} else {echo 'block';}?> ;" id="v_custom_doc_root">
-                                                    <tr>
-                                                        <td class="vst-text input-label">
-                                                            <?php print _('Point to');?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <input type="hidden" name="v-custom-doc-root_prepath" value="<?php echo $v_custom_doc_root_prepath;?>">
-                                                            <select class="vst-list" name="v-custom-doc-domain">
-                                                            <?php foreach ($user_domains as $domain): ?>
-                                                                <option value="<?php echo $domain;?>"
-                                                                    <?=($v_custom_doc_domain === $domain || (empty($v_custom_doc_domain) && $domain === $v_domain))?' selected="selected" ':''; ?>>
-                                                                    <?php echo $domain;?>
-                                                                </option>
-                                                            <?php endforeach; ?>
-                                                            </select>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="vst-text input-label">
-                                                            <?php print( _('Directory'));?> <span class="optional">(<?php print _('optional');?>)</span>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <input type="text" size="20" class="vst-input"
-                                                            name="v-custom-doc-folder" value="<?=htmlentities(trim($v_custom_doc_folder, "'"))?>">
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td>
-                                                            <small class="custom_docroot_hint"></small>
-                                                        </td>
-                                                    </tr>
+	<form id="vstobjects" name="v_edit_web" method="post" class="<?=$v_status?>">
+		<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+		<input type="hidden" name="save" value="save" />
 
-                                                </table>
-                                            </td>
-                                        </tr>
-                                        
-                            <tr>
-                                <td class="vst-text input-label">
-                                    <label><input type="checkbox" size="20" class="vst-checkbox" name="v_ftp" <?php if (!empty($v_ftp_user)) echo "checked=yes" ?> onclick="App.Actions.WEB.toggle_additional_ftp_accounts(this)"><?php print _('Additional FTP Account');?></label>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
+		<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 Domain');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('Domain');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>" disabled>
+								<input type="hidden" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('Aliases');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea size="20" class="vst-textinput short" name="v_aliases"><?=htmlentities(trim($v_aliases, "'"))?></textarea>
+							</td>
+						</tr>
+						<?php if ($v_letsencrypt == 'yes' || $v_letsencrypt == 'on') {?>
+						<tr>
+							<td>
+								<span class="alert alert-info alert-with-icon">
+									<i class="fas fa-exclamation"></i>
+									<?=_('Lets Encrypt will obtain a new SSL certificate if web domain aliases are changed.');?>
+								</span>
+							</td>
+						</tr>
+						<?php } ?>
+						<tr>
+							<td class="vst-text input-label">
+								<?=_('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 == $v_ip) || $v_ip == "'{$ip}'")  ? 'selected' : '';
+											echo "\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"{$ip}\" {$ip_selected}>{$display_ip}</option>\n";
+										}
+									?>
+								</select>
+							</td>
+						<tr>
+							<td class="vst-text step-top">
+								<?=_('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="<?php if ($v_stats == 'none') { ?>display:none<?php } ?>">
+							<td class="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 class="stats-auth">
+							<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">
+											<?=_('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">
+											<?=_('Password');?> / <a href="javascript:WEBrandom();" class="generate"><?=_('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="vst-text input-label">
+								<label><input type="checkbox" size="20" class="vst-checkbox" name="v-redirect-checkbox" <?php if (!empty($v_redirect)) echo "checked=yes" ?> onclick="javascript:elementHideShow('v_redirect');"><?=_('Enable domain redirection');?></label>
+							</td>
+						</tr>
+						<tr>
+							<td class="step-left">
+								<table style="display:<?php if (empty($v_redirect)) { echo 'none';} else {echo 'block';}?> ;" id="v_redirect">
+									<tr>
+										<td>
+											<label><input type="radio" name="v-redirect" value="<?='www.'.$v_domain;?>" <?php if ($v_redirect == "www.".$v_domain) echo "checked"; ?> class="v-redirect-custom-value"><?=sprintf(_('Redirect visitors to %s'),"www.".$v_domain);?></label></input><br />
+											<label><input type="radio" name="v-redirect" value="<?=$v_domain;?>" <?php if( $v_redirect == $v_domain) echo "checked";?> class="v-redirect-custom-value"><?=sprintf(_('Redirect visitors to %s'),$v_domain);?></label></input><br />
+											<label><input type="radio" name="v-redirect" value="custom" <?php if( !empty($v_redirect_custom)) echo "checked";?> class="v-redirect-custom-value"><?=_("Redirect visitors to a custom domain or web address");?></label></input>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<table id="custom_redirect" style="margin-left: 22px; display:<?php if (empty($v_redirect_custom)) { echo 'none';} else {echo 'block';}?> ;">
+												<tr>
+													<td class="vst-text input-label">
+														<?=_('Target domain or URL');?>:
+													</td>
+												</tr>
+												<tr>
+													<td class="vst-text input-label">
+														<input type="text" name="v-redirect-custom" class="vst-input" value="<?=$v_redirect_custom;?>" />
+													</td>
+												</tr>
+												<tr>
+													<td class="vst-text input-label">
+														<?=_('Status code');?>:
+													</td>
+												</tr>
+												<tr>
+													<td class="vst-text input-label">
+														<select class="vst-list" name="v-redirect-code">
+															<?php foreach ($redirect_code_options as $status_code): ?>
+															<option value="<?=$status_code;?>"
+																<?=($v_redirect_code === $status_code || (empty($v_redirect_code) && $status_code === $v_redirect_code))?' selected="selected" ':''; ?>>
+																<?=$status_code;?>
+															</option>
+															<?php endforeach; ?>
+														</select>
+													</td>
+												</tr>
+											</table>
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text input-label">
+								<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl" <?php if ($v_ssl == 'yes') echo "checked=yes" ?> onclick="javascript:App.Actions.WEB.toggle_ssl(this);"><?=_('SSL Support');?></label>
+							</td>
+						</tr>
+						<tr>
+							<td class="step-left">
+								<table style="display:<?php if ($v_ssl == 'no' ) { echo 'none';} else {echo 'block';}?> ;" id="ssltable">
+									<tr>
+										<td class="input-label vst-text">
+											<label><input type="checkbox" size="20" class="vst-checkbox" name="v_letsencrypt" id="letsencrypt" <?php if($v_letsencrypt == 'yes' || $v_letencrypt == 'on') echo "checked=yes" ?> onclick="elementHideShow('ssl-details');App.Actions.WEB.toggle_letsencrypt(this)"><?=_('Lets Encrypt Support');?></label>
+										</td>
+									</tr>
+									<tr>
+										<td class="input-label vst-text">
+											<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl_forcessl" id="v_ssl_forcessl" <?php if($v_ssl_forcessl == 'yes') echo "checked=yes" ?> onclick=""><?=_('Force SSL/HTTPS');?></label>
+										</td>
+									</tr>
+									<tr>
+										<td class="input-label vst-text">
+											<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl_hsts" id="ssl_hsts" <?php if($v_ssl_hsts == 'yes') echo "checked=yes" ?> onclick="App.Actions.WEB.toggle_hsts(this)"><?=_('Enable SSL HSTS');?></label>
+										</td>
+									</tr>
+									<tr style="display: none;">
+										<td class="vst-text input-label">
+											<?=_('Home Directory');?>
+										</td>
+									</tr>
+									<tr style="display: none;">
+										<td>
+											<select class="vst-list" name="v_ssl_home">
+												<option value='same'>
+													public_html
+												</option>
+											</select>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<table id="ssl-details" style="<?php if ($v_letsencrypt == 'yes' || $v_letsencrypt == 'on') { echo 'display: none;'; } ?>">
+												<tr>
+													<td class="vst-text input-label step-top">
+														<?=_('SSL Certificate');?>
+														<span id="generate-csr"> / <a class="generate" target="_blank" href="/generate/ssl/?domain=<?=$v_domain?>"><?=_('Generate CSR');?></a></span>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<textarea size="20" class="vst-textinput short console" name="v_ssl_crt" id="ssl_crt"><?=htmlentities(trim($v_ssl_crt, "'"))?></textarea>
+													</td>
+												</tr>
+												<tr>
+													<td class="vst-text input-label">
+														<?=_('SSL Key');?>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<textarea size="20" class="vst-textinput short console" name="v_ssl_key"><?=htmlentities(trim($v_ssl_key, "'"))?></textarea>
+													</td>
+												</tr>
+												<tr>
+													<td class="vst-text input-label">
+														<?=_('SSL Certificate Authority / Intermediate');?> <span class="optional">(<?=_('optional');?>)</span>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<textarea size="20" class="vst-textinput short console" name="v_ssl_ca"><?=htmlentities(trim($v_ssl_ca, "'"))?></textarea>
+													</td>
+												</tr>
+											</table>
+										</td>
+									</tr>
+									<?php if ($v_ssl != 'no' ) { ?>
+										<tr>
+											<td>
+												<table class="additional-info">
+													<tr>
+														<td>
+															<b><?=_('SUBJECT');?>:</b>
+														</td>
+														<td class="details">
+															<?=$v_ssl_subject?>
+														</td>
+													</tr>
+													<?php if ($v_ssl_aliases){?>
+													<tr>
+														<td>
+															<b><?=_('ALIASES');?>:</b>
+														</td>
+														<td class="details">
+															<?=$v_ssl_aliases?>
+														</td>
+													</tr>
+													<?php } ?>
+													<tr>
+														<td>
+															<b><?=_('NOT_BEFORE');?>:</b>
+														</td>
+														<td class="details">
+															<?=$v_ssl_not_before?>
+														</td>
+													</tr>
+													<tr>
+														<td>
+															<b><?=_('NOT_AFTER');?>:</b>
+														</td>
+														<td class="details">
+															<?=$v_ssl_not_after?>
+														</td>
+													</tr>
+													<tr>
+														<td>
+															<b><?=_('SIGNATURE');?>:</b>
+														</td>
+														<td class="details">
+															<?=$v_ssl_signature?>
+														</td>
+													</tr>
+													<tr>
+														<td>
+															<b><?=_('PUB_KEY');?>:</b>
+														</td>
+														<td class="details">
+															<?=$v_ssl_pub_key?>
+														</td>
+													</tr>
+													<tr>
+														<td>
+															<b><?=_('ISSUER');?>:</b>
+														</td>
+														<td class="details">
+															<?=$v_ssl_issuer?>
+														</td>
+													</tr>
+												</table>
+											</td>
+										</tr>
+									<? } // if ssl is enabled ?>
+								</table>
+							</td>
+						</tr>
 
-                                    <?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 style="display:<?php if (empty($v_ftp_user)) { echo 'none';} else {echo 'block';}?> ;" 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" onCLick="App.Actions.WEB.remove_ftp_user(this)"><?=_('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 sprintf(_('Prefix %s will be added to username automatically'),$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="step-top vst-text" style="/*padding: 32px 0 20px 0;*/">
+								<a href="javascript:elementHideShow('advanced-opts');" class="vst-advanced"><?=_('Advanced options');?></a>
+							</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="hidden"  class="vst-input v-ftp-path" name="v_ftp_user[<?php print $i ?>][v_ftp_path_prev]" value="<?php if (!empty($v_ftp_path)) echo ($v_ftp_path[0] != '/' ? '/' : '').htmlentities(trim($v_ftp_path, "'")) ?>">
-                                                <input type="text"  class="vst-input v-ftp-path" name="v_ftp_user[<?php print $i ?>][v_ftp_path]" value="<?php if (!empty($v_ftp_path)) echo ($v_ftp_path[0] != '/' ? '/' : '').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>
-                                        <?php if ($ftp_user['is_new'] == 1): ?>
-                                        <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 vst-email-alert-on-psw" name="v_ftp_user[<?php print $i ?>][v_ftp_email]" value="<?=htmlentities(trim($v_ftp_email, "'"))?>">
-                                            </td>
-                                        </tr>
-                                        <?php endif; ?>
-                                </table>
-                                    <?php endforeach; ?>
-                                </td>
-                            </tr>
+						<tr>
+							<td class="step-top">
+								<table id="advanced-opts" style="display: none;">
+									<?php if (($_SESSION['userContext'] === 'admin') || ($_SESSION['userContext'] === 'user') && ($_SESSION['POLICY_USER_EDIT_WEB_TEMPLATES'] === 'yes')) { ?>
+										<tr>
+											<td class="vst-text input-label">
+												<?=_('Web Template')  . "<span class='optional'>" .strtoupper($_SESSION['WEB_SYSTEM']) . "</span>";?>
+											</td>
+										</tr>
+										<tr>
+											<td>
+												<select class="vst-list" name="v_template">
+													<?php
+														foreach ($templates as $key => $value) {
+															echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
+															$svalue = "'".$value."'";
+															if ((!empty($v_template)) && ( $value == $v_template ) || ($svalue == $v_template)){
+																echo ' selected' ;
+															}
+															echo ">".htmlentities($value)."</option>\n";
+														}
+													?>
+												</select>
+											</td>
+										</tr>
+										<?php if($_SESSION['WEB_SYSTEM'] == 'nginx'){?>
+											<tr>
+												<td class="vst-text">
+													<label><input type="checkbox" size="20" class="vst-checkbox" name="v_nginx_cache_check" <?php if ($v_nginx_cache == 'yes') echo "checked=yes" ?> onclick="javascript:elementHideShow('v_nginx_duration');"><?=_('Enable FastCGI Cache'); ?> <a href="https://docs.hestiacp.com/admin_docs/nginx_caching.html" target="_blank"><i class="fas fa-question-circle"></i></a></label>
+												</td>
+											</tr>
+											<tr>
+												<td class="step-left">
+													<table id="v_nginx_duration" style="display:<?php if ($v_nginx_cache != 'yes' ) { echo 'none';} else {echo 'block';}?> ;">
+														<td class="vst-text input-label">
+															<?=_('Cache Duration'); ?> <span class="optional"><?=_('For example: 30s, 10m or 1d');?>
+														</td>
+														<tr>
+															<td><input type="text" size="20" class="vst-input" name="v_nginx_cache_duration" value="<?=htmlentities(trim($v_nginx_cache_duration, "'"))?>"></td>
+														</tr>
+													</table>
+												</td>
+											</tr>
+										<?php } ?>
+										<?php if (!empty($_SESSION['WEB_BACKEND'])) { ?>
+											<tr>
+												<td class="vst-text input-label">
+													<?=_('Backend Template') . " <span class='optional'>" . strtoupper($_SESSION['WEB_BACKEND']) . "</span>";?>
+												</td>
+											</tr>
+											<tr>
+												<td>
+													<select class="vst-list" name="v_backend_template">
+														<?php
+																	foreach ($backend_templates as $key => $value) {
+																		echo "\t\t\t\t<option value=\"".$value."\"";
+																		$svalue = "'".$value."'";
+																		if ((!empty($v_backend_template)) && ( $value == $v_backend_template ) || ($svalue == $v_backend_template)){
+																			echo ' selected' ;
+																		}
+																		if ((empty($v_backend_template)) && ($value == 'default')){
+																			echo ' selected' ;
+																		}
+																		echo ">".htmlentities($value)."</option>\n";
+																	}
+																?>
+													</select>
+												</td>
+											</tr>
+										<?php }?>
+										<?php if (!empty($_SESSION['PROXY_SYSTEM'])) { ?>
+											<tr style="display: none;">
+												<td class="vst-text input-label">
+													<label><input type="checkbox" size="20" class="vst-checkbox" name="v_proxy" <?php if (!empty($v_proxy)) echo "checked=yes" ?> onclick="javascript:elementHideShow('proxytable');"><?=_('Proxy Support') . "<span class='optional'>" . strtoupper($_SESSION['PROXY_SYSTEM']) . "</span>";?></label>
+												</td>
+											</tr>
+											<tr>
+												<td>
+													<table style="display:<?php if (empty($v_proxy)) { echo 'none';} else {echo 'block';}?> ;" id="proxytable">
+														<tr>
+															<td class="vst-text input-label">
+																<?=_('Proxy Template');?>
+															</td>
+														</tr>
+														<tr>
+															<td>
+																<select class="vst-list" name="v_proxy_template">
+																	<?php
+																		foreach ($proxy_templates as $key => $value) {
+																			echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
+																			$svalue = "'".$value."'";
+																			if ((!empty($v_proxy_template)) && ( $value == $v_proxy_template ) || ($svalue == $v_proxy_template)){
+																				echo ' selected' ;
+																			}
+																			if ((empty($v_proxy_template)) && ($value == 'default')){
+																				echo ' selected' ;
+																			}
+																			echo ">".htmlentities($value)."</option>\n";
+																		}
+																	?>
+																</select>
+															</td>
+														</tr>
+														<tr>
+															<td class="vst-text input-label">
+																<?=_('Proxy Extensions');?>
+															</td>
+														</tr>
+														<tr>
+															<td>
+																<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 'jpg, jpeg, gif, png, ico, svg, css, zip, tgz, gz, rar, bz2, exe, pdf, doc, xls, ppt, txt, odt, ods, odp, odf, tar, bmp, rtf, js, mp3, avi, mpeg, flv, html, htm'; }  ?></textarea>
+															</td>
+														</tr>
+													</table>
+												</td>
+											</tr>
+										<?php } ?>
+									<?php } ?>
+									<tr>
+										<td class="vst-text input-label">
+											<label><input type="checkbox" size="20" class="vst-checkbox" name="v_custom_doc_root_check" <?php if (!empty($v_custom_doc_root)) echo "checked=yes" ?> onclick="javascript:elementHideShow('v_custom_doc_root');"><?=_('Custom document root');?></label>
+										</td>
+									</tr>
+									<tr>
+										<td class="step-left">
+											<table style="display:<?php if (empty($v_custom_doc_root)) { echo 'none';} else {echo 'block';}?> ;" id="v_custom_doc_root">
+												<tr>
+													<td class="vst-text input-label">
+														<?=_('Point to');?>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<input type="hidden" name="v-custom-doc-root_prepath" value="<?=$v_custom_doc_root_prepath;?>">
+														<select class="vst-list" name="v-custom-doc-domain">
+															<?php foreach ($user_domains as $domain): ?>
+															<option value="<?=$domain;?>"
+																<?=($v_custom_doc_domain === $domain || (empty($v_custom_doc_domain) && $domain === $v_domain))?' selected="selected" ':''; ?>>
+																<?=$domain;?>
+															</option>
+															<?php endforeach; ?>
+														</select>
+													</td>
+												</tr>
+												<tr>
+													<td class="vst-text input-label">
+														<?php print( _('Directory'));?> <span class="optional">(<?=_('optional');?>)</span>
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<input type="text" size="20" class="vst-input"
+															name="v-custom-doc-folder" value="<?=htmlentities(trim($v_custom_doc_folder, "'"))?>">
+													</td>
+												</tr>
+												<tr>
+													<td>
+														<small class="custom_docroot_hint"></small>
+													</td>
+												</tr>
+											</table>
+										</td>
+									</tr>
+									<tr>
+										<td class="vst-text input-label">
+											<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ftp" <?php if (!empty($v_ftp_user)) echo "checked=yes" ?> onclick="App.Actions.WEB.toggle_additional_ftp_accounts(this)"><?=_('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 style="display:<?php if (empty($v_ftp_user)) { echo 'none';} else {echo 'block';}?> ;" class="ftptable ftptable-nrm" name="v_add_domain_ftp">
+												<tr>
+													<td class="vst-text input-label">
+														<?=_('FTP');?> #<span class="ftp-user-number"><?=$i + 1; ?></span> <a class="ftp-remove-user additional-control" onCLick="App.Actions.WEB.remove_ftp_user(this)"><?=_('delete');?></a>
+														<input type="hidden" class="v-ftp-user-deleted" name="v_ftp_user[<?=$i ?>][delete]" value="0" />
+														<input type="hidden" class="v-ftp-user-is-new" name="v_ftp_user[<?=$i ?>][is_new]" value="<?=htmlentities($ftp_user['is_new']) ?>" />
+													</td>
+												</tr>
+												<tr>
+													<td class="vst-text step-left input-label">
+														<?=_('Username');?><br>
+														<span style="font-size: 10pt; color:#777;"><?=sprintf(_('Prefix %s will be added to username automatically'),$user."_");?></span>
+													</td>
+												</tr>
+												<tr>
+													<td class="step-left">
+														<input type="text" size="20" class="vst-input v-ftp-user" <?=$ftp_user['is_new'] != 1 ? 'disabled="disabled"' : '' ?>
+															name="v_ftp_user[<?=$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">
+														<?=_('Password');?> / <a href="javascript:void(0);" onClick="FTPrandom(this)" ; class="generate"><?=_('generate');?></a>
+													</td>
+												</tr>
+												<tr>
+													<td class="step-left">
+														<input type="text" class="vst-input v-ftp-user-psw password" name="v_ftp_user[<?=$i ?>][v_ftp_password]" value="<?=htmlentities(trim($v_ftp_password, "'"))?>">
+													</td>
+												</tr>
 
-                            <tr class="add-new-ftp-user-button" style="<?php print !empty($v_ftp_user) ? '' : 'display:none;' ?>">
-                                <td class="vst-text step-top v-add-new-user step-bottom">
-                                    <a class="additional-control vst-advanced" onClick="App.Actions.WEB.add_ftp_user_form()"><?php print _('Add one more FTP Account');?></a>
-                                </td>
-                            </tr>
-                                    </table>
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2">
-                        </table>
-                    </td>
-                </tr>
-            </table>
-        </form>
+												<tr>
+													<td class="vst-text step-left input-label">
+														<?=_('Path');?>
+													</td>
+												</tr>
+												<tr>
+													<td class="step-left">
+														<input type="hidden" class="vst-input v-ftp-pre-path" name="v_ftp_pre_path" value="<?=!empty($v_ftp_pre_path) ? htmlentities(trim($v_ftp_pre_path, "'")) : '/'; ?>">
+														<input type="hidden" class="vst-input v-ftp-path" name="v_ftp_user[<?=$i ?>][v_ftp_path_prev]" value="<?php if (!empty($v_ftp_path)) echo ($v_ftp_path[0] != '/' ? '/' : '').htmlentities(trim($v_ftp_path, "'")) ?>">
+														<input type="text" class="vst-input v-ftp-path" name="v_ftp_user[<?=$i ?>][v_ftp_path]" value="<?php if (!empty($v_ftp_path)) echo ($v_ftp_path[0] != '/' ? '/' : '').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>
+												<?php if ($ftp_user['is_new'] == 1): ?>
+												<tr>
+													<td class="vst-text step-left input-label">
+														<?=_('Send FTP credentials to email');?>
+													</td>
+												</tr>
+												<tr>
+													<td class="step-left">
+														<input type="text" class="vst-input vst-email-alert-on-psw" name="v_ftp_user[<?=$i ?>][v_ftp_email]" value="<?=htmlentities(trim($v_ftp_email, "'"))?>">
+													</td>
+												</tr>
+												<?php endif; ?>
+											</table>
+											<?php endforeach; ?>
+										</td>
+									</tr>
 
-        <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" 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 sprintf(_('Prefix %s will be added to username automatically'),$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 class="add-new-ftp-user-button" style="<?=!empty($v_ftp_user) ? '' : 'display:none;' ?>">
+										<td class="vst-text step-top v-add-new-user step-bottom">
+											<a class="additional-control vst-advanced" onClick="App.Actions.WEB.add_ftp_user_form()"><?=_('Add one more FTP Account');?></a>
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2">
+					</table>
+				</td>
+			</tr>
+		</table>
+	</form>
 
-                <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 vst-email-alert-on-psw" name="v_ftp_user[%INDEX%][v_ftp_email]" value="">
-                    </td>
-                </tr>
-        </table>
-        </div>
-    </div>
-    <script>
-      GLOBAL.FTP_USER_PREFIX = <?=json_encode($user.'_')?>;
-    </script>
+	<div id="templates" class="hidden">
+		<table class="ftptable ftptable-nrm" name="v_add_domain_ftp">
+			<tr>
+				<td class="vst-text input-label">
+					<?=_('FTP') ?> #<span class="ftp-user-number"></span> <a class="ftp-remove-user additional-control" 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">
+					<?=_('Username');?><br>
+					<span style="font-size: 10pt; color:#777;"><?=sprintf(_('Prefix %s will be added to username automatically'),$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">
+					<?=_('Password');?> / <a href="javascript:void(0);" onClick="FTPrandom(this)" ; class="generate"><?=_('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">
+					<?=_('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">
+					<?=_('Send FTP credentials to email');?>
+				</td>
+			</tr>
+			<tr>
+				<td class="step-left">
+					<input type="text" class="vst-input vst-email-alert-on-psw" name="v_ftp_user[%INDEX%][v_ftp_email]" value="">
+				</td>
+			</tr>
+		</table>
+	</div>
+</div>
+<script>
+	GLOBAL.FTP_USER_PREFIX = <?php json_encode($user.'_') ?>;
+</script>

+ 130 - 132
web/templates/pages/generate_ssl.html

@@ -1,134 +1,132 @@
-    <div class="l-center">
-      <div class="l-sort clearfix">
-        <div class="l-sort-toolbar clearfix float-left">
-            <?php
-                if (!empty($_SESSION['error_msg'])) {
-                    echo "<span class=\"vst-error\"> → ".htmlentities($_SESSION['error_msg'])."</span>";
-                } else {
-                    if (!empty($_SESSION['ok_msg'])) {
-                    echo "<span class=\"vst-ok\"> → ".$_SESSION['ok_msg']."</span>";
-                    }
-                }
-            ?>
-        </div>
-      </div>
-    </div>
+<div class="l-center">
+	<div class="l-sort clearfix">
+		<div class="l-sort-toolbar clearfix float-left">
+			<?php
+				if (!empty($_SESSION['error_msg'])) {
+					$msg_icon = 'fa-exclamation-circle status-icon red';
+					$msg_text = htmlentities($_SESSION['error_msg']);
+					$msg_id = 'vst-error';
+				} else {
+					if (!empty($_SESSION['ok_msg'])) {
+						$msg_icon = 'fa-check-circle status-icon green';
+						$msg_text = $_SESSION['ok_msg'];
+						$msg_id = 'vst-ok';
+					}
+				}
+			?>
+			<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+		</div>
+	</div>
+</div>
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <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_generate_csr" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="generate" value="generate" />
-            <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"><?=_('Generating CSR')?></span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text" style="padding: 24px 0 0 0;">
-                                    <?php print _('Domain');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_domain" value="<?=htmlentities(trim($v_domain, "'")) ?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text" style="padding: 24px 0 0 0;">
-                                    <?php print _('Aliases');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea size="20" class="vst-textinput short" name="v_aliases"><?=htmlentities(trim($v_aliases, "'"))?></textarea>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text" style="padding: 12px 0 0 0;">
-                                    <?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" style="padding: 12px 0 0 0;">
-                                    <?php print _('Country'); ?>
-                                    <span class="optional">(<?php print _('2 letter code');?>)</span>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_country" value="<?=htmlentities(trim($v_country, "'"))?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text" style="padding: 12px 0 0 0;">
-                                    <?php print _('State / Province');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_state" value="<?=htmlentities(trim($v_state, "'")) ?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text" style="padding: 12px 0 0 0;">
-                                    <?php print _('City / Locality');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_locality" value="<?=htmlentities(trim($v_locality, "'")) ?>">
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text" style="padding: 12px 0 0 0;">
-                                    <?php print _('Organization');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input type="text" size="20" class="vst-input" name="v_org" value="<?=htmlentities(trim($v_org, "'")) ?>">
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2">
-                            <tr>
-                                <td style="padding: 24px 0 0 0;" width="116px">
-                                    <input type="submit" class="button" name="generate" value="<?=_('Ok')?>">
-                                </td>
-                                <td style="padding: 24px 0 0 0;">
-                                    <input type="button" class="button cancel" value="<?=_('Back')?>" onclick="<?=$back?>">
-                                </td>
-                            </tr>
-                        </table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+<div class="l-center animated fadeIn">
+
+	<form id="vstobjects" name="v_generate_csr" method="post">
+		<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+		<input type="hidden" name="generate" value="generate" />
+		<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"><?=_('Generating CSR');?></span>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text" style="padding: 24px 0 0 0;">
+								<?=_('Domain');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_domain" value="<?=htmlentities(trim($v_domain, "'")) ?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text" style="padding: 24px 0 0 0;">
+								<?=_('Aliases');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea size="20" class="vst-textinput short" name="v_aliases"><?=htmlentities(trim($v_aliases, "'"))?></textarea>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text" style="padding: 12px 0 0 0;">
+								<?=_('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" style="padding: 12px 0 0 0;">
+								<?=_('Country'); ?>
+								<span class="optional">(<?=_('2 letter code');?>)</span>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_country" value="<?=htmlentities(trim($v_country, "'"))?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text" style="padding: 12px 0 0 0;">
+								<?=_('State / Province');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_state" value="<?=htmlentities(trim($v_state, "'")) ?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text" style="padding: 12px 0 0 0;">
+								<?=_('City / Locality');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_locality" value="<?=htmlentities(trim($v_locality, "'")) ?>">
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text" style="padding: 12px 0 0 0;">
+								<?=_('Organization');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<input type="text" size="20" class="vst-input" name="v_org" value="<?=htmlentities(trim($v_org, "'")) ?>">
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2">
+						<tr>
+							<td style="padding: 24px 0 0 0;" width="116px">
+								<input type="submit" class="button" name="generate" value="<?=_('Ok');?>">
+							</td>
+							<td style="padding: 24px 0 0 0;">
+								<input type="button" class="button cancel" value="<?=_('Back');?>" onclick="<?=$back?>">
+							</td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 134 - 137
web/templates/pages/list_backup.html

@@ -1,142 +1,139 @@
-    <div class="l-center">
-      <div class="l-sort clearfix noselect">
-        <div class="l-unit-toolbar__buttonstrip">
-          <? if ($read_only === 'true') {?>
-            <!-- Hide item creation button when impersonating 'admin' account -->
-          <? } else { ?>
-            <a href="/schedule/backup/?token=<?=$_SESSION['token']?>" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Create Backup')?></a>
-            <a href="/list/backup/exclusions/" class="ui-button cancel" dir="ltr"><i class="fas fa-folder-minus status-icon orange"></i><?=_('backup exclusions')?></a>
-          <? } ?> 
-        </div>
-        <div class="l-sort-toolbar clearfix">
-          <table>
-            <tr>
-              <td class="l-sort-toolbar__search-box">
-                <form action="/search/" method="get">
-                  <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                  <input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search')?>" />
-                  <button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search')?>"><i class="fas fa-search"></i></button>
-                </form>
-              </td>
-              <? if ($read_only === 'true') {?>
-                <!-- Hide bulk actions for domain items when impersonating 'admin' account-->
-              <? } else { ?>
-                <td>
-                  <form action="/bulk/backup/" method="post" id="objects">
-                  <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                  <div class="l-select">
-                    <select name="action" id="">
-                      <option value=""><?=_('apply to selected')?></option>
-                      <option value="delete"><?php print _('delete') ?></option>
-                    </select>
-                  </div>
-                  <button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected')?>"><i class="fas fa-arrow-right"></i></button>
-                  <form>
-                </td>
-              <? } ?>
-            </tr>
-          </table>
-        </div>
-      </div>
-    </div>
+<!-- Begin toolbar -->
+<div class="l-center">
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<?php if ($read_only !== 'true') {?>
+				<a href="/schedule/backup/?token=<?=$_SESSION['token']?>" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Create Backup');?></a>
+				<a href="/list/backup/exclusions/" class="ui-button cancel" dir="ltr"><i class="fas fa-folder-minus status-icon orange"></i><?=_('backup exclusions');?></a>
+			<?php } ?>
+		</div>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td class="l-sort-toolbar__search-box">
+						<form action="/search/" method="get">
+							<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+							<input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search');?>" />
+							<button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search');?>"><i class="fas fa-search"></i></button>
+						</form>
+					</td>
+					<?php if ($read_only !== 'true') {?>
+						<td>
+							<form action="/bulk/backup/" method="post" id="objects">
+								<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+								<div class="l-select">
+									<select name="action" id="">
+										<option value=""><?=_('apply to selected');?></option>
+										<option value="delete"><?=_('delete') ?></option>
+									</select>
+								</div>
+								<button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected');?>"><i class="fas fa-arrow-right"></i></button>
+							</form>
+						</td>
+					<?php } ?>
+				</tr>
+			</table>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center units">
-        <div class="header table-header">
-            <div class="l-unit__col l-unit__col--right">
-              <div>
-                  <div class="clearfix l-unit__stat-col--left super-compact">
-                      <input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all')?>" onChange="checkedAll('objects');" <?=$display_mode;?>>
-                  </div>
-                  <div class="clearfix l-unit__stat-col--left wide-4"><b><?php print _('File Name');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left compact-4 text-right"><b>&nbsp;</b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Date');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Size');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Type');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Runtime');?></b></div>
-              </div>
-             </div>
-          </div>
-      <?
-        foreach ($data as $key => $value) {
-          ++$i;
-          $web = _('no');
-          $dns = _('no');
-          $mail = _('no');
-          $db = _('no');
-          $cron = _('no');
-          $udir = _('no');
+<div class="l-center units">
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div>
+				<div class="clearfix l-unit__stat-col--left super-compact">
+					<input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all');?>" onChange="checkedAll('objects');" <?=$display_mode;?>>
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide-4"><b><?=_('File Name');?></b></div>
+				<div class="clearfix l-unit__stat-col--left compact-4 text-right"><b>&nbsp;</b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Date');?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Size');?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Type');?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Runtime');?></b></div>
+			</div>
+		</div>
+	</div>
 
-          if (!empty($data[$key]['WEB'])) $web = _('yes');
-          if (!empty($data[$key]['DNS'])) $dns = _('yes');
-          if (!empty($data[$key]['MAIL'])) $mail = _('yes');
-          if (!empty($data[$key]['DB'])) $db = _('yes');
-          if (!empty($data[$key]['CRON'])) $cron = _('yes');
-          if (!empty($data[$key]['UDIR'])) $udir = _('yes');
+	<!-- Begin user backup list item loop -->
+	<?php
+		foreach ($data as $key => $value) {
+			++$i;
+			$web = _('no');
+			$dns = _('no');
+			$mail = _('no');
+			$db = _('no');
+			$cron = _('no');
+			$udir = _('no');
 
-      ?>
+			if (!empty($data[$key]['WEB'])) $web = _('yes');
+			if (!empty($data[$key]['DNS'])) $dns = _('yes');
+			if (!empty($data[$key]['MAIL'])) $mail = _('yes');
+			if (!empty($data[$key]['DB'])) $db = _('yes');
+			if (!empty($data[$key]['CRON'])) $cron = _('yes');
+			if (!empty($data[$key]['UDIR'])) $udir = _('yes');
+		?>
+		<div class="l-unit<?php if($status == 'suspended') echo ' l-unit--outdated';?> animated fadeIn">
+			<div class="l-unit__col l-unit__col--right">
+				<div>
+					<div class="clearfix l-unit__stat-col--left super-compact">
+						<input id="check<?=$i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select');?>" name="backup[]" value="<?=$key?>" <?=$display_mode;?>>
+					</div>
+					<div class="clearfix l-unit__stat-col--left wide-4 truncate">
+						<b>
+							<?php if ($read_only === 'true') {?>
+								<?=$key?>
+							<?php } else { ?>
+								<a href="/list/backup/?backup=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('restore');?>"><?=$key?></a>
+							<?php } ?>
+						</b>
+					</div>
+					<!-- START QUICK ACTION TOOLBAR AREA -->
+					<div class="clearfix l-unit__stat-col--left compact-4 text-right">
+						<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+							<div class="actions-panel clearfix">
+								<?php if (($_SESSION['userContext'] === 'admin') && ($_SESSION['look'] === 'admin') && ($read_only === 'true')) {?>
+									<!-- Restrict ability to restore or delete backups when impersonating 'admin' account -->
+									&nbsp;
+								<?php } else { ?>
+									<div class="actions-panel__col actions-panel__download shortcut-d" key-action="href"><a href="/download/backup/?backup=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('download');?>"><i class="fas fa-file-download status-icon lightblue status-icon dim"></i></a></div>
+									<?php if ($read_only !== 'true') {?>
+										<div class="actions-panel__col actions-panel__list shortcut-enter" key-action="href"><a href="/list/backup/?backup=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('restore');?>"><i class="fas fa-undo status-icon green status-icon dim"></i></a></div>
+										<div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
+											<a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete');?>">
+												<i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
+												<input type="hidden" name="delete_url" value="/delete/backup/?backup=<?=$key?>&token=<?=$_SESSION['token']?>" />
+												<div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation');?>">
+													<p class="confirmation"><?=sprintf(_('DELETE_BACKUP_CONFIRMATION'),$key)?></p>
+												</div>
+											</a>
+										</div>
+									<?php } ?>
+								<?php } ?>
+							</div>
+						</div>
+					</div>
+					<!-- END QUICK ACTION TOOLBAR AREA -->
+					<div class="clearfix l-unit__stat-col--left text-center"><b><?=translate_date($data[$key]['DATE'])?></b></div>
+					<div class="clearfix l-unit__stat-col--left text-center"><b><?=humanize_usage_size($data[$key]['SIZE'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['SIZE'])?></span></div>
+					<div class="clearfix l-unit__stat-col--left text-center"><?=$data[$key]['TYPE']?></div>
+					<div class="clearfix l-unit__stat-col--left text-center"><?=humanize_time($data[$key]['RUNTIME'])?></div>
+				</div>
+			</div>
+		</div>
+	<?php } ?>
+</div>
 
-      <div class="l-unit<? if($status == 'suspended') echo ' l-unit--outdated';?> animated fadeIn">
-            <div class="l-unit__col l-unit__col--right">
-              <div>
-                  <div class="clearfix l-unit__stat-col--left super-compact">
-                    <input id="check<?php echo $i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select')?>" name="backup[]" value="<?php echo $key ?>" <?=$display_mode;?>>
-                  </div>
-                  <div class="clearfix l-unit__stat-col--left wide-4 truncate">
-                    <? if ($read_only === 'true') {?>
-                      <b><?=$key?></b>
-                    <? } else { ?>
-                      <b><a href="/list/backup/?backup=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('restore')?>"><?=$key?></a></b>
-                    <? } ?>
-                  </div>
-                  <!-- START QUICK ACTION TOOLBAR AREA -->
-                  <div class="clearfix l-unit__stat-col--left compact-4 text-right">
-                    <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-                      <div class="actions-panel clearfix">
-                        <? if (($_SESSION['userContext'] === 'admin') && ($_SESSION['look'] === 'admin') && ($read_only === 'true')) {?>
-                          <!-- Restrict ability to restore or delete backups when impersonating 'admin' account -->
-                          &nbsp;
-                        <? } else { ?>
-                          <div class="actions-panel__col actions-panel__download shortcut-d" key-action="href"><a href="/download/backup/?backup=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('download')?>"><i class="fas fa-file-download status-icon lightblue status-icon dim"></i></a></div>
-                          <? if ($read_only === 'false') {?>
-                          <div class="actions-panel__col actions-panel__list shortcut-enter" key-action="href"><a href="/list/backup/?backup=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('restore')?>"><i class="fas fa-undo status-icon green status-icon dim"></i></a></div>
-                          <div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
-                            <a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete')?>">
-                              <i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
-                              <input type="hidden" name="delete_url" value="/delete/backup/?backup=<?=$key?>&token=<?=$_SESSION['token']?>" />
-                              <div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
-                                <p class="confirmation"><?=sprintf(_('DELETE_BACKUP_CONFIRMATION'),$key)?></p>
-                              </div>
-                            </a>
-                          </div>
-                          <? } ?>
-                        <? } ?> 
-                      </div>
-                    </div>
-                  </div>
-                  <!-- END QUICK ACTION TOOLBAR AREA -->
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?=translate_date($data[$key]['DATE'])?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?=humanize_usage_size($data[$key]['SIZE'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['SIZE'])?></span></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><?=$data[$key]['TYPE']?></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><?=humanize_time($data[$key]['RUNTIME'])?></div>
-               </div>
-             </div>
-
-         </div>
-         <?}?>
-       </div>
-
-    <div id="vstobjects">
-      <div class="l-separator"></div>
-      <div class="l-center">
-        <div class="l-unit-ft">
-          <table class='data'></table>
-          <div class="data-count l-unit__col l-unit__col--right clearfix">
-            <?php
-            printf(ngettext('%d backup', '%d backups', $i),$i);
-            ?>
-          </div>
-        </div>
-      </div>
-    </div>
+<div id="vstobjects">
+	<div class="l-separator"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right clearfix">
+				<?php printf(ngettext('%d backup', '%d backups', $i),$i); ?>
+			</div>
+		</div>
+	</div>
+</div>

+ 252 - 310
web/templates/pages/list_backup_detail.html

@@ -1,319 +1,261 @@
-    <div class="l-center">
-      <div class="l-sort clearfix noselect">
-        <div class="l-unit-toolbar__buttonstrip">
-          <a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/backup/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-          <a href="/schedule/restore/?token=<?=$_SESSION['token']?>&backup=<?=htmlentities($_GET['backup'])?>" class="ui-button cancel" dir="ltr"><i class="fas fa-undo status-icon green"></i><?=_('Restore All')?></a>
-        </div>
-        <div class="l-sort-toolbar clearfix">
-          <table>
-            <tr>
-              <td class="l-sort-toolbar__search-box">
-                <form action="/search/" method="get">
-                  <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                  <input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" />
-                  <button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value=""><i class="fas fa-search"></i></button>
-                </form>
-              </td>
-              <td>
-                <form action="/bulk/restore/" method="post" id="objects">
-                <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                <input type="hidden" name="backup" value="<?=htmlentities($_GET['backup']); ?>">
-                <div class="l-select">
-                  <select name="action">
-                    <option value=""><?=_('apply to selected')?></option>
-                    <option value="restore"><?php print _('restore') ?></option>
-                  </select>
-                </div>
-                <button type="submit" class="l-sort-toolbar__filter-apply" value=""><i class="fas fa-arrow-right"></i></button>
-                <form>
-              </td>
-            </tr>
-          </table>
-        </div>
-      </div>
-    </div>
+<!-- Begin toolbar -->
+<div class="l-center">
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/backup/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+			<a href="/schedule/restore/?token=<?=$_SESSION['token']?>&backup=<?=htmlentities($_GET['backup'])?>" class="ui-button cancel" dir="ltr"><i class="fas fa-undo status-icon green"></i><?=_('Restore All');?></a>
+		</div>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td class="l-sort-toolbar__search-box">
+						<form action="/search/" method="get">
+							<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+							<input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" />
+							<button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value=""><i class="fas fa-search"></i></button>
+						</form>
+					</td>
+					<td>
+						<form action="/bulk/restore/" method="post" id="objects">
+							<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+							<input type="hidden" name="backup" value="<?=htmlentities($_GET['backup']); ?>">
+							<div class="l-select">
+								<select name="action">
+									<option value=""><?=_('apply to selected');?></option>
+									<option value="restore"><?=_('restore') ?></option>
+								</select>
+							</div>
+							<button type="submit" class="l-sort-toolbar__filter-apply" value=""><i class="fas fa-arrow-right"></i></button>
+						</form>
+					</td>
+				</tr>
+			</table>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center units">
-      <div class="header table-header">
-          <div class="l-unit__col l-unit__col--right">
-            <div>
-                <div class="clearfix l-unit__stat-col--left super-compact">
-                  <input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" onchange="checkedAll('objects');">
-                </div>
-                <div class="clearfix l-unit__stat-col--left compact-4"><b><?php print _('Type');?></b></div>
-                <div class="clearfix l-unit__stat-col--left wide-7"><b><?php print _('Details');?></b></div>
-                <div class="clearfix l-unit__stat-col--left text-right compact-4"><b><?php print _('Restore');?></b></div>
-            </div>
-           </div>
-        </div>
-      
-      <?
-        $backup = $_GET['backup'];
-        $web = explode(',',$data[$backup]['WEB']);
-        foreach ($web as $key) {
-          if (!empty($key)) {
-            ++$i;
-      ?>
+<div class="l-center units">
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div>
+				<div class="clearfix l-unit__stat-col--left super-compact">
+					<input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" onchange="checkedAll('objects');">
+				</div>
+				<div class="clearfix l-unit__stat-col--left compact-4"><b><?=_('Type');?></b></div>
+				<div class="clearfix l-unit__stat-col--left wide-7"><b><?=_('Details');?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-right compact-4"><b><?=_('Restore');?></b></div>
+			</div>
+		</div>
+	</div>
 
-      <div class="l-unit animated fadeIn">
-        <div class="l-unit__col l-unit__col--right">
-            <div class="clearfix l-unit__stat-col--left super-compact">
-              <input id="check<?=$i?>" class="ch-toggle" type="checkbox" name="web[]" value="<?=$key?>">
-            </div>
+	<!-- List web domains -->
+	<?php
+		$backup = $_GET['backup'];
+		$web = explode(',',$data[$backup]['WEB']);
+		foreach ($web as $key) {
+			if (!empty($key)) {
+				++$i;
+		?>
+		<div class="l-unit animated fadeIn">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left super-compact">
+					<input id="check<?=$i?>" class="ch-toggle" type="checkbox" name="web[]" value="<?=$key?>">
+				</div>
+				<div class="clearfix l-unit__stat-col--left compact-4">
+					<div class="l-unit__stat-col l-unit__stat-col--left"><?=_('Web domain');?></div>
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide-7">
+					<div class="l-unit__stat-col l-unit__stat-col--left wide-7"><b><?=$key?></b></div>
+				</div>
+				<div class="clearfix l-unit__stat-col--left compact-4 text-right">
+					<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+						<div class="actions-panel clearfix">
+							<div class="actions-panel__col actions-panel__list shortcut-enter" key-action="href">
+								<a href="/schedule/restore/?backup=<?=$backup?>&type=web&object=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Restore');?>">
+									<i class="fas fa-undo status-icon green status-icon dim icon-pad-right"></i>
+								</a>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+	<?php }} ?>
 
-            <div class="clearfix l-unit__stat-col--left compact-4">
-                <div class="l-unit__stat-col l-unit__stat-col--left"><?=_('Web domain')?></div>
-            </div>
-            <div class="clearfix l-unit__stat-col--left wide-7">
-                <div class="l-unit__stat-col l-unit__stat-col--left wide-7"><b><?=$key?></b></div>
-            </div>
+	<!-- List mail domains -->
+	<?php
+		$mail = explode(',',$data[$backup]['MAIL']);
+		foreach ($mail as $key) {
+			if (!empty($key)) {
+		?>
+		<div class="l-unit">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left super-compact">
+					<input id="check2<?=$i?>" class="ch-toggle" type="checkbox" name="mail[]" value="<?=$key?>">
+				</div>
+				<div class="clearfix l-unit__stat-col--left compact-4">
+					<div class="l-unit__stat-col l-unit__stat-col--left"><?=_('Mail domain');?></div>
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide-7">
+					<div class="l-unit__stat-col l-unit__stat-col--left wide-7"><b><?=$key?></b></div>
+				</div>
+				<div class="clearfix l-unit__stat-col--left compact-4 text-right">
+					<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+						<div class="actions-panel clearfix">
+							<div class="actions-panel__col actions-panel__list shortcut-enter" key-action="href">
+								<a href="/schedule/restore/?backup=<?=$backup?>&type=mail&object=<?=$key?>&token=<?=$_SESSION['token']?>" title="Restore">
+									<i class="fas fa-undo status-icon green status-icon dim"></i>
+								</a>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+	<?php }} ?>
 
-            <!-- START QUICK ACTION TOOLBAR AREA -->
-            <div class="clearfix l-unit__stat-col--left compact-4 text-right">
-              <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-                <div class="actions-panel clearfix">
-                  <div class="actions-panel__col actions-panel__list shortcut-enter" key-action="href">
-                    <a href="/schedule/restore/?backup=<?=$backup?>&type=web&object=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?php print _('Restore');?>">
-                      <i class="fas fa-undo status-icon green status-icon dim icon-pad-right"></i>
-                    </a>
-                  </div>
-                </div>
-              </div>
-            </div>
-            <!-- END QUICK ACTION TOOLBAR AREA -->
-        </div>
-      </div>
+	<!-- List DNS zones -->
+	<?php
+		$dns = explode(',',$data[$backup]['DNS']);
+		foreach ($dns as $key) {
+			if (!empty($key)) {
+		?>
+		<div class="l-unit">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left super-compact">
+					<input id="check3<?=$i?>" class="ch-toggle" type="checkbox" name="dns[]" value="<?=$key?>">
+				</div>
+				<div class="clearfix l-unit__stat-col--left compact-4">
+					<div class="l-unit__stat-col l-unit__stat-col--left"><?=_('DNS domain');?></div>
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide-7">
+					<div class="l-unit__stat-col l-unit__stat-col--left wide-7"><b><?=$key?></b></div>
+				</div>
+				<div class="clearfix l-unit__stat-col--left compact-4 text-right">
+					<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+						<div class="actions-panel clearfix">
+							<div class="actions-panel__col actions-panel__list shortcut-enter" key-action="href">
+								<a href="/schedule/restore/?backup=<?=$backup?>&type=dns&object=<?=$key?>&token=<?=$_SESSION['token']?>" title="Restore">
+									<i class="fas fa-undo status-icon green status-icon dim"></i>
+								</a>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+	<?php }} ?>
 
-      <? }} ?>
+	<!-- List Databases -->
+	<?php
+		$db = explode(',',$data[$backup]['DB']);
+		foreach ($db as $key) {
+			if (!empty($key)) {
+		?>
+		<div class="l-unit">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left super-compact">
+					<input id="check4<?=$i?>" class="ch-toggle" type="checkbox" name="db[]" value="<?=$key?>">
+				</div>
+				<div class="clearfix l-unit__stat-col--left compact-4">
+					<div class="l-unit__stat-col l-unit__stat-col--left"><?=_('Database');?></div>
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide-7">
+					<div class="l-unit__stat-col l-unit__stat-col--left wide-7"><b><?=$key?></b></div>
+				</div>
+				<div class="clearfix l-unit__stat-col--left compact-4 text-right">
+					<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+						<div class="actions-panel clearfix">
+							<div class="actions-panel__col actions-panel__list shortcut-enter" key-action="href">
+								<a href="/schedule/restore/?backup=<?=$backup?>&type=db&object=<?=$key?>&token=<?=$_SESSION['token']?>" title="Restore">
+									<i class="fas fa-undo status-icon green status-icon dim"></i>
+								</a>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+	<?php }} ?>
 
-      <?
-        $mail = explode(',',$data[$backup]['MAIL']);
-        foreach ($mail as $key) {
-          if (!empty($key)) {
-      ?>
+	<!-- List Cron Jobs -->
+	<?php
+		$backup = $_GET['backup'];
+		if (!empty($data[$backup]['CRON'])) {
+			if (!empty($key)) {
+		?>
+		<div class="l-unit">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left super-compact">
+					<input id="check5<?=$i?>" class="ch-toggle" type="checkbox" name="check" value="<?=$key?>">
+				</div>
+				<div class="clearfix l-unit__stat-col--left compact-4">
+					<div class="l-unit__stat-col l-unit__stat-col--left"><?=_('Cron Records');?></div>
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide-7">
+					<div class="l-unit__stat-col l-unit__stat-col--left wide-7"><b><?='cron '._('records');?></b></div>
+				</div>
+				<div class="clearfix l-unit__stat-col--left compact-4 text-right">
+					<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+						<div class="actions-panel clearfix">
+							<div class="actions-panel__col actions-panel__list shortcut-enter" key-action="href">
+								<a href="/schedule/restore/?backup=<?=$backup?>&type=cron&object=records&token=<?=$_SESSION['token']?>" title="Restore">
+									<i class="fas fa-undo status-icon green status-icon dim"></i>
+								</a>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+	<?php }} ?>
 
-      <div class="l-unit">
-          <div class="l-unit__col l-unit__col--right">
-              <div class="clearfix l-unit__stat-col--left super-compact">
-                  <input id="check2<?=$i?>" class="ch-toggle" type="checkbox" name="mail[]" value="<?=$key?>">
-              </div>
-  
-              <div class="clearfix l-unit__stat-col--left compact-4">
-                  <div class="l-unit__stat-col l-unit__stat-col--left"><?=_('Mail domain')?></div>
-              </div>
-              <div class="clearfix l-unit__stat-col--left wide-7">
-                  <div class="l-unit__stat-col l-unit__stat-col--left wide-7"><b><?=$key?></b></div>
-              </div>
-  
-              <!-- START QUICK ACTION TOOLBAR AREA -->
-              <div class="clearfix l-unit__stat-col--left compact-4 text-right">
-                <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-                  <div class="actions-panel clearfix">
-                    <div class="actions-panel__col actions-panel__list shortcut-enter" key-action="href">
-                      <a href="/schedule/restore/?backup=<?=$backup?>&type=mail&object=<?=$key?>&token=<?=$_SESSION['token']?>" title="Restore">
-                        <i class="fas fa-undo status-icon green status-icon dim"></i>
-                      </a>
-                    </div>
-                  </div>
-                </div>
-              </div>
-              <!-- END QUICK ACTION TOOLBAR AREA -->
-          </div>
-        </div>
+	<!-- List user directories -->
+	<?php
+		$udir = explode(',',$data[$backup]['UDIR']);
+		foreach ($udir as $key) {
+			if (!empty($key)) {
+		?>
+		<div class="l-unit">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left super-compact">
+					<input id="check6<?=$i?>" class="ch-toggle" type="checkbox" name="udir[]" value="<?=$key?>">
+				</div>
+				<div class="clearfix l-unit__stat-col--left compact-4">
+					<div class="l-unit__stat-col l-unit__stat-col--left"><?=_('user dir');?></div>
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide-7">
+					<div class="l-unit__stat-col l-unit__stat-col--left wide-7"><b><?=$key?></b></div>
+				</div>
+				<div class="clearfix l-unit__stat-col--left compact-4 text-right">
+					<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+						<div class="actions-panel clearfix">
+							<div class="actions-panel__col actions-panel__list shortcut-enter" key-action="href">
+								<a href="/schedule/restore/?backup=<?=$backup?>&type=udir&object=<?=$key?>&token=<?=$_SESSION['token']?>" title="Restore">
+									<i class="fas fa-undo status-icon green status-icon dim"></i>
+								</a>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+	<?php }} ?>
+</div>
 
-      <? }} ?>
-
-      <?
-        $dns = explode(',',$data[$backup]['DNS']);
-        foreach ($dns as $key) {
-          if (!empty($key)) {
-      ?>
-
-      <div class="l-unit">
-          <div class="l-unit__col l-unit__col--right">
-              <div class="clearfix l-unit__stat-col--left super-compact">
-                <input id="check3<?=$i?>" class="ch-toggle" type="checkbox" name="dns[]" value="<?=$key?>">
-              </div>
-  
-              <div class="clearfix l-unit__stat-col--left compact-4">
-                  <div class="l-unit__stat-col l-unit__stat-col--left"><?=_('DNS domain')?></div>
-              </div>
-              <div class="clearfix l-unit__stat-col--left wide-7">
-                  <div class="l-unit__stat-col l-unit__stat-col--left wide-7"><b><?=$key?></b></div>
-              </div>
-  
-              <!-- START QUICK ACTION TOOLBAR AREA -->
-              <div class="clearfix l-unit__stat-col--left compact-4 text-right">
-                <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-                  <div class="actions-panel clearfix">
-                    <div class="actions-panel__col actions-panel__list shortcut-enter" key-action="href">
-                      <a href="/schedule/restore/?backup=<?=$backup?>&type=dns&object=<?=$key?>&token=<?=$_SESSION['token']?>" title="Restore">
-                        <i class="fas fa-undo status-icon green status-icon dim"></i>
-                      </a>
-                    </div>
-                  </div>
-                </div>
-              </div>
-              <!-- END QUICK ACTION TOOLBAR AREA -->
-          </div>
-      </div>
-
-      <? }} ?>
-
-      <?
-        $db = explode(',',$data[$backup]['DB']);
-        foreach ($db as $key) {
-          if (!empty($key)) {
-      ?>
-
-      <div class="l-unit">
-          <div class="l-unit__col l-unit__col--right">
-              <div class="clearfix l-unit__stat-col--left super-compact">
-                <input id="check4<?=$i?>" class="ch-toggle" type="checkbox" name="db[]" value="<?=$key?>">
-              </div>
-  
-              <div class="clearfix l-unit__stat-col--left compact-4">
-                  <div class="l-unit__stat-col l-unit__stat-col--left"><?=_('Database')?></div>
-              </div>
-              <div class="clearfix l-unit__stat-col--left wide-7">
-                  <div class="l-unit__stat-col l-unit__stat-col--left wide-7"><b><?=$key?></b></div>
-              </div>
-  
-              <!-- START QUICK ACTION TOOLBAR AREA -->
-              <div class="clearfix l-unit__stat-col--left compact-4 text-right">
-                <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-                  <div class="actions-panel clearfix">
-                    <div class="actions-panel__col actions-panel__list shortcut-enter" key-action="href">
-                      <a href="/schedule/restore/?backup=<?=$backup?>&type=db&object=<?=$key?>&token=<?=$_SESSION['token']?>" title="Restore">
-                        <i class="fas fa-undo status-icon green status-icon dim"></i>
-                      </a>
-                    </div>
-                  </div>
-                </div>
-              </div>
-              <!-- END QUICK ACTION TOOLBAR AREA -->
-          </div>
-      </div>
-
-      <? }} ?>
-
-      <?
-        $backup = $_GET['backup'];
-        if (!empty($data[$backup]['CRON'])) {
-          if (!empty($key)) {
-      ?>
-
-      <div class="l-unit">
-          <div class="l-unit__col l-unit__col--right">
-              <div class="clearfix l-unit__stat-col--left super-compact">
-                <input id="check5<?=$i?>" class="ch-toggle" type="checkbox" name="check" value="<?=$key?>">
-              </div>
-  
-              <div class="clearfix l-unit__stat-col--left compact-4">
-                  <div class="l-unit__stat-col l-unit__stat-col--left"><?=_('Cron Records')?></div>
-              </div>
-              <div class="clearfix l-unit__stat-col--left wide-7">
-                  <div class="l-unit__stat-col l-unit__stat-col--left wide-7"><b><?='cron '._('records')?></b></div>
-              </div>
-  
-              <!-- START QUICK ACTION TOOLBAR AREA -->
-              <div class="clearfix l-unit__stat-col--left compact-4 text-right">
-                <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-                  <div class="actions-panel clearfix">
-                    <div class="actions-panel__col actions-panel__list shortcut-enter" key-action="href">
-                      <a href="/schedule/restore/?backup=<?=$backup?>&type=cron&object=records&token=<?=$_SESSION['token']?>" title="Restore">
-                        <i class="fas fa-undo status-icon green status-icon dim"></i>
-                      </a>
-                    </div>
-                  </div>
-                </div>
-              </div>
-              <!-- END QUICK ACTION TOOLBAR AREA -->
-          </div>
-      </div>
-      <? }} ?>
-
-      <?
-        $udir = explode(',',$data[$backup]['UDIR']);
-        foreach ($udir as $key) {
-          if (!empty($key)) {
-      ?>
-
-      <div class="l-unit">
-          <div class="l-unit__col l-unit__col--right">
-              <div class="clearfix l-unit__stat-col--left super-compact">
-                <input id="check6<?=$i?>" class="ch-toggle" type="checkbox" name="udir[]" value="<?=$key?>">
-              </div>
-  
-              <div class="clearfix l-unit__stat-col--left compact-4">
-                  <div class="l-unit__stat-col l-unit__stat-col--left"><?=_('user dir')?></div>
-              </div>
-              <div class="clearfix l-unit__stat-col--left wide-7">
-                  <div class="l-unit__stat-col l-unit__stat-col--left wide-7"><b><?=$key?></b></div>
-              </div>
-  
-              <!-- START QUICK ACTION TOOLBAR AREA -->
-              <div class="clearfix l-unit__stat-col--left compact-4 text-right">
-                <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-                  <div class="actions-panel clearfix">
-                    <div class="actions-panel__col actions-panel__list shortcut-enter" key-action="href">
-                      <a href="/schedule/restore/?backup=<?=$backup?>&type=udir&object=<?=$key?>&token=<?=$_SESSION['token']?>" title="Restore">
-                        <i class="fas fa-undo status-icon green status-icon dim"></i>
-                      </a>
-                    </div>
-                  </div>
-                </div>
-              </div>
-              <!-- END QUICK ACTION TOOLBAR AREA -->
-          </div>
-      </div>
-      <? }} ?>
-
-      <div class="l-unit">
-
-          <div class="l-unit__col l-unit__col--right">
-              <div class="clearfix l-unit__stat-col--left super-compact">
-                <input id="check7<?=$i?>" class="ch-toggle" type="checkbox" name="cron" value="<?=$i?>">
-              </div>
-  
-              <div class="clearfix l-unit__stat-col--left compact-4">
-                  <div class="l-unit__stat-col l-unit__stat-col--left"><?=_('Cron')?></div>
-              </div>
-              <div class="clearfix l-unit__stat-col--left wide-7">
-                  <div class="l-unit__stat-col l-unit__stat-col--left wide-7"><b>&nbsp;</b></div>
-              </div>
-  
-              <!-- START QUICK ACTION TOOLBAR AREA -->
-              <div class="clearfix l-unit__stat-col--left compact-4 text-right">
-                <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-                  <div class="actions-panel clearfix">
-                    <div class="actions-panel__col actions-panel__list shortcut-enter" key-action="href">
-                      <a href="/schedule/restore/?backup=<?=$backup?>&type=cron&token=<?=$_SESSION['token']?>" title="Restore">
-                        <i class="fas fa-undo status-icon green status-icon dim"></i>
-                      </a>
-                    </div>
-                  </div>
-                </div>
-              </div>
-              <!-- END QUICK ACTION TOOLBAR AREA -->
-          </div>
-      </div>
-    </div>
-
-    <div id="vstobjects">
-      <div class="l-separator"></div>
-      <div class="l-center">
-        <div class="l-unit-ft">
-          <table class='data'></table>
-          <div class="data-count l-unit__col l-unit__col--right total clearfix">
-              <?php
-              printf(ngettext('%d item', '%d items', $i),$i);
-              ?>
-          </div>
-          <div class="data-count l-unit__col l-unit__col--right back clearfix">
-          </div>
-        </div>
-      </div>
-    </div>
+<div id="vstobjects">
+	<div class="l-separator"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right total clearfix">
+				<?php printf(ngettext('%d item', '%d items', $i),$i); ?>
+			</div>
+			<div class="data-count l-unit__col l-unit__col--right back clearfix">
+			</div>
+		</div>
+	</div>
+</div>

+ 65 - 64
web/templates/pages/list_backup_exclusions.html

@@ -1,68 +1,69 @@
-    <div class="l-center">
-      <div class="l-sort clearfix noselect">
-        <div class="l-unit-toolbar__buttonstrip">
-          <a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/backup/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-          <a href="/edit/backup/exclusions/" class="ui-button cancel" dir="ltr"><i class="fas fa-pencil-alt status-icon orange"></i><?=_('Editing Backup Exclusions')?></a>
-        </div>
-        <div class="l-sort-toolbar clearfix">
-          <table>
-            <tr>
-              <td class="l-sort-toolbar__search-box">
-                <form action="/search/" method="get">
-                  <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                  <input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search')?>" />
-                  <button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search')?>"><i class="fas fa-search"></i></button>
-                </form>
-              </td>
-            </tr>
-          </table>
-        </div>
-      </div>
-    </div>
+<!-- Begin toolbar -->
+<div class="l-center">
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/backup/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+			<a href="/edit/backup/exclusions/" class="ui-button cancel" dir="ltr"><i class="fas fa-pencil-alt status-icon orange"></i><?=_('Editing Backup Exclusions');?></a>
+		</div>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td class="l-sort-toolbar__search-box">
+						<form action="/search/" method="get">
+							<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+							<input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search');?>" />
+							<button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search');?>"><i class="fas fa-search"></i></button>
+						</form>
+					</td>
+				</tr>
+			</table>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
-    
-    <div class="l-center units">
-      <div class="header table-header">     
-        <div class="l-unit__col l-unit__col--right">
-          <div class="clearfix l-unit__stat-col--left super-compact">&nbsp;</div>
-          <div class="clearfix l-unit__stat-col--left wide-1"><b><?php print _('Type');?></b></div>
-          <div class="clearfix l-unit__stat-col--left compact text-right"><b>&nbsp;</b></div>
-          <div class="clearfix l-unit__stat-col--left wide-3"><b><?php print _('Value');?></b></div>
-        </div>
-      </div>
+<div class="l-separator"></div>
 
-    <div class="l-center units animated fadeIn">
-      <?
-        foreach ($data as $key => $value) {
-      ?>
+<div class="l-center units">
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left super-compact">&nbsp;</div>
+			<div class="clearfix l-unit__stat-col--left wide-1"><b><?=_('Type');?></b></div>
+			<div class="clearfix l-unit__stat-col--left compact text-right"><b>&nbsp;</b></div>
+			<div class="clearfix l-unit__stat-col--left wide-3"><b><?=_('Value');?></b></div>
+		</div>
+	</div>
 
-      
-      <div class="l-unit header">
-        <div class="l-unit__col l-unit__col--right">
-          <div class="clearfix l-unit__stat-col--left super-compact">&nbsp;</div>
-          <div class="clearfix l-unit__stat-col--left wide-1"><b><?=$key?></b></div>
-          <div class="clearfix l-unit__stat-col--left compact text-right"><b>&nbsp;</b></div>
-          <div class="clearfix l-unit__stat-col--left wide-3">
-            <?
-              if (empty($value)) echo _('no exclusions');
-              foreach ($value as $ex_key => $ex_value) {
-              echo '<b>'.$ex_key.' </b>'.$ex_value.'<br>';
-              }
-            ?>
-          </div>
-        </div>
-      </div>
-    <?}?>
-  </div>
+	<div class="l-center units animated fadeIn">
+		<!-- Begin list of backup exclusions by type -->
+		<?php
+			foreach ($data as $key => $value) {
+			?>
+			<div class="l-unit header">
+				<div class="l-unit__col l-unit__col--right">
+					<div class="clearfix l-unit__stat-col--left super-compact">&nbsp;</div>
+					<div class="clearfix l-unit__stat-col--left wide-1"><b><?=$key?></b></div>
+					<div class="clearfix l-unit__stat-col--left compact text-right"><b>&nbsp;</b></div>
+					<div class="clearfix l-unit__stat-col--left wide-3">
+						<?php
+							if (empty($value)) echo _('no exclusions');
+							foreach ($value as $ex_key => $ex_value) {
+								echo '<b>'.$ex_key.' </b>'.$ex_value.'<br>';
+							}
+						?>
+					</div>
+				</div>
+			</div>
+		<?php } ?>
+	</div>
 
-    <div id="vstobjects">
-      <div class="l-separator"></div>
-      <div class="l-center">
-        <div class="l-unit-ft">
-          <table class='data'></table>
-          <div class="data-count l-unit__col l-unit__col--right total clearfix">
-          </div>
-      </div>
-    </div>
-  </div>
+	<div id="vstobjects">
+		<div class="l-separator"></div>
+		<div class="l-center">
+			<div class="l-unit-ft">
+				<table class='data'></table>
+				<div class="data-count l-unit__col l-unit__col--right total clearfix">
+				</div>
+			</div>
+		</div>
+	</div>

+ 159 - 162
web/templates/pages/list_cron.html

@@ -1,166 +1,163 @@
- <div class="l-center">
-      <div class="l-sort clearfix noselect">
-        <div class="l-unit-toolbar__buttonstrip">
-          <? if ($read_only === 'true') {?>
-            <!-- Hide item creation button when impersonating 'admin' account -->
-          <? } else { ?>
-            <a href="/add/cron/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add Cron Job')?></a>
-            <? if($panel[$user]['CRON_REPORTS'] == 'yes') { ?>
-              <a class="ui-button cancel" dir="ltr" href="/delete/cron/reports/?token='.$_SESSION['token'].'"><i class="fas fa-toggle-off status-icon green"></i><?=_('turn off notifications')?></a>
-            <? } else { ?>
-              <a class="ui-button cancel" dir="ltr" href="/add/cron/reports/?token='.$_SESSION['token'].'"><i class="fas fa-toggle-off status-icon grey"></i><?=_('turn on notifications')?></a>
-            <? } ?> 
-          <? } ?> 
-        </div>
-        <ul class="context-menu sort-order animated fadeIn" style="display:none;">
-          <li entity="sort-name"><span class="name <? if ($_SESSION['userSortOrder'] === 'name') { echo 'active'; } ?>"><?=_('Command')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-date" sort_as_int="1"><span class="name <? if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-        </ul>
-        <div class="l-sort-toolbar clearfix">
-          <table>
-            <tr>
-              <td class="sort-by" title="<?=_('Sort items');?>">
-                <?=_('sort by');?>: <span>
-                  <b>
-                    <? if ($_SESSION['userSortOrder'] === 'name') { $label = 'Command'; } else { $label = 'Date'; } ?>
-                    <?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
-                  </b>
-                </span>
-              </td>
-              <td class="l-sort-toolbar__search-box">
-                <form action="/search/" method="get">
-                  <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                  <input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search')?>"/>
-                  <button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search')?>"><i class="fas fa-search"></i></button>
-                </form>
-              </td>
-              <? if ($read_only === 'true') {?>
-                <!-- Hide bulk actions for domain items when impersonating 'admin' account-->
-              <? } else { ?>
-                <td class="">
-                  <form action="/bulk/cron/" method="post" id="objects">
-                  <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                  <div class="l-select">
-                    <select name="action" id="">
-                      <option value=""><?=_('apply to selected')?></option>
-                      <? if($panel[$user]['CRON_REPORTS'] == 'yes') echo '<option value="delete-cron-reports">'._('turn off notifications').'</option>'; ?>
-                      <? if($panel[$user]['CRON_REPORTS'] == 'no') echo '<option value="add-cron-reports">'._('turn on notifications').'</option>'; ?>
-                      <option value="suspend"><?=_('suspend')?></option>
-                      <option value="unsuspend"><?=_('unsuspend')?></option>
-                      <option value="delete"><?=_('delete')?></option>
-                    </select>
-                  </div>
-                  <button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected')?>"><i class="fas fa-arrow-right"></i></button>
-                  </form>
-                </td>
-              <? } ?>
-            </tr>
-          </table>
-        </div>
-      </div>
-    </div>
+<!-- Begin toolbar -->
+<div class="l-center">
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<?php if ($read_only !== 'true') {?>
+				<a href="/add/cron/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add Cron Job');?></a>
+				<?php if($panel[$user]['CRON_REPORTS'] == 'yes') { ?>
+					<a class="ui-button cancel" dir="ltr" href="/delete/cron/reports/?token=<?=$_SESSION['token'];?>"><i class="fas fa-toggle-off status-icon green"></i><?=_('turn off notifications');?></a>
+				<?php } else { ?>
+					<a class="ui-button cancel" dir="ltr" href="/add/cron/reports/?token=<?=$_SESSION['token'];?>"><i class="fas fa-toggle-off status-icon grey"></i><?=_('turn on notifications');?></a>
+				<?php } ?>
+			<?php } ?>
+		</div>
+		<ul class="context-menu sort-order animated fadeIn" style="display:none;">
+			<li entity="sort-name"><span class="name <?php if ($_SESSION['userSortOrder'] === 'name') { echo 'active'; } ?>"><?=_('Command');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-date" sort_as_int="1"><span class="name <?php if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+		</ul>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td class="sort-by" title="<?=_('Sort items');?>">
+						<?=_('sort by');?>: <span>
+							<b>
+								<?php if ($_SESSION['userSortOrder'] === 'name') { $label = 'Command'; } else { $label = 'Date'; } ?>
+								<?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
+							</b>
+						</span>
+					</td>
+					<td class="l-sort-toolbar__search-box">
+						<form action="/search/" method="get">
+							<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+							<input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search');?>" />
+							<button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search');?>"><i class="fas fa-search"></i></button>
+						</form>
+					</td>
+					<?php if ($read_only !== 'true') {?>
+						<td class="">
+							<form action="/bulk/cron/" method="post" id="objects">
+								<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+								<div class="l-select">
+									<select name="action" id="">
+										<option value=""><?=_('apply to selected');?></option>
+										<?php if($panel[$user]['CRON_REPORTS'] == 'yes') echo '<option value="delete-cron-reports">'._('turn off notifications').'</option>'; ?>
+										<?php if($panel[$user]['CRON_REPORTS'] == 'no') echo '<option value="add-cron-reports">'._('turn on notifications').'</option>'; ?>
+										<option value="suspend"><?=_('suspend');?></option>
+										<option value="unsuspend"><?=_('unsuspend');?></option>
+										<option value="delete"><?=_('delete');?></option>
+									</select>
+								</div>
+								<button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected');?>"><i class="fas fa-arrow-right"></i></button>
+							</form>
+						</td>
+					<?php } ?>
+				</tr>
+			</table>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center units">
-      <div class="header table-header">
-        <div class="l-unit__col l-unit__col--right">
-          <div class="clearfix l-unit__stat-col--left super-compact">
-            <input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all')?>" onChange="checkedAll('objects');" <?=$display_mode;?>>
-          </div>
-          <div class="clearfix l-unit__stat-col--left wide-5"><b><?php print _('Command');?></b></div>
-          <div class="clearfix l-unit__stat-col--left compact-2 text-right"><b>&nbsp;</b></div>
-          <div class="clearfix l-unit__stat-col--left compact-3 text-center"><b><?=_('Min')?></b></div>
-          <div class="clearfix l-unit__stat-col--left compact-3 text-center"><b><?=_('Hour')?></b></div>
-          <div class="clearfix l-unit__stat-col--left compact-3 text-center"><b><?=_('Day')?></b></div>
-          <div class="clearfix l-unit__stat-col--left compact-3 text-center"><b><?=_('Month')?></b></div>
-          <div class="clearfix l-unit__stat-col--left compact-3 text-center"><b><?=_('Day of week')?></b></div>
-        </div>
-      </div>
-      <?
-        foreach ($data as $key => $value) {
-          ++$i;
-          if ($data[$key]['SUSPENDED'] == 'yes') {
-            $status = 'suspended';
-            $spnd_action = 'unsuspend';
-            $spnd_icon = 'fa-play';
-            $spnd_confirmation = _('UNSUSPEND_CRON_CONFIRMATION') ;
-          } else {
-            $status = 'active';
-            $spnd_action = 'suspend';
-            $spnd_icon = 'fa-pause';
-            $spnd_confirmation = _('SUSPEND_CRON_CONFIRMATION') ;
-          }
-      ?>
+<div class="l-center units">
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left super-compact">
+				<input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all');?>" onChange="checkedAll('objects');" <?=$display_mode;?>>
+			</div>
+			<div class="clearfix l-unit__stat-col--left wide-5"><b><?=_('Command');?></b></div>
+			<div class="clearfix l-unit__stat-col--left compact-2 text-right"><b>&nbsp;</b></div>
+			<div class="clearfix l-unit__stat-col--left compact-3 text-center"><b><?=_('Min');?></b></div>
+			<div class="clearfix l-unit__stat-col--left compact-3 text-center"><b><?=_('Hour');?></b></div>
+			<div class="clearfix l-unit__stat-col--left compact-3 text-center"><b><?=_('Day');?></b></div>
+			<div class="clearfix l-unit__stat-col--left compact-3 text-center"><b><?=_('Month');?></b></div>
+			<div class="clearfix l-unit__stat-col--left compact-3 text-center"><b><?=_('Day of week');?></b></div>
+		</div>
+	</div>
 
-      <div class="l-unit <? if($status == 'suspended') echo 'l-unit--suspended'; if($_SESSION['favourites']['CRON'][$key] == 1) echo ' l-unit--starred'; ?> animated fadeIn" v_unit_id="<?=$key?>" v_section="cron"
-sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>" sort-name="<?=htmlspecialchars($data[$key]['CMD'], ENT_NOQUOTES)?>"
-sort-star="<? if($_SESSION['favourites']['CRON'][$key] == 1) echo '1'; else echo '0';  ?>">
-      <div class="l-unit__col l-unit__col--right">
-        <div class="clearfix l-unit__stat-col--left super-compact">
-          <input id="check<?php echo $i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select')?>" name="job[]" value="<?php echo $key ?>" <?=$display_mode;?>>
-        </div>
-        <div class="clearfix l-unit__stat-col--left wide-5 truncate">
-        <? if (($read_only === 'true') || ($data[$key]['SUSPENDED'] == 'yes')) {?>
-          <b><?=htmlspecialchars($data[$key]['CMD'], ENT_NOQUOTES)?></b> 
-        <? } else { ?>
-          <b><a href="/edit/cron/?job=<?=$data[$key]['JOB']?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Cron Job')?>: <?=htmlspecialchars($data[$key]['CMD'], ENT_NOQUOTES)?>"><?=htmlspecialchars($data[$key]['CMD'], ENT_NOQUOTES)?></a></b> 
-        <? } ?>  
-        </div>
-        <!-- START QUICK ACTION TOOLBAR AREA -->
-        <div class="clearfix l-unit__stat-col--left compact-2 text-right">
-          <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-            <div class="actions-panel clearfix">
-              <? if ($read_only === 'true') {?>
-                <!-- Restrict other administrators from editing, deleting, or suspending 'admin' user cron jobs -->
-                &nbsp;
-              <? } else { ?>
-                <? if ($data[$key]['SUSPENDED'] == 'no') {?>
-                  <div class="actions-panel__col actions-panel__download shortcut-enter" key-action="href"><a href="/edit/cron/?job=<?=$data[$key]['JOB']?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Cron Job')?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
-                <? } ?>
-                <div class="actions-panel__col actions-panel__suspend shortcut-s" key-action="js">
-                  <a id="<?=$spnd_action ?>_link_<?=$i?>" class="data-controls do_<?=$spnd_action?>" title="<?=_($spnd_action)?>">
-                    <i class="fas <?=$spnd_icon?> status-icon highlight status-icon dim do_<?=$spnd_action?>"></i>
-                    <input type="hidden" name="<?=$spnd_action?>_url" value="/<?=$spnd_action?>/cron/?job=<?=$data[$key]['JOB']?>&token=<?=$_SESSION['token']?>" />
-                    <div id="<?=$spnd_action?>_dialog_<?=$i?>" class="confirmation-text-suspention hidden" title="<?=_('Confirmation')?>">
-                      <p class="confirmation"><?=sprintf($spnd_confirmation,$key)?></p>
-                    </div>
-                  </a>
-                </div>
-                <div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
-                  <a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete')?>">
-                    <i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
-                    <input type="hidden" name="delete_url" value="/delete/cron/?job=<?=$data[$key]['JOB']?>&token=<?=$_SESSION['token']?>" />
-                    <div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
-                      <p class="confirmation"><?=sprintf(_('DELETE_CRON_CONFIRMATION'),$key)?></p>
-                    </div>
-                  </a>
-                </div>
-              <? } ?>          
-              </div>
-             </div>
-            </div>
-            <!-- END QUICK ACTION TOOLBAR AREA -->
-            <div class="clearfix l-unit__stat-col--left compact-3 text-center"><?=$data[$key]['MIN']?></div>
-            <div class="clearfix l-unit__stat-col--left compact-3 text-center"><?=$data[$key]['HOUR']?></div>
-            <div class="clearfix l-unit__stat-col--left compact-3 text-center"><?=$data[$key]['DAY']?></div>
-            <div class="clearfix l-unit__stat-col--left compact-3 text-center"><?=$data[$key]['MONTH']?></div>
-            <div class="clearfix l-unit__stat-col--left compact-3 text-center"><?=$data[$key]['WDAY']?></div>
-          </div>
-        </div>
-    <?}?>
-  </div>
+	<!-- Begin cron job list item loop -->
+	<?php
+		foreach ($data as $key => $value) {
+			++$i;
+			if ($data[$key]['SUSPENDED'] == 'yes') {
+				$status = 'suspended';
+				$spnd_action = 'unsuspend';
+				$spnd_icon = 'fa-play';
+				$spnd_confirmation = _('UNSUSPEND_CRON_CONFIRMATION') ;
+			} else {
+				$status = 'active';
+				$spnd_action = 'suspend';
+				$spnd_icon = 'fa-pause';
+				$spnd_confirmation = _('SUSPEND_CRON_CONFIRMATION') ;
+			}
+		?>
+		<div class="l-unit <?php if($status == 'suspended') echo 'l-unit--suspended'; if($_SESSION['favourites']['CRON'][$key] == 1) echo ' l-unit--starred'; ?> animated fadeIn" v_unit_id="<?=$key?>" v_section="cron"
+			sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>" sort-name="<?=htmlspecialchars($data[$key]['CMD'], ENT_NOQUOTES)?>"
+			sort-star="<?php if($_SESSION['favourites']['CRON'][$key] == 1) echo '1'; else echo '0';  ?>">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left super-compact">
+					<input id="check<?=$i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select');?>" name="job[]" value="<?=$key?>" <?=$display_mode;?>>
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide-5 truncate">
+					<?php if (($read_only === 'true') || ($data[$key]['SUSPENDED'] == 'yes')) {?>
+						<b><?=htmlspecialchars($data[$key]['CMD'], ENT_NOQUOTES)?></b>
+					<?php } else { ?>
+						<b><a href="/edit/cron/?job=<?=$data[$key]['JOB']?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Cron Job');?>: <?=htmlspecialchars($data[$key]['CMD'], ENT_NOQUOTES)?>"><?=htmlspecialchars($data[$key]['CMD'], ENT_NOQUOTES)?></a></b>
+					<?php } ?>
+				</div>
+				<!-- START QUICK ACTION TOOLBAR AREA -->
+				<div class="clearfix l-unit__stat-col--left compact-2 text-right">
+					<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+						<div class="actions-panel clearfix">
+							<?php if ($read_only === 'true') {?>
+								<!-- Restrict other administrators from editing, deleting, or suspending 'admin' user cron jobs -->
+								&nbsp;
+							<?php } else { ?>
+								<?php if ($data[$key]['SUSPENDED'] == 'no') {?>
+									<div class="actions-panel__col actions-panel__download shortcut-enter" key-action="href"><a href="/edit/cron/?job=<?=$data[$key]['JOB']?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Cron Job');?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
+								<?php } ?>
+								<div class="actions-panel__col actions-panel__suspend shortcut-s" key-action="js">
+									<a id="<?=$spnd_action ?>_link_<?=$i?>" class="data-controls do_<?=$spnd_action?>" title="<?=_($spnd_action)?>">
+										<i class="fas <?=$spnd_icon?> status-icon highlight status-icon dim do_<?=$spnd_action?>"></i>
+										<input type="hidden" name="<?=$spnd_action?>_url" value="/<?=$spnd_action?>/cron/?job=<?=$data[$key]['JOB']?>&token=<?=$_SESSION['token']?>" />
+										<div id="<?=$spnd_action?>_dialog_<?=$i?>" class="confirmation-text-suspention hidden" title="<?=_('Confirmation');?>">
+											<p class="confirmation"><?=sprintf($spnd_confirmation,$key)?></p>
+										</div>
+									</a>
+								</div>
+								<div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
+									<a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete');?>">
+										<i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
+										<input type="hidden" name="delete_url" value="/delete/cron/?job=<?=$data[$key]['JOB']?>&token=<?=$_SESSION['token']?>" />
+										<div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation');?>">
+											<p class="confirmation"><?=sprintf(_('DELETE_CRON_CONFIRMATION'),$key)?></p>
+										</div>
+									</a>
+								</div>
+							<?php } ?>
+						</div>
+					</div>
+				</div>
+				<!-- END QUICK ACTION TOOLBAR AREA -->
+				<div class="clearfix l-unit__stat-col--left compact-3 text-center"><?=$data[$key]['MIN']?></div>
+				<div class="clearfix l-unit__stat-col--left compact-3 text-center"><?=$data[$key]['HOUR']?></div>
+				<div class="clearfix l-unit__stat-col--left compact-3 text-center"><?=$data[$key]['DAY']?></div>
+				<div class="clearfix l-unit__stat-col--left compact-3 text-center"><?=$data[$key]['MONTH']?></div>
+				<div class="clearfix l-unit__stat-col--left compact-3 text-center"><?=$data[$key]['WDAY']?></div>
+			</div>
+		</div>
+	<?php } ?>
+</div>
 
-  <div id="vstobjects">
-    <div class="l-separator"></div>
-    <div class="l-center">
-      <div class="l-unit-ft">
-        <table class='data'></table>
-        <div class="data-count l-unit__col l-unit__col--right clearfix">
-            <?php
-            printf(ngettext('%d cron job', '%d cron jobs', $i),$i);
-            ?>                
-        </div>
-      </div>
-    </div>
-  </div>
+<div id="vstobjects">
+	<div class="l-separator"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right clearfix">
+				<?php printf(ngettext('%d cron job', '%d cron jobs', $i),$i); ?>
+			</div>
+		</div>
+	</div>
+</div>

+ 188 - 193
web/templates/pages/list_db.html

@@ -1,201 +1,196 @@
-<?
-  list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"].":");
+<?php
+	list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"].":");
 
-  $db_myadmin_link = "//".$http_host."/phpmyadmin/";
-  $db_pgadmin_link = "//".$http_host."/phppgadmin/";
+	$db_myadmin_link = "//".$http_host."/phpmyadmin/";
+	$db_pgadmin_link = "//".$http_host."/phppgadmin/";
 
-  if (!empty($_SESSION['DB_PMA_ALIAS'])) {
-    $db_myadmin_link = "//".$http_host."/".$_SESSION['DB_PMA_ALIAS']."/";
-  }
-  if (!empty($_SESSION['DB_PGA_ALIAS'])) {
-    $db_pgadmin_link = "//".$http_host."/".$_SESSION['DB_PGA_ALIAS']."/";
-  }
+	if (!empty($_SESSION['DB_PMA_ALIAS'])) {
+		$db_myadmin_link = "//".$http_host."/".$_SESSION['DB_PMA_ALIAS']."/";
+	}
+	if (!empty($_SESSION['DB_PGA_ALIAS'])) {
+		$db_pgadmin_link = "//".$http_host."/".$_SESSION['DB_PGA_ALIAS']."/";
+	}
 ?>
 
-    <div class="l-center">
-      <div class="l-sort clearfix noselect">
-        <div class="l-unit-toolbar__buttonstrip">
-          <? if ($read_only === 'true') {?>
-            <!-- Hide item creation button when impersonating 'admin' account -->
-          <? } else {?>
-            <a href="/add/db/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add Database')?></a>
-            <? if (($_SESSION['DB_SYSTEM'] === 'mysql') || ($_SESSION['DB_SYSTEM'] === 'mysql,pgsql') || ($_SESSION['DB_SYSTEM'] === 'pgsql,mysql')) {?>
-              <a class="ui-button cancel" dir="ltr" href="<?php echo $db_myadmin_link; ?>" target="_blank"><i class="fas fa-database status-icon orange"></i>phpMyAdmin</a>
-            <? } ?>
-            <? if (($_SESSION['DB_SYSTEM'] === 'pgsql') || ($_SESSION['DB_SYSTEM'] === 'mysql,pgsql') || ($_SESSION['DB_SYSTEM'] === 'pgsql,mysql')) {?>
-              <a class="ui-button cancel" dir="ltr" href="<?php echo $db_pgadmin_link; ?>" target="_blank"><i class="fas fa-database status-icon orange"></i>phpPgAdmin</a>
-            <? } ?>
-          <? } ?>
-        </div>
-        <ul class="context-menu sort-order animated fadeIn" style="display:none;">
-          <li entity="sort-charset"><span class="name"><?=_('Charset')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-           <li entity="sort-date" sort_as_int="1"><span class="name <? if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-disk" sort_as_int="1"><span class="name"><?=_('Disk')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-name"><span class="name <? if ($_SESSION['userSortOrder'] === 'name') { echo 'active'; } ?>"><?=_('Name')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-server"><span class="name"><?=_('Host')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-user"><span class="name"><?=_('Username')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-        </ul>
-        <div class="l-sort-toolbar clearfix">
-          <table>
-            <tr>
-              <td class="sort-by" title="<?=_('Sort items');?>">
-                <?=_('sort by');?>: <span>
-                  <b>
-                    <? if ($_SESSION['userSortOrder'] === 'name') { $label = 'Name'; } else { $label = 'Date'; } ?>
-                    <?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
-                  </b>
-                </span>
-              </td>
-              <td class="l-sort-toolbar__search-box">
-                <form action="/search/" method="get">
-                  <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                  <input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search')?>" />
-                  <button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search')?>"><i class="fas fa-search"></i></button>
-                </form>
-              </td>
-              <? if ($read_only === 'true') {?>
-                <!-- Hide bulk actions for domain items when impersonating 'admin' account-->
-              <? } else { ?>
-                <td>
-                  <form action="/bulk/db/" method="post" id="objects">
-                  <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                  <div class="l-select">
-                    <select name="action" id="">
-                      <option value=""><?=_('apply to selected')?></option>
-                      <? if ($_SESSION['userContext'] === 'admin') {?>
-                        <option value="rebuild"><?=_('rebuild')?></option>
-                      <? } ?>
-                      <option value="suspend"><?=_('suspend')?></option>
-                      <option value="unsuspend"><?=_('unsuspend')?></option>
-                      <option value="delete"><?=_('delete')?></option>
-                    </select>
-                  </div>
-                  <button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected')?>"><i class="fas fa-arrow-right"></i></button>
-                  </form>
-                </td>
-              <? } ?>
-            </tr>
-          </table>
-        </div>
-      </div>
-    </div>
+<!-- Begin toolbar -->
+<div class="l-center">
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<?php if ($read_only !== 'true') {?>
+				<a href="/add/db/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add Database');?></a>
+				<?php if (($_SESSION['DB_SYSTEM'] === 'mysql') || ($_SESSION['DB_SYSTEM'] === 'mysql,pgsql') || ($_SESSION['DB_SYSTEM'] === 'pgsql,mysql')) {?>
+					<a class="ui-button cancel" dir="ltr" href="<?=$db_myadmin_link; ?>" target="_blank"><i class="fas fa-database status-icon orange"></i>phpMyAdmin</a>
+				<?php } ?>
+				<?php if (($_SESSION['DB_SYSTEM'] === 'pgsql') || ($_SESSION['DB_SYSTEM'] === 'mysql,pgsql') || ($_SESSION['DB_SYSTEM'] === 'pgsql,mysql')) {?>
+					<a class="ui-button cancel" dir="ltr" href="<?=$db_pgadmin_link; ?>" target="_blank"><i class="fas fa-database status-icon orange"></i>phpPgAdmin</a>
+				<?php } ?>
+			<?php } ?>
+		</div>
+		<ul class="context-menu sort-order animated fadeIn" style="display:none;">
+			<li entity="sort-charset"><span class="name"><?=_('Charset');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-date" sort_as_int="1"><span class="name <?php if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-disk" sort_as_int="1"><span class="name"><?=_('Disk');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-name"><span class="name <?php if ($_SESSION['userSortOrder'] === 'name') { echo 'active'; } ?>"><?=_('Name');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-server"><span class="name"><?=_('Host');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-user"><span class="name"><?=_('Username');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+		</ul>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td class="sort-by" title="<?=_('Sort items');?>">
+						<?=_('sort by');?>: <span>
+							<b>
+								<?php if ($_SESSION['userSortOrder'] === 'name') { $label = 'Name'; } else { $label = 'Date'; } ?>
+								<?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
+							</b>
+						</span>
+					</td>
+					<td class="l-sort-toolbar__search-box">
+						<form action="/search/" method="get">
+							<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+							<input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search');?>" />
+							<button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search');?>"><i class="fas fa-search"></i></button>
+						</form>
+					</td>
+					<?php if ($read_only !== 'true') {?>
+						<td>
+							<form action="/bulk/db/" method="post" id="objects">
+								<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+								<div class="l-select">
+									<select name="action" id="">
+										<option value=""><?=_('apply to selected');?></option>
+										<?php if ($_SESSION['userContext'] === 'admin') {?>
+											<option value="rebuild"><?=_('rebuild');?></option>
+										<?php } ?>
+										<option value="suspend"><?=_('suspend');?></option>
+										<option value="unsuspend"><?=_('unsuspend');?></option>
+										<option value="delete"><?=_('delete');?></option>
+									</select>
+								</div>
+								<button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected');?>"><i class="fas fa-arrow-right"></i></button>
+							</form>
+						</td>
+					<?php } ?>
+				</tr>
+			</table>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center units">
-        <div class="header table-header">
-            <div class="l-unit__col l-unit__col--right">
-                  <div class="clearfix l-unit__stat-col--left super-compact">
-                      <input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all')?>" onChange="checkedAll('objects');" <?=$display_mode;?>>
-                  </div>
-                  <div class="clearfix l-unit__stat-col--left wide-3"><b><?php print _('Name');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-right compact-3"><b>&nbsp;</b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center compact"><b><?php print _('Type');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Disk');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center wide"><b><?php print _('Username');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Hostname');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Charset');?></b></div>
-             </div>
-          </div>
+<div class="l-center units">
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left super-compact">
+				<input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all');?>" onChange="checkedAll('objects');" <?=$display_mode;?>>
+			</div>
+			<div class="clearfix l-unit__stat-col--left wide-3"><b><?=_('Name');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-right compact-3"><b>&nbsp;</b></div>
+			<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Disk');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact"><b><?=_('Type');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center wide"><b><?=_('Username');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Hostname');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Charset');?></b></div>
+		</div>
+	</div>
 
-      <?
-        list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"].":");
-        foreach ($data as $key => $value) {
-          ++$i;
-          if ($data[$key]['SUSPENDED'] == 'yes') {
-            $status = 'suspended';
-            $spnd_action = 'unsuspend';
-            $spnd_icon = 'fa-play';
-            $spnd_confirmation = _('UNSUSPEND_DATABASE_CONFIRMATION') ;
-          } else {
-            $status = 'active';
-            $spnd_action = 'suspend';
-            $spnd_icon = 'fa-pause';
-            $spnd_confirmation = _('SUSPEND_DATABASE_CONFIRMATION') ;
-          }
-          if ($data[$key]['HOST'] != 'localhost' ) $http_host = $data[$key]['HOST'];
-          if ($data[$key]['TYPE'] == 'mysql') $db_admin = "phpMyAdmin";
-          if ($data[$key]['TYPE'] == 'mysql') $db_admin_link = "https://".$http_host."/phpmyadmin/";
-          if (($data[$key]['TYPE'] == 'mysql') && (!empty($_SESSION['DB_PMA_ALIAS']))) $db_admin_link = $_SESSION['DB_PMA_ALIAS'];
-          if ($data[$key]['TYPE'] == 'pgsql') $db_admin = "phpPgAdmin";
-          if ($data[$key]['TYPE'] == 'pgsql') $db_admin_link = "https://".$http_host."/phppgadmin/";
-          if (($data[$key]['TYPE'] == 'pgsql') && (!empty($_SESSION['DB_PGA_ALIAS']))) $db_admin_link = $_SESSION['DB_PGA_ALIAS'];
-      ?>
+	<!-- Begin database list item loop -->
+	<?php
+		list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"].":");
+		foreach ($data as $key => $value) {
+			++$i;
+			if ($data[$key]['SUSPENDED'] == 'yes') {
+				$status = 'suspended';
+				$spnd_action = 'unsuspend';
+				$spnd_icon = 'fa-play';
+				$spnd_confirmation = _('UNSUSPEND_DATABASE_CONFIRMATION') ;
+			} else {
+				$status = 'active';
+				$spnd_action = 'suspend';
+				$spnd_icon = 'fa-pause';
+				$spnd_confirmation = _('SUSPEND_DATABASE_CONFIRMATION') ;
+			}
+			if ($data[$key]['HOST'] != 'localhost' ) $http_host = $data[$key]['HOST'];
+			if ($data[$key]['TYPE'] == 'mysql') $db_admin = "phpMyAdmin";
+			if ($data[$key]['TYPE'] == 'mysql') $db_admin_link = "https://".$http_host."/phpmyadmin/";
+			if (($data[$key]['TYPE'] == 'mysql') && (!empty($_SESSION['DB_PMA_ALIAS']))) $db_admin_link = $_SESSION['DB_PMA_ALIAS'];
+			if ($data[$key]['TYPE'] == 'pgsql') $db_admin = "phpPgAdmin";
+			if ($data[$key]['TYPE'] == 'pgsql') $db_admin_link = "https://".$http_host."/phppgadmin/";
+			if (($data[$key]['TYPE'] == 'pgsql') && (!empty($_SESSION['DB_PGA_ALIAS']))) $db_admin_link = $_SESSION['DB_PGA_ALIAS'];
+		?>
+		<div class="l-unit <?php if($status == 'suspended') echo 'l-unit--suspended'; if($_SESSION['favourites']['DB'][$key] == 1) echo ' l-unit--starred'; ?> animated fadeIn" v_unit_id="<?=$key?>" v_section="db"
+			sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>" sort-name="<?=$key?>" sort-disk="<?=$data[$key]['U_DISK']?>"
+			sort-user="<?=$data[$key]['DBUSER']?>" sort-server="<?=$data[$key]['HOST']?>" sort-charset="<?=$data[$key]['CHARSET']?>" sort-star="<?php if($_SESSION['favourites']['DB'][$key] == 1) echo '1'; else echo '0'; ?>">
+			<div class="l-unit__col l-unit__col--right">
+				<div>
+					<div class="clearfix l-unit__stat-col--left super-compact">
+						<input id="check<?=$i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select');?>" name="database[]" value="<?=$key?>" <?=$display_mode;?>>
+					</div>
+					<div class="clearfix l-unit__stat-col--left wide-3 truncate">
+						<?php if (($read_only === 'true') || ($data[$key]['SUSPENDED'] == 'yes')) {?>
+							<b><?=$key?></b>
+						<?php } else { ?>
+							<b><a href="/edit/db/?database=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Database');?>: <?=$key?>"><?=$key?></a></b>
+						<?php } ?>
+					</div>
+					<!-- START QUICK ACTION TOOLBAR AREA -->
+					<div class="clearfix l-unit__stat-col--left text-right compact-3">
+						<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+							<div class="actions-panel clearfix">
+								<?php if ($read_only === 'true') {?>
+									<!-- Restrict the ability to edit, delete, or suspend domain items when impersonating 'admin' user -->
+									&nbsp;
+								<?php } else { ?>
+									<?php if ($data[$key]['SUSPENDED'] == 'no') {?>
+										<div class="actions-panel__col actions-panel__logs shortcut-enter" key-action="href"><a href="/edit/db/?database=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Database');?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
+									<?php } ?>
+									<?php if ($data[$key]['TYPE'] == 'mysql' && isset($_SESSION['PHPMYADMIN_KEY']) && $_SESSION['PHPMYADMIN_KEY'] != '') { $time = time(); ?>
+										<div class="actions-panel__col actions-panel__logs shortcut-enter" key-action="href"><a href="<?=$db_myadmin_link;?>/hestia-sso.php?database=<?=$key;?>&user=<?=$user;?>&exp=<?=$time;?>&hestia_token=<?=password_hash($key.$user.$_SESSION['user_combined_ip'].$time.$_SESSION['PHPMYADMIN_KEY'], PASSWORD_DEFAULT)?>" title="<?=_('Editing Database');?>"><i class="fas fa-sign-in-alt status-icon orange status-icon dim"></i></a></div>
+									<?php } ?>
+									<div class="actions-panel__col actions-panel__suspend shortcut-s" key-action="js">
+										<a id="<?=$spnd_action ?>_link_<?=$i?>" class="data-controls do_<?=$spnd_action?>" title="<?=_($spnd_action)?>">
+											<i class="fas <?=$spnd_icon?> status-icon highlight status-icon dim do_<?=$spnd_action?>"></i>
+											<input type="hidden" name="<?=$spnd_action?>_url" value="/<?=$spnd_action?>/db/?database=<?=$key?>&token=<?=$_SESSION['token']?>" />
+											<div id="<?=$spnd_action?>_dialog_<?=$i?>" class="confirmation-text-suspention hidden" title="<?=_('Confirmation');?>">
+												<p class="confirmation"><?=sprintf($spnd_confirmation,$key)?></p>
+											</div>
+										</a>
+									</div>
+									<div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
+										<a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete');?>">
+											<i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
+											<input type="hidden" name="delete_url" value="/delete/db/?database=<?=$key?>&token=<?=$_SESSION['token']?>" />
+											<div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation');?>">
+												<p class="confirmation"><?=sprintf(_('DELETE_DATABASE_CONFIRMATION'),$key)?></p>
+											</div>
+										</a>
+									</div>
+								<?php } ?>
+							</div>
+						</div>
+					</div>
+					<!-- END QUICK ACTION TOOLBAR AREA -->
+					<div class="clearfix l-unit__stat-col--left text-center"><b><?=humanize_usage_size($data[$key]['U_DISK'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['U_DISK'])?></span></div>
+					<div class="clearfix l-unit__stat-col--left text-center compact"><?=$data[$key]['TYPE']?></div>
+					<div class="clearfix l-unit__stat-col--left text-center wide"><b><?=$data[$key]['DBUSER']?></b></div>
+					<div class="clearfix l-unit__stat-col--left text-center"><b><?=$data[$key]['HOST']?></b></div>
+					<div class="clearfix l-unit__stat-col--left text-center"><?=$data[$key]['CHARSET']?></div>
+				</div>
+			</div>
+		</div>
+	<?php } ?>
+</div>
 
-
-      <div class="l-unit <? if($status == 'suspended') echo 'l-unit--suspended'; if($_SESSION['favourites']['DB'][$key] == 1) echo ' l-unit--starred'; ?> animated fadeIn" v_unit_id="<?=$key?>" v_section="db"
-sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>" sort-name="<?=$key?>" sort-disk="<?=$data[$key]['U_DISK']?>"
-sort-user="<?=$data[$key]['DBUSER']?>" sort-server="<?=$data[$key]['HOST']?>" sort-charset="<?=$data[$key]['CHARSET']?>" sort-star="<? if($_SESSION['favourites']['DB'][$key] == 1) echo '1'; else echo '0'; ?>">
-            <div class="l-unit__col l-unit__col--right">
-              <div>
-                <div class="clearfix l-unit__stat-col--left super-compact">
-                  <input id="check<?php echo $i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select')?>" name="database[]" value="<?php echo $key ?>" <?=$display_mode;?>>
-                </div>
-                <div class="clearfix l-unit__stat-col--left wide-3 truncate">
-                  <? if (($read_only === 'true') || ($data[$key]['SUSPENDED'] == 'yes')) {?>
-                    <b><?=$key?></b>
-                  <? } else { ?>
-                    <b><a href="/edit/db/?database=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Database')?>: <?=$key?>"><?=$key?></a></b>
-                  <? } ?>
-                </div>
-                <!-- START QUICK ACTION TOOLBAR AREA -->
-                <div class="clearfix l-unit__stat-col--left text-right compact-3">
-                  <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-                    <div class="actions-panel clearfix">
-                      <? if ($read_only === 'true') {?>
-                        <!-- Restrict the ability to edit, delete, or suspend domain items when impersonating 'admin' user -->
-                        &nbsp;
-                      <? } else { ?>
-                        <? if ($data[$key]['SUSPENDED'] == 'no') {?>
-                          <div class="actions-panel__col actions-panel__logs shortcut-enter" key-action="href"><a href="/edit/db/?database=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Database')?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
-                        <? } ?>                    
-                        <?php if ($data[$key]['TYPE'] == 'mysql' && isset($_SESSION['PHPMYADMIN_KEY']) && $_SESSION['PHPMYADMIN_KEY'] != '') { $time = time(); ?>
-                          <div class="actions-panel__col actions-panel__logs shortcut-enter" key-action="href"><a href="<?=$db_myadmin_link;?>/hestia-sso.php?database=<?=$key;?>&user=<?=$user;?>&exp=<?=$time;?>&hestia_token=<?=password_hash($key.$user.$_SESSION['user_combined_ip'].$time.$_SESSION['PHPMYADMIN_KEY'], PASSWORD_DEFAULT)?>" title="<?=_('Editing Database')?>"><i class="fas fa-sign-in-alt status-icon orange status-icon dim"></i></a></div>
-                        <? } ?>
-                          <div class="actions-panel__col actions-panel__suspend shortcut-s" key-action="js">
-                            <a id="<?=$spnd_action ?>_link_<?=$i?>" class="data-controls do_<?=$spnd_action?>" title="<?=_($spnd_action)?>">
-                              <i class="fas <?=$spnd_icon?> status-icon highlight status-icon dim do_<?=$spnd_action?>"></i>
-                              <input type="hidden" name="<?=$spnd_action?>_url" value="/<?=$spnd_action?>/db/?database=<?=$key?>&token=<?=$_SESSION['token']?>" />
-                              <div id="<?=$spnd_action?>_dialog_<?=$i?>" class="confirmation-text-suspention hidden" title="<?=_('Confirmation')?>">
-                                <p class="confirmation"><?=sprintf($spnd_confirmation,$key)?></p>
-                              </div>
-                            </a>
-                          </div>
-                          <div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
-                            <a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete')?>">
-                              <i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
-                              <input type="hidden" name="delete_url" value="/delete/db/?database=<?=$key?>&token=<?=$_SESSION['token']?>" />
-                              <div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
-                                <p class="confirmation"><?=sprintf(_('DELETE_DATABASE_CONFIRMATION'),$key)?></p>
-                              </div>
-                            </a>
-                          </div>
-                      <? } ?>
-                    </div>
-                  </div>
-                  </div>
-                  <!-- END QUICK ACTION TOOLBAR AREA -->
-                  <div class="clearfix l-unit__stat-col--left text-center compact"><?=$data[$key]['TYPE']?></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?=humanize_usage_size($data[$key]['U_DISK'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['U_DISK'])?></span></div>
-                  <div class="clearfix l-unit__stat-col--left text-center wide"><b><?=$data[$key]['DBUSER']?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?=$data[$key]['HOST']?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><?=$data[$key]['CHARSET']?></div>
-               </div>
-            </div>
-      </div>
-      <?}?>
-    </div>
-
-    <div id="vstobjects">
-      <div class="l-separator"></div>
-      <div class="l-center">
-        <div class="l-unit-ft">
-          <table class='data'></table>
-          <div class="data-count l-unit__col l-unit__col--right clearfix">
-            <?php
-            printf(ngettext('%d SQL database', '%d SQL databases', $i),$i);
-            ?>
-          </div>
-        </div>
-      </div>
-    </div>
+<div id="vstobjects">
+	<div class="l-separator"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right clearfix">
+				<?php printf(ngettext('%d SQL database', '%d SQL databases', $i),$i); ?>
+			</div>
+		</div>
+	</div>
+</div>

+ 159 - 161
web/templates/pages/list_dns.html

@@ -1,166 +1,164 @@
+<!-- Begin toolbar -->
 <div class="l-center">
-      <div class="l-sort clearfix noselect">
-        <div class="l-unit-toolbar__buttonstrip">
-          <? if ($read_only === 'true') {?>
-            <!-- Hide item creation button when impersonating 'admin' account -->
-          <? } else {?>
-            <a href="/add/dns/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add DNS Domain')?></a>
-          <? } ?>
-        </div>
-        <ul class="context-menu sort-order animated fadeIn" style="display: none;">
-          <li entity="sort-date" sort_as_int="1"><span class="name <? if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-expire" sort_as_int="1"><span class="name"><?=_('Expire')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-ip"><span class="name"><?=_('IP address')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-name"><span class="name <? if ($_SESSION['userSortOrder'] === 'name') { echo 'active'; } ?>"><?=_('Name')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-records"><span class="name"><?=_('Records')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-        </ul>
-        <span class="name <? if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>">
-        <div class="l-sort-toolbar clearfix">
-          <table>
-            <tr>
-              <td class="sort-by" title="<?=_('Sort items');?>">
-                <?=_('sort by');?>: <span>
-                  <b>
-                    <? if ($_SESSION['userSortOrder'] === 'name') { $label = 'Name'; } else { $label = 'Date'; } ?>
-                    <?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
-                  </b>
-                </span>
-              </td>
-              <td class="l-sort-toolbar__search-box">
-                <form action="/search/" method="get">
-                  <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                  <input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search')?>" />
-                  <button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search')?>"><i class="fas fa-search"></i></button>
-                </form>
-              </td>
-              <? if ($read_only === 'true') {?>
-                <!-- Hide bulk actions for domain items when impersonating 'admin' account-->
-              <? } else { ?>
-                <td>
-                  <form action="/bulk/dns/" method="post" id="objects">
-                  <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                  <div class="l-select">
-                    <select name="action" id="">
-                      <option value=""><?=_('apply to selected')?></option>
-                      <? if ($_SESSION['userContext'] === 'admin') {?>
-                        <option value="rebuild"><?=_('rebuild')?></option>
-                      <? } ?>
-                      <option value="suspend"><?php print _('suspend');?></option>
-                      <option value="unsuspend"><?php print _('unsuspend');?></option>
-                      <option value="delete"><?php print _('delete');?></option>
-                    </select>
-                  </div>
-                  <button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected')?>"><i class="fas fa-arrow-right"></i></button>
-                  </form>
-                </td>
-              <? } ?>
-            </tr>
-          </table>
-        </div>
-      </div>
-    </div>
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<?php if ($read_only !== 'true') {?>
+				<a href="/add/dns/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add DNS Domain');?></a>
+			<?php } ?>
+		</div>
+		<ul class="context-menu sort-order animated fadeIn" style="display: none;">
+			<li entity="sort-date" sort_as_int="1"><span class="name <?php if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-expire" sort_as_int="1"><span class="name"><?=_('Expire');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-ip"><span class="name"><?=_('IP address');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-name"><span class="name <?php if ($_SESSION['userSortOrder'] === 'name') { echo 'active'; } ?>"><?=_('Name');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-records"><span class="name"><?=_('Records');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+		</ul>
+		<span class="name <?php if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>">
+			<div class="l-sort-toolbar clearfix">
+				<table>
+					<tr>
+						<td class="sort-by" title="<?=_('Sort items');?>">
+							<?=_('sort by');?>: <span>
+								<b>
+									<?php if ($_SESSION['userSortOrder'] === 'name') { $label = 'Name'; } else { $label = 'Date'; } ?>
+									<?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
+								</b>
+							</span>
+						</td>
+						<td class="l-sort-toolbar__search-box">
+							<form action="/search/" method="get">
+								<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+								<input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search');?>" />
+								<button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search');?>"><i class="fas fa-search"></i></button>
+							</form>
+						</td>
+						<?php if ($read_only !== 'true') {?>
+							<td>
+								<form action="/bulk/dns/" method="post" id="objects">
+									<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+									<div class="l-select">
+										<select name="action" id="">
+											<option value=""><?=_('apply to selected');?></option>
+											<?php if ($_SESSION['userContext'] === 'admin') {?>
+												<option value="rebuild"><?=_('rebuild');?></option>
+											<?php } ?>
+											<option value="suspend"><?=_('suspend');?></option>
+											<option value="unsuspend"><?=_('unsuspend');?></option>
+											<option value="delete"><?=_('delete');?></option>
+										</select>
+									</div>
+									<button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected');?>"><i class="fas fa-arrow-right"></i></button>
+								</form>
+							</td>
+						<?php } ?>
+					</tr>
+				</table>
+			</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center units">
-        <div class="header table-header">
-            <div class="l-unit__col l-unit__col--right">
-                  <div class="clearfix l-unit__stat-col--left super-compact">
-                      <input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all')?>" onChange="checkedAll('objects');" <?=$display_mode;?>>
-                  </div>
-                  <div class="clearfix l-unit__stat-col--left wide-3"><b><?php print _('Name');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-right"><b>&nbsp;</b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center compact"><b><?php print _('Records_DNS');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Template');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center compact"><b><?php print _('TTL');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center wide"><b><?php print _('SOA');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Expiration Date');?></b></div>
-             </div>
-          </div>
+<div class="l-center units">
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left super-compact">
+				<input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all');?>" onChange="checkedAll('objects');" <?=$display_mode;?>>
+			</div>
+			<div class="clearfix l-unit__stat-col--left wide-3"><b><?=_('Name');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-right"><b>&nbsp;</b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact"><b><?=_('Records_DNS');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Template');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact"><b><?=_('TTL');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center wide"><b><?=_('SOA');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Expiration Date');?></b></div>
+		</div>
+	</div>
 
-      <?
-        foreach ($data as $key => $value) {
-          ++$i;
-          if ($data[$key]['SUSPENDED'] == 'yes') {
-            $status = 'suspended';
-            $spnd_action = 'unsuspend';
-            $spnd_icon = 'fa-play';
-            $spnd_confirmation = _('UNSUSPEND_DOMAIN_CONFIRMATION');
-          } else {
-            $status = 'active';
-            $spnd_action = 'suspend';
-            $spnd_icon = 'fa-pause';
-            $spnd_confirmation = _('SUSPEND_DOMAIN_CONFIRMATION');
-          }
-      ?>
+	<!-- Begin DNS zone list item loop -->
+	<?php
+		foreach ($data as $key => $value) {
+			++$i;
+			if ($data[$key]['SUSPENDED'] == 'yes') {
+				$status = 'suspended';
+				$spnd_action = 'unsuspend';
+				$spnd_icon = 'fa-play';
+				$spnd_confirmation = _('UNSUSPEND_DOMAIN_CONFIRMATION');
+			} else {
+				$status = 'active';
+				$spnd_action = 'suspend';
+				$spnd_icon = 'fa-pause';
+				$spnd_confirmation = _('SUSPEND_DOMAIN_CONFIRMATION');
+			}
+		?>
+		<div class="l-unit <?php if ($status == 'suspended') echo ' l-unit--suspended'; if($_SESSION['favourites']['DNS'][$key] == 1) echo ' l-unit--starred'; ?> animated fadeIn" v_unit_id="<?=htmlentities($key);?>"
+			v_section="dns" sort-ip="<?=str_replace('.', '', $data[$key]['IP'])?>" sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>" sort-name="<?=htmlentities($key);?>"
+			sort-expire="<?=strtotime($data[$key]['EXP'])?>" sort-records="<?=(int)$data[$key]['RECORDS']?>" sort-star="<?php if ($_SESSION['favourites']['DNS'][$key] == 1) echo '1'; else echo '0';?>">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left super-compact">
+					<input id="check<?=$i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select');?>" name="domain[]" value="<?=$key?>" <?=$display_mode;?>>
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide-3 truncate">
+					<b><a href="/list/dns/?domain=<?=htmlentities($key);?>&token=<?=$_SESSION['token']?>" title="<?=_('DNS records');?>: <?=htmlentities($key);?>"><?=htmlentities($key);?></a></b>
+					<?=empty($data[$key]['SRC'])? '' : '<br/>⇢ <span style="font-size:11px;">' . htmlspecialchars($data[$key]['SRC'], ENT_QUOTES) . '</span>'; ?>
+				</div>
+				<!-- START QUICK ACTION TOOLBAR AREA -->
+				<div class="clearfix l-unit__stat-col--left text-right">
+					<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+						<div class="actions-panel clearfix">
+							<?php if ($read_only === 'true') {?>
+								<!-- Restrict administrators from editing domain items when impersonating the 'admin' user -->
+								&nbsp;
+							<?php } else { ?>
+								<?php if ($data[$key]['SUSPENDED'] == 'no') {?>
+									<div class="actions-panel__col actions-panel__logs shortcut-n" key-action="href"><a href="/add/dns/?domain=<?=htmlentities($key);?>&token=<?=$_SESSION['token']?>" title="<?=_('Add DNS Record');?>"><i class="fas fa-plus-circle status-icon green status-icon dim"></i></a></div>
+									<div class="actions-panel__col actions-panel__logs shortcut-enter" key-action="href"><a href="/edit/dns/?domain=<?=htmlentities($key);?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing DNS Domain');?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
+								<?php } ?>
+								<div class="actions-panel__col actions-panel__edit shortcut-l" key-action="href"><a href="/list/dns/?domain=<?=htmlentities($key);?>&token=<?=$_SESSION['token']?>" title="<?=_('DNS records');?>"><i class="fas fa-list status-icon lightblue status-icon dim"></i></a></div>
+								<div class="actions-panel__col actions-panel__suspend shortcut-s" key-action="js">
+									<a id="<?=$spnd_action ?>_link_<?=$i?>" class="data-controls do_<?=$spnd_action?>" title="<?=_($spnd_action)?>">
+										<i class="fas <?=$spnd_icon?> status-icon highlight status-icon dim do_<?=$spnd_action?>"></i>
+										<input type="hidden" name="<?=$spnd_action?>_url" value="/<?=$spnd_action?>/dns/?domain=<?=htmlentities($key);?>&token=<?=$_SESSION['token']?>" />
+										<div id="<?=$spnd_action?>_dialog_<?=$i?>" class="confirmation-text-suspention hidden" title="<?=_('Confirmation');?>">
+											<p class="confirmation"><?=sprintf($spnd_confirmation,$key)?></p>
+										</div>
+									</a>
+								</div>
+								<div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
+									<a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete');?>">
+										<i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
+										<input type="hidden" name="delete_url" value="/delete/dns/?domain=<?=htmlentities($key);?>&token=<?=$_SESSION['token']?>" />
+										<div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation');?>">
+											<p class="confirmation"><?=sprintf(_('DELETE_DOMAIN_CONFIRMATION'),$key)?></p>
+										</div>
+									</a>
+								</div>
+							<?php } ?>
+						</div>
+					</div>
+				</div>
+				<!-- END QUICK ACTION TOOLBAR AREA -->
+				<div class="clearfix l-unit__stat-col--left text-center compact">
+					<?php if ($data[$key]['RECORDS']) echo '<span>'.$data[$key]['RECORDS'].'</span>';?>
+				</div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=$data[$key]['TPL']?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center compact"><?=$data[$key]['TTL']?></div>
+				<div class="clearfix l-unit__stat-col--left text-center wide"><?=$data[$key]['SOA']?></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=$data[$key]['EXP']?></b></div>
+			</div>
+		</div>
+	<?php } ?>
+</div>
 
-      <div class="l-unit <? if($status == 'suspended') echo ' l-unit--suspended'; if($_SESSION['favourites']['DNS'][$key] == 1) echo ' l-unit--starred'; ?> animated fadeIn" v_unit_id="<?=$key?>"
-v_section="dns" sort-ip="<?=str_replace('.', '', $data[$key]['IP'])?>" sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>" sort-name="<?=$key?>"
-sort-expire="<?=strtotime($data[$key]['EXP'])?>" sort-records="<?=(int)$data[$key]['RECORDS']?>" sort-star="<?if($_SESSION['favourites']['DNS'][$key] == 1) echo '1'; else echo '0';?>">
-            <div class="l-unit__col l-unit__col--right">
-              <div class="clearfix l-unit__stat-col--left super-compact">
-                <input id="check<?php echo $i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select')?>" name="domain[]" value="<?php echo $key ?>" <?=$display_mode;?>>
-              </div>
-              <div class="clearfix l-unit__stat-col--left wide-3 truncate">
-                <b><a href="/list/dns/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('DNS records')?>: <?=$key?>"><?=$key?></a></b>
-                <?=empty($data[$key]['SRC'])? '' : '<br/>⇢ <span style="font-size:11px;">' . htmlspecialchars($data[$key]['SRC'], ENT_QUOTES) . '</span>'; ?>
-              </div>
-              <!-- START QUICK ACTION TOOLBAR AREA -->
-              <div class="clearfix l-unit__stat-col--left text-right">
-                  <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-                  <div class="actions-panel clearfix">
-                    <? if ($read_only === 'true') {?>
-                      <!-- Restrict administrators from editing domain items when impersonating the 'admin' user -->
-                      &nbsp;
-                    <? } else { ?>
-                      <? if ($data[$key]['SUSPENDED'] == 'no') {?>
-                        <div class="actions-panel__col actions-panel__logs shortcut-n" key-action="href"><a href="/add/dns/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Add DNS Record')?>"><i class="fas fa-plus-circle status-icon green status-icon dim"></i></a></div>
-                        <div class="actions-panel__col actions-panel__logs shortcut-enter" key-action="href"><a href="/edit/dns/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing DNS Domain')?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
-                      <? } ?>
-                      <div class="actions-panel__col actions-panel__edit shortcut-l" key-action="href"><a href="/list/dns/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('DNS records')?>"><i class="fas fa-list status-icon lightblue status-icon dim"></i></a></div>
-                      <div class="actions-panel__col actions-panel__suspend shortcut-s" key-action="js">
-                        <a id="<?=$spnd_action ?>_link_<?=$i?>" class="data-controls do_<?=$spnd_action?>" title="<?=_($spnd_action)?>">
-                          <i class="fas <?=$spnd_icon?> status-icon highlight status-icon dim do_<?=$spnd_action?>"></i>
-                          <input type="hidden" name="<?=$spnd_action?>_url" value="/<?=$spnd_action?>/dns/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" />
-                          <div id="<?=$spnd_action?>_dialog_<?=$i?>" class="confirmation-text-suspention hidden" title="<?=_('Confirmation')?>">
-                            <p class="confirmation"><?=sprintf($spnd_confirmation,$key)?></p>
-                          </div>
-                        </a>
-                      </div>
-                      <div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
-                        <a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete')?>">
-                          <i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
-                          <input type="hidden" name="delete_url" value="/delete/dns/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" />
-                          <div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
-                            <p class="confirmation"><?=sprintf(_('DELETE_DOMAIN_CONFIRMATION'),$key)?></p>
-                          </div>
-                        </a>
-                      </div>
-                    <? } ?>
-                  </div>
-                </div>
-              </div>
-              <!-- END QUICK ACTION TOOLBAR AREA -->
-              <div class="clearfix l-unit__stat-col--left text-center compact"><? if($data[$key]['RECORDS']) echo '<span>'.$data[$key]['RECORDS'].'</span>';?></div>
-              <div class="clearfix l-unit__stat-col--left text-center"><b><?=$data[$key]['TPL']?></b></div>
-              <div class="clearfix l-unit__stat-col--left text-center compact"><?=$data[$key]['TTL']?></div>
-              <div class="clearfix l-unit__stat-col--left text-center wide"><?=$data[$key]['SOA']?></div>
-              <div class="clearfix l-unit__stat-col--left text-center"><b><?=$data[$key]['EXP']?></b></div>
-            </div>
-        </div>
-      <?}?>
-    </div>
-
-    <div id="vstobjects">
-      <div class="l-separator"></div>
-      <div class="l-center">
-        <div class="l-unit-ft">
-          <table class='data'></table>
-          <div class="data-count l-unit__col l-unit__col--right clearfix">
-            <?php
-            printf(ngettext('%d DNS zone', '%d DNS zones', $i),$i);
-            ?>
-          </div>
-        </div>
-      </div>
-    </div>
+<div id="vstobjects">
+	<div class="l-separator"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right clearfix">
+				<?php printf(ngettext('%d DNS zone', '%d DNS zones', $i),$i); ?>
+			</div>
+		</div>
+	</div>
+</div>

+ 140 - 141
web/templates/pages/list_dns_rec.html

@@ -1,147 +1,146 @@
+<!-- Begin toolbar -->
 <div class="l-center">
-      <div class="l-sort clearfix noselect">
-        <div class="l-unit-toolbar__buttonstrip">
-          <a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/dns/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-          <? if ($read_only === 'true') {?>
-            <!-- Hide item creation button when impersonating 'admin' account -->
-          <? } else { ?>
-            <a href="/add/dns/?domain=<?=htmlentities($_GET['domain'])?>" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i> <?=_('Add Record')?></a>
-            <a href="/edit/dns/?domain=<?=htmlentities($_GET['domain'])?>" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-pencil-alt status-icon blue"></i> <?=_('Editing DNS Domain')?></a>
-          <? } ?>
-        </div>
-        <ul class="context-menu sort-order animated fadeIn" style="display:none;">
-          <li entity="sort-date" sort_as_int="1"><span class="name <? if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-value"><span class="name"><?=_('IP or Value')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-record"><span class="name"><?=_('Record')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-ttl" sort_as_int="1"><span class="name"><?=_('TTL')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-type"><span class="name"><?=_('Type')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-        </ul>
-        <div class="l-sort-toolbar clearfix">
-          <table>
-            <tr>
-              <td class="sort-by" title="<?=_('Sort items');?>">
-                <?=_('sort by');?>: <span>
-                  <b>
-                    <? if ($_SESSION['userSortOrder'] === 'name') { $label = 'Record'; } else { $label = 'Date'; } ?>
-                    <?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
-                  </b>
-                </span>
-              </td>
-              <td class="l-sort-toolbar__search-box">
-                <form action="/search/" method="get">
-                  <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                  <input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search')?>" />
-                  <button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search')?>"><i class="fas fa-search"></i></button>
-                </form>
-              </td>
-              <? if ($read_only === 'true') {?>
-                <!-- Hide bulk actions for domain items when impersonating 'admin' account-->
-              <? } else { ?>
-                <td>
-                  <form action="/bulk/dns/" method="post" id="objects">
-                  <input type="hidden" name="domain" value="<?=htmlentities($_GET['domain'])?>" />
-                  <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                  <div class="l-select">
-                    <select name="action" id="">
-                      <option value=""><?=_('apply to selected')?></option>
-                      <option value="suspend"><?php print _('suspend');?></option>
-                      <option value="unsuspend"><?php print _('unsuspend');?></option>
-                      <option value="delete"><?php print _('delete');?></option>
-                    </select>
-                  </div>
-                  <button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected')?>"><i class="fas fa-arrow-right"></i></button>
-                  </form>
-                </td>
-              <? } ?>
-            </tr>
-          </table>
-        </div>
-      </div>
-    </div>
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/dns/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+			<?php if ($read_only !== 'true') {?>
+				<a href="/add/dns/?domain=<?=htmlentities($_GET['domain'])?>" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i> <?=_('Add Record');?></a>
+				<a href="/edit/dns/?domain=<?=htmlentities($_GET['domain'])?>" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-pencil-alt status-icon blue"></i> <?=_('Editing DNS Domain');?></a>
+			<?php } ?>
+		</div>
+		<ul class="context-menu sort-order animated fadeIn" style="display:none;">
+			<li entity="sort-date" sort_as_int="1"><span class="name <?php if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-value"><span class="name"><?=_('IP or Value');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-record"><span class="name"><?=_('Record');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-ttl" sort_as_int="1"><span class="name"><?=_('TTL');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-type"><span class="name"><?=_('Type');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+		</ul>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td class="sort-by" title="<?=_('Sort items');?>">
+						<?=_('sort by');?>: <span>
+							<b>
+								<?php if ($_SESSION['userSortOrder'] === 'name') { $label = 'Record'; } else { $label = 'Date'; } ?>
+								<?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
+							</b>
+						</span>
+					</td>
+					<td class="l-sort-toolbar__search-box">
+						<form action="/search/" method="get">
+							<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+							<input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search');?>" />
+							<button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search');?>"><i class="fas fa-search"></i></button>
+						</form>
+					</td>
+					<?php if ($read_only !== 'true') {?>
+						<td>
+							<form action="/bulk/dns/" method="post" id="objects">
+								<input type="hidden" name="domain" value="<?=htmlentities($_GET['domain'])?>" />
+								<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+								<div class="l-select">
+									<select name="action" id="">
+										<option value=""><?=_('apply to selected');?></option>
+										<option value="suspend"><?=_('suspend');?></option>
+										<option value="unsuspend"><?=_('unsuspend');?></option>
+										<option value="delete"><?=_('delete');?></option>
+									</select>
+								</div>
+								<button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected');?>"><i class="fas fa-arrow-right"></i></button>
+							</form>
+						</td>
+					<?php } ?>
+				</tr>
+			</table>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center units">
-      <div class="header table-header">
-        <div class="l-unit__col l-unit__col--right">
-          <div class="clearfix l-unit__stat-col--left super-compact">
-            <input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all')?>" onChange="checkedAll('objects');" <?=$display_mode;?>>
-          </div>
-          <div class="clearfix l-unit__stat-col--left small"><b><?php print _('Record');?></b></div>
-          <div class="clearfix l-unit__stat-col--left super-compact text-right"><b>&nbsp;</b></div>
-          <div class="clearfix l-unit__stat-col--left compact text-center" style="padding-left: 32px;"><b><?php print _('Type');?></b></div>
-          <div class="clearfix l-unit__stat-col--left compact text-center"><b><?php print _('Priority');?></b></div>
-          <div class="clearfix l-unit__stat-col--left compact text-center"><b><?php print _('TTL');?></b></div>
-          <div class="clearfix l-unit__stat-col--left super-compact"><b>&nbsp;</b></div>
-          <div class="clearfix l-unit__stat-col--left wide-6"><b><?php print _('IP or Value');?></b></div>
-        </div>
-    </div>
+<div class="l-center units">
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left super-compact">
+				<input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all');?>" onChange="checkedAll('objects');" <?=$display_mode;?>>
+			</div>
+			<div class="clearfix l-unit__stat-col--left small"><b><?=_('Record');?></b></div>
+			<div class="clearfix l-unit__stat-col--left super-compact text-right"><b>&nbsp;</b></div>
+			<div class="clearfix l-unit__stat-col--left compact text-center" style="padding-left: 32px;"><b><?=_('Type');?></b></div>
+			<div class="clearfix l-unit__stat-col--left compact text-center"><b><?=_('Priority');?></b></div>
+			<div class="clearfix l-unit__stat-col--left compact text-center"><b><?=_('TTL');?></b></div>
+			<div class="clearfix l-unit__stat-col--left super-compact"><b>&nbsp;</b></div>
+			<div class="clearfix l-unit__stat-col--left wide-6"><b><?=_('IP or Value');?></b></div>
+		</div>
+	</div>
 
-      <?php
-        foreach ($data as $key => $value) {
-          ++$i;
-      ?>
+	<!-- Begin DNS record list item loop -->
+	<?php
+		foreach ($data as $key => $value) {
+			++$i;
+		?>
+		<div class="l-unit<?php if ($status == 'suspended') echo ' l-unit--suspended'; if($_SESSION['favourites']['DNS_REC'][$key] == 1) echo ' l-unit--starred';?> animated fadeIn"
+			v_unit_id="<?=htmlentities($key);?>" v_section="dns_rec" sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>" sort-record="<?=$data[$key]['RECORD']?>" sort-type="<?=$data[$key]['TYPE']?>" sort-ttl="<?=$data[$key]['TTL']?>" sort-value="<?=$data[$key]['VALUE']?>">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left super-compact">
+					<input id="check<?=$data[$key]['ID']?>" class="ch-toggle" type="checkbox" title="<?=_('Select');?>" name="record[]" value="<?=$data[$key]['ID']?>" <?=$display_mode;?>>
+				</div>
+				<div class="clearfix l-unit__stat-col--left small truncate">
+					<b>
+					<?php if (($read_only === 'true') || ($data[$key]['SUSPENDED'] == 'yes')) {?>
+						<?=substr($data[$key]['RECORD'], 0, 12); if(strlen($data[$key]['RECORD']) > 12 ) echo '...'; ?>
+					<?php } else { ?>
+						<a href="/edit/dns/?domain=<?=htmlspecialchars($_GET['domain'])?>&record_id=<?=$data[$key]['ID']?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing DNS Record').': '.htmlspecialchars($data[$key]['RECORD'])?>"><? echo substr($data[$key]['RECORD'], 0, 12); if(strlen($data[$key]['RECORD']) > 12 ) echo '...'; ?></a>
+					<?php } ?>
+					</b>
+				</div>
+			<!-- START QUICK ACTION TOOLBAR AREA -->
+			<div class="clearfix l-unit__stat-col--left super-compact text-right">
+				<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+					<div class="actions-panel clearfix">
+						<?php if ($read_only === 'true') {?>
+							<!-- Restrict editing of DNS records when impersonating 'admin' account -->
+							&nbsp;
+						<?php } else { ?>
+							<?php if ($data[$key]['SUSPENDED'] == 'no') {?>
+								<div class="actions-panel__col actions-panel__logs shortcut-enter" key-action="href"><a href="/edit/dns/?domain=<?=htmlspecialchars($_GET['domain'])?>&record_id=<?=$data[$key]['ID']?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing DNS Record');?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
+							<?php } ?>
+							<div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
+								<a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete');?>">
+									<i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
+									<input type="hidden" name="delete_url" value="/delete/dns/?domain=<?=htmlspecialchars($_GET['domain'])?>&record_id=<?=$data[$key]['ID']?>&token=<?=$_SESSION['token']?>" />
+									<div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation');?>">
+										<p class="confirmation"><?=sprintf(_('DELETE_RECORD_CONFIRMATION'),$key)?></p>
+									</div>
+								</a>
+							</div>
+						<?php } ?>
+					</div>
+				</div>
+			</div>
+			<!-- END QUICK ACTION TOOLBAR AREA -->
+			<div class="clearfix l-unit__stat-col--left compact text-center" style="padding-left: 32px;"><b><?=$data[$key]['TYPE']?></b></div>
+			<div class="clearfix l-unit__stat-col--left compact text-center"><?=$data[$key]['PRIORITY']?>&nbsp;</div>
+			<div class="clearfix l-unit__stat-col--left compact text-center"><?php if($data[$key]['TTL'] == ''){ echo _('Default'); }else{ echo $data[$key]['TTL'];} ?></div>
+			<div class="clearfix l-unit__stat-col--left super-compact"><b>&nbsp;</b></div>
+			<div class="clearfix l-unit__stat-col--left wide-6 truncate" style="word-break: break-word;"><?=htmlspecialchars($data[$key]['VALUE'], ENT_QUOTES, 'UTF-8');?></div>
+		</div>
+	</div>
+<?php } ?>
 
-      <div class="l-unit<? if($status == 'suspended') echo ' l-unit--suspended'; if($_SESSION['favourites']['DNS_REC'][$key] == 1) echo ' l-unit--starred';?> animated fadeIn"
-v_unit_id="<?=$key?>" v_section="dns_rec" sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>" sort-record="<?=$data[$key]['RECORD']?>" sort-type="<?=$data[$key]['TYPE']?>" sort-ttl="<?=$data[$key]['TTL']?>" sort-value="<?=$data[$key]['VALUE']?>">
-        <div class="l-unit__col l-unit__col--right">
-            <div class="clearfix l-unit__stat-col--left super-compact">
-              <input id="check<?=$data[$key]['ID']?>" class="ch-toggle" type="checkbox" title="<?=_('Select')?>" name="record[]" value="<?=$data[$key]['ID']?>" <?=$display_mode;?>>
-            </div>
-            <div class="clearfix l-unit__stat-col--left small truncate">
-              <? if (($read_only === 'true') || ($data[$key]['SUSPENDED'] == 'yes')) {?>
-                <b><? echo substr($data[$key]['RECORD'], 0, 12); if(strlen($data[$key]['RECORD']) > 12 ) echo '...'; ?></b></div>
-              <? } else { ?>
-                <b><a href="/edit/dns/?domain=<?=htmlspecialchars($_GET['domain'])?>&record_id=<?=$data[$key]['ID']?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing DNS Record').': '.htmlspecialchars($data[$key]['RECORD'])?>"><? echo substr($data[$key]['RECORD'], 0, 12); if(strlen($data[$key]['RECORD']) > 12 ) echo '...'; ?></a></b></div>
-              <? } ?>
-            <!-- START QUICK ACTION TOOLBAR AREA -->
-            <div class="clearfix l-unit__stat-col--left super-compact text-right">
-              <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-                <div class="actions-panel clearfix">
-                  <? if ($read_only === 'true') {?>
-                    <!-- Restrict editing of DNS records when impersonating 'admin' account -->
-                    &nbsp;
-                  <? } else { ?>
-                    <? if ($data[$key]['SUSPENDED'] == 'no') {?>
-                      <div class="actions-panel__col actions-panel__logs shortcut-enter" key-action="href"><a href="/edit/dns/?domain=<?=htmlspecialchars($_GET['domain'])?>&record_id=<?=$data[$key]['ID']?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing DNS Record')?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
-                    <? } ?>
-                    <div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
-                      <a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete')?>">
-                        <i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
-                        <input type="hidden" name="delete_url" value="/delete/dns/?domain=<?=htmlspecialchars($_GET['domain'])?>&record_id=<?=$data[$key]['ID']?>&token=<?=$_SESSION['token']?>" />
-                        <div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
-                          <p class="confirmation"><?=sprintf(_('DELETE_RECORD_CONFIRMATION'),$key)?></p>
-                        </div>
-                      </a>
-                    </div>
-                  <? } ?>
-                </div>
-              </div>
-            </div>
-            <!-- END QUICK ACTION TOOLBAR AREA -->
-            <div class="clearfix l-unit__stat-col--left compact text-center" style="padding-left: 32px;"><b><?=$data[$key]['TYPE']?></b></div>
-            <div class="clearfix l-unit__stat-col--left compact text-center"><?=$data[$key]['PRIORITY']?>&nbsp;</div>
-            <div class="clearfix l-unit__stat-col--left compact text-center"><?php if($data[$key]['TTL'] == ''){ echo _('Default'); }else{ echo $data[$key]['TTL'];} ?></div>
-            <div class="clearfix l-unit__stat-col--left super-compact"><b>&nbsp;</b></div>
-            <div class="clearfix l-unit__stat-col--left wide-6 truncate" style="word-break: break-word;"><?=htmlspecialchars($data[$key]['VALUE'], ENT_QUOTES, 'UTF-8')?></div>
-          </div>
-        </div>
-      <?}?>
+</div>
 
-    </div>
-
-    <div id="vstobjects">
-        <div class="l-separator"></div>
-    <div class="l-center">
-        <div class="l-unit-ft">
-          <table class='data'></table>
-          <div class="data-count l-unit__col l-unit__col--right total clearfix">
-            <?php
-            printf(ngettext('%d DNS record', '%d DNS records', $i),$i);
-            ?>
-          </div>
-          <div class="data-count l-unit__col l-unit__col--right back clearfix">
-          </div>
-      </div>
-    </div>
-  </div>
+<div id="vstobjects">
+	<div class="l-separator"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right total clearfix">
+				<?php printf(ngettext('%d DNS record', '%d DNS records', $i),$i); ?>
+			</div>
+			<div class="data-count l-unit__col l-unit__col--right back clearfix">
+			</div>
+		</div>
+	</div>
+</div>

+ 147 - 146
web/templates/pages/list_firewall.html

@@ -1,150 +1,151 @@
-    <div class="l-center">
-      <div class="l-sort clearfix noselect">
-        <div class="l-unit-toolbar__buttonstrip">
-          <a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/server/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-          <a href="/add/firewall/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add Rule')?></a>
-          <?php if(!empty($_SESSION['FIREWALL_EXTENSION'])): ?>
-            <a class="ui-button cancel" dir="ltr" href="/list/firewall/banlist/"><i class="fas fa-eye status-icon red"></i><?=_('list fail2ban')?></a>
-            <a class="ui-button cancel" dir="ltr" href="/list/firewall/ipset/"><i class="fas fa-list status-icon blue"></i><?=_('list ipset')?></a>
-          <?php endif; ?>
-        </div>
-        <ul class="context-menu sort-order animated fadeIn" style="display:none;">
-          <li entity="sort-action"><span class="name"><?=_('Action')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up active"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-protocol"><span class="name"><?=_('Protocol')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-port"><span class="name"><?=_('Port')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-ip" sort_as_int="1"><span class="name"><?=_('IP address')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-comment"><span class="name"><?=_('Comment')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-        </ul>
-        <div class="l-sort-toolbar clearfix">
-          <table>
-            <tr>
-              <td class="sort-by" title="<?=_('Sort items');?>">
-                  <?=_('sort by');?>: <span><b><?=_('Action')?> <i class="fas fa-sort-alpha-up"></i></b></span>
-              </td>
-              <td>
-                <form action="/bulk/firewall/" method="post" id="objects">
-                <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                <div class="l-select">
-                  <select name="action" id="">
-                    <option value=""><?=_('apply to selected')?></option>
-                    <option value="delete"><?php print _('delete') ?></option>
-                  </select>
-                </div>
-                <button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected')?>"><i class="fas fa-arrow-right"></i></button>
-                </form>
-              </td>
-            </tr>
-          </table>
-        </div>
-      </div>
-    </div>
+<!-- Begin toolbar -->
+<div class="l-center">
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/server/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+			<a href="/add/firewall/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add Rule');?></a>
+			<?php if(!empty($_SESSION['FIREWALL_EXTENSION'])): ?>
+				<a class="ui-button cancel" dir="ltr" href="/list/firewall/banlist/"><i class="fas fa-eye status-icon red"></i><?=_('list fail2ban');?></a>
+				<a class="ui-button cancel" dir="ltr" href="/list/firewall/ipset/"><i class="fas fa-list status-icon blue"></i><?=_('list ipset');?></a>
+			<?php endif; ?>
+		</div>
+		<ul class="context-menu sort-order animated fadeIn" style="display:none;">
+			<li entity="sort-action"><span class="name"><?=_('Action');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up active"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-protocol"><span class="name"><?=_('Protocol');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-port"><span class="name"><?=_('Port');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-ip" sort_as_int="1"><span class="name"><?=_('IP address');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-comment"><span class="name"><?=_('Comment');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+		</ul>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td class="sort-by" title="<?=_('Sort items');?>">
+						<?=_('sort by');?>: <span><b><?=_('Action');?> <i class="fas fa-sort-alpha-up"></i></b></span>
+					</td>
+					<td>
+						<form action="/bulk/firewall/" method="post" id="objects">
+							<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+							<div class="l-select">
+								<select name="action" id="">
+									<option value=""><?=_('apply to selected');?></option>
+									<option value="delete"><?=_('delete') ?></option>
+								</select>
+							</div>
+							<button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected');?>"><i class="fas fa-arrow-right"></i></button>
+						</form>
+					</td>
+				</tr>
+			</table>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center units compact">         
-          <div class="header table-header">     
-            <div class="l-unit__col l-unit__col--right">
-                  <div class="clearfix l-unit__stat-col--left super-compact">
-                      <input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all')?>" onChange="checkedAll('objects');">
-                  </div>
-                  <div class="clearfix l-unit__stat-col--left wide-2"><b><?php print _('Action');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left compact-2 text-right"><b>&nbsp;</b></div>
-                  <div class="clearfix l-unit__stat-col--left wide-1 text-center"><b><?php print _('Comment');?></b></div>   
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Protocol');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left wide-3 text-center"><b><?php print _('Port');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('IP address');?></b></div>
-            </div>
-          </div>
+<div class="l-center units compact">
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left super-compact">
+				<input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all');?>" onChange="checkedAll('objects');">
+			</div>
+			<div class="clearfix l-unit__stat-col--left wide-2"><b><?=_('Action');?></b></div>
+			<div class="clearfix l-unit__stat-col--left compact-2 text-right"><b>&nbsp;</b></div>
+			<div class="clearfix l-unit__stat-col--left wide-1 text-center"><b><?=_('Comment');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Protocol');?></b></div>
+			<div class="clearfix l-unit__stat-col--left wide-3 text-center"><b><?=_('Port');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('IP address');?></b></div>
+		</div>
+	</div>
 
-      <?php
-        foreach ($data as $key => $value) {
-          ++$i;
-          if ($data[$key]['SUSPENDED'] == 'yes') {
-            $status = 'suspended';
-            $spnd_action = 'unsuspend';
-            $spnd_icon = 'fa-play';
-            $spnd_confirmation = _('UNSUSPEND_RULE_CONFIRMATION') ;
-          } else {
-            $status = 'active';
-            $spnd_action = 'suspend';
-            $spnd_icon = 'fa-pause';
-            $spnd_confirmation = _('SUSPEND_RULE_CONFIRMATION') ;
-          }
-      ?>
+	<!-- Begin firewall chain/action list item loop -->
+	<?php
+		foreach ($data as $key => $value) {
+			++$i;
+			if ($data[$key]['SUSPENDED'] == 'yes') {
+				$status = 'suspended';
+				$spnd_action = 'unsuspend';
+				$spnd_icon = 'fa-play';
+				$spnd_confirmation = _('UNSUSPEND_RULE_CONFIRMATION') ;
+			} else {
+				$status = 'active';
+				$spnd_action = 'suspend';
+				$spnd_icon = 'fa-pause';
+				$spnd_confirmation = _('SUSPEND_RULE_CONFIRMATION') ;
+			}
+		?>
+		<div class="l-unit<?php if ($status == 'suspended') echo ' l-unit--suspended'; if($_SESSION['favourites']['FIREWALL'][$key] == 1) echo ' l-unit--starred'; ?> animated fadeIn" v_unit_id="<?=$key?>" v_section="firewall"
+			sort-action="<?=$data[$key]['ACTION']?>" sort-protocol="<?=$data[$key]['PROTOCOL']?>" sort-port="<?=$data[$key]['PORT']?>"
+			sort-ip="<?=str_replace('.', '', $data[$key]['IP'])?>" sort-comment="<?=$data[$key]['COMMENT']?>" sort-star="<?php if ($_SESSION['favourites']['FIREWALL'][$key] == 1) echo '1'; else echo '2'; ?>">
+			<div class="l-unit__col l-unit__col--right">
+				<div>
+					<div class="clearfix l-unit__stat-col--left super-compact">
+						<input id="check<?=$i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select');?>" name="rule[]" value="<?=$key?>">
+					</div>
+					<div class="clearfix l-unit__stat-col--left wide-2">
+						<b>
+							<a href="/edit/firewall/?rule=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Firewall Rule');?>">
+							<?php if ($data[$key]['SUSPENDED'] == 'no') { ?>
+								<?php if ($data[$key]['ACTION'] == 'DROP') { ?>
+									<i class="fas fa-minus-circle status-icon red icon-pad-right"></i> <?=_($data[$key]['ACTION'])?>
+								<?php } else {?>
+									<i class="fas fa-check-circle status-icon green icon-pad-right"></i> <?=_($data[$key]['ACTION'])?>
+								<?php } ?>
+							<?php } else {?>
+								<?php if ($data[$key]['ACTION'] == 'DROP') { ?>
+									<i class="fas fa-minus-circle icon-pad-right" style=""></i> <?=_($data[$key]['ACTION'])?>
+								<?php } else {?>
+									<i class="fas fa-check-circle icon-pad-right"></i> <?=_($data[$key]['ACTION'])?>
+								<?php } ?>
+							<?php } ?>
+							</a>
+						</b>
+					</div>
+					<!-- START QUICK ACTION TOOLBAR AREA -->
+					<div class="clearfix l-unit__stat-col--left compact-2 text-right">
+						<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+							<div class="actions-panel clearfix">
+								<div class="actions-panel__col actions-panel__logs shortcut-enter" key-action="href"><a href="/edit/firewall/?rule=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Firewall Rule');?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
+								<div class="actions-panel__col actions-panel__suspend shortcut-s" key-action="js">
+									<a id="<?=$spnd_action ?>_link_<?=$i?>" class="data-controls do_<?=$spnd_action?>" title="<?=_($spnd_action)?>">
+										<i class="fas <?=$spnd_icon?> status-icon highlight status-icon dim do_<?=$spnd_action?>"></i>
+										<input type="hidden" name="<?=$spnd_action?>_url" value="/<?=$spnd_action?>/firewall/?rule=<?=$key?>&token=<?=$_SESSION['token']?>" />
+										<div id="<?=$spnd_action?>_dialog_<?=$i?>" class="confirmation-text-suspention hidden" title="<?=_('Confirmation');?>">
+											<p class="confirmation"><?=sprintf($spnd_confirmation,$key)?></p>
+										</div>
+									</a>
+								</div>
+								<div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
+									<a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete');?>">
+										<i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
+										<input type="hidden" name="delete_url" value="/delete/firewall/?rule=<?=$key?>&token=<?=$_SESSION['token']?>" />
+										<div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation');?>">
+											<p class="confirmation"><?=sprintf(_('DELETE_RULE_CONFIRMATION'),$key)?></p>
+										</div>
+									</a>
+								</div>
+							</div>
+						</div>
+					</div>
+					<!-- END QUICK ACTION TOOLBAR AREA -->
+					<div class="clearfix l-unit__stat-col--left wide-1 text-center"><b><?php if (!empty($data[$key]['COMMENT'])) echo '' . $data[$key]['COMMENT']; else echo "&nbsp;"; ?></b></div>
+					<div class="clearfix l-unit__stat-col--left text-center"><?=_($data[$key]['PROTOCOL'])?></div>
+					<div class="clearfix l-unit__stat-col--left wide-3 text-center"><b><?=$data[$key]['PORT']?></b></div>
+					<div class="clearfix l-unit__stat-col--left text-center"><?=$data[$key]['IP']?></div>
+				</div>
+			</div>
+		</div>
+	<?php } ?>
+</div>
 
-      <div class="l-unit<? if($status == 'suspended') echo ' l-unit--suspended'; if($_SESSION['favourites']['FIREWALL'][$key] == 1) echo ' l-unit--starred'; ?> animated fadeIn" v_unit_id="<?=$key?>" v_section="firewall"
-sort-action="<?=$data[$key]['ACTION']?>" sort-protocol="<?=$data[$key]['PROTOCOL']?>" sort-port="<?=$data[$key]['PORT']?>"
-sort-ip="<?=str_replace('.', '', $data[$key]['IP'])?>" sort-comment="<?=$data[$key]['COMMENT']?>" sort-star="<? if($_SESSION['favourites']['FIREWALL'][$key] == 1) echo '1'; else echo '2'; ?>">
-        <div class="l-unit__col l-unit__col--right">
-          <div>
-              <div class="clearfix l-unit__stat-col--left super-compact">
-                <input id="check<?php echo $i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select')?>" name="rule[]" value="<?php echo $key ?>">
-              </div>
-            <div class="clearfix l-unit__stat-col--left wide-2"><b><a href="/edit/firewall/?rule=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Firewall Rule')?>">
-                <? if($data[$key]['SUSPENDED'] == 'no'){ ?>
-                  <? if ($data[$key]['ACTION'] == 'DROP') { ?>
-                    <i class="fas fa-minus-circle status-icon red icon-pad-right"></i> <?=_($data[$key]['ACTION'])?>
-                  <? } else {?>
-                    <i class="fas fa-check-circle status-icon green icon-pad-right"></i> <?=_($data[$key]['ACTION'])?>
-                  <? } ?>
-                <? } else {?>
-                  <? if ($data[$key]['ACTION'] == 'DROP') { ?>
-                    <i class="fas fa-minus-circle icon-pad-right" style=""></i> <?=_($data[$key]['ACTION'])?>
-                  <? } else {?>
-                    <i class="fas fa-check-circle icon-pad-right"></i> <?=_($data[$key]['ACTION'])?>
-                  <? } ?>
-                <? } ?>
-              </a></b>
-            </div>
-            <!-- START QUICK ACTION TOOLBAR AREA -->
-            <div class="clearfix l-unit__stat-col--left compact-2 text-right">
-              <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-                <div class="actions-panel clearfix">
-                  <div class="actions-panel__col actions-panel__logs shortcut-enter" key-action="href"><a href="/edit/firewall/?rule=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Firewall Rule')?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
-                        
-                  <div class="actions-panel__col actions-panel__suspend shortcut-s" key-action="js">
-                    <a id="<?=$spnd_action ?>_link_<?=$i?>" class="data-controls do_<?=$spnd_action?>" title="<?=_($spnd_action)?>">
-                      <i class="fas <?=$spnd_icon?> status-icon highlight status-icon dim do_<?=$spnd_action?>"></i>
-                      <input type="hidden" name="<?=$spnd_action?>_url" value="/<?=$spnd_action?>/firewall/?rule=<?=$key?>&token=<?=$_SESSION['token']?>" />
-                      <div id="<?=$spnd_action?>_dialog_<?=$i?>" class="confirmation-text-suspention hidden" title="<?=_('Confirmation')?>">
-                        <p class="confirmation"><?=sprintf($spnd_confirmation,$key)?></p>
-                      </div>
-                    </a>
-                  </div>
-                  <div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
-                    <a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete')?>">
-                      <i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
-                      <input type="hidden" name="delete_url" value="/delete/firewall/?rule=<?=$key?>&token=<?=$_SESSION['token']?>" />
-                      <div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
-                        <p class="confirmation"><?=sprintf(_('DELETE_RULE_CONFIRMATION'),$key)?></p>
-                      </div>
-                    </a>
-                  </div>
-                 </div>
-              </div>
-            </div>
-            <!-- END QUICK ACTION TOOLBAR AREA -->
-            <div class="clearfix l-unit__stat-col--left wide-1 text-center"><b><? if(!empty($data[$key]['COMMENT'])) echo '' . $data[$key]['COMMENT']; else echo "&nbsp;"; ?></b></div>
-            <div class="clearfix l-unit__stat-col--left text-center"><?=_($data[$key]['PROTOCOL'])?></div>
-            <div class="clearfix l-unit__stat-col--left wide-3 text-center"><b><?=$data[$key]['PORT']?></b></div>
-            <div class="clearfix l-unit__stat-col--left text-center"><?=$data[$key]['IP']?></div>
-          </div>
-        </div>
-      </div>
-      <?}?>
-
-    </div>
-
-    <div id="vstobjects">
-        <div class="l-separator"></div>
-    <div class="l-center">
-        <div class="l-unit-ft">
-          <table class='data'></table>
-          <div class="data-count l-unit__col l-unit__col--right clearfix">
-            <?php
-               printf(ngettext('%d firewall rule', '%d firewall rules', $i),$i);
-            ?>
-          </div>
-      </div>
-    </div>
-  </div>
+<div id="vstobjects">
+	<div class="l-separator"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right clearfix">
+				<?php printf(ngettext('%d firewall rule', '%d firewall rules', $i),$i); ?>
+			</div>
+		</div>
+	</div>
+</div>

+ 97 - 97
web/templates/pages/list_firewall_banlist.html

@@ -1,101 +1,101 @@
-    <div class="l-center">
-      <div class="l-sort clearfix noselect">
-        <div class="l-unit-toolbar__buttonstrip">
-          <a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/firewall/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-          <a href="/add/firewall/banlist/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Ban IP Address')?></a>
-        </div>
-        <div class="l-sort-toolbar clearfix">
-          <table>
-            <tr>
-              <td>
-                <form action="/bulk/firewall/banlist/" method="post" id="objects">
-                <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                <div class="l-select">
-                  <select name="action" id="">
-                    <option value=""><?=_('apply to selected')?></option>
-                    <option value="delete"><?php print _('delete') ?></option>
-                  </select>
-                </div>
-                <button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected')?>"><i class="fas fa-arrow-right"></i></button>
-                </form>
-              </td>
-            </tr>
-          </table>
-        </div>
-      </div>
-    </div>
+<!-- Begin toolbar -->
+<div class="l-center">
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/firewall/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+			<a href="/add/firewall/banlist/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Ban IP Address');?></a>
+		</div>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td>
+						<form action="/bulk/firewall/banlist/" method="post" id="objects">
+							<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+							<div class="l-select">
+								<select name="action" id="">
+									<option value=""><?=_('apply to selected');?></option>
+									<option value="delete"><?=_('delete') ?></option>
+								</select>
+							</div>
+							<button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected');?>"><i class="fas fa-arrow-right"></i></button>
+						</form>
+					</td>
+				</tr>
+			</table>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
-  
-    <div class="l-center units">
-          <div class="header table-header">
-              <div class="l-unit__col l-unit__col--right">
-                    <div class="clearfix l-unit__stat-col--left super-compact">
-                        <input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all')?>" onChange="checkedAll('objects');">
-                    </div>
-                    <div class="clearfix l-unit__stat-col--left wide-3"><b><?php print _('IP address');?></b></div>
-                    <div class="clearfix l-unit__stat-col--left compact-4"><b>&nbsp;</b></div>  
-                    <div class="clearfix l-unit__stat-col--left text-center compact-5"><b><?php print _('Date');?></b></div>
-                    <div class="clearfix l-unit__stat-col--left text-center compact-5"><b><?php print _('Time');?></b></div>
-                    <div class="clearfix l-unit__stat-col--left wide text-center"><b><?php print _('Comment');?></b></div> 
-               </div>
-            </div>
+<div class="l-separator"></div>
 
-      <?php
-        foreach ($data as $key => $value) {
-          ++$i;
-          list($ip,$chain) = explode(":",$key);
+<div class="l-center units">
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left super-compact">
+				<input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all');?>" onChange="checkedAll('objects');">
+			</div>
+			<div class="clearfix l-unit__stat-col--left wide-3"><b><?=_('IP address');?></b></div>
+			<div class="clearfix l-unit__stat-col--left compact-4"><b>&nbsp;</b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact-5"><b><?=_('Date');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact-5"><b><?=_('Time');?></b></div>
+			<div class="clearfix l-unit__stat-col--left wide text-center"><b><?=_('Comment');?></b></div>
+		</div>
+	</div>
 
-      ?>
+	<!-- Begin banned IP address list item loop -->
+	<?php
+		foreach ($data as $key => $value) {
+			++$i;
+			list($ip,$chain) = explode(":",$key);
+		?>
+		<div class="l-unit<?php if ($status == 'suspended') echo ' l-unit--suspended';?> animated fadeIn">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left super-compact">
+					<input id="check<?=$i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select');?>" name="ipchain[]" value="<?=$ip . ':' . $value['CHAIN'] ?>">
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide-3"><b><?=$ip?></b></div>
+				<!-- START QUICK ACTION TOOLBAR AREA -->
+				<div class="clearfix l-unit__stat-col--left compact-4">
+					<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+						<div class="actions-panel clearfix">
+							<div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
+								<a id="delete_link_<?=$i?>" class="data-controls do_delete">
+									<i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
+									<input type="hidden" name="delete_url" value="/delete/firewall/banlist/?ip=<?=$ip?>&chain=<?=$value['CHAIN']?>&token=<?=$_SESSION['token']?>" />
+									<div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation');?>">
+										<p class="confirmation"><?=sprintf(_('DELETE_IP_CONFIRMATION'),$key)?></p>
+									</div>
+								</a>
+							</div>
+						</div>
+					</div>
+				</div>
+				<!-- END QUICK ACTION TOOLBAR AREA -->
+				<div class="clearfix l-unit__stat-col--left text-center compact-5"><?=_($data[$key]['DATE'])?></div>
+				<div class="clearfix l-unit__stat-col--left text-center compact-5"><?=$data[$key]['TIME']?></div>
+				<div class="clearfix l-unit__stat-col--left text-center wide"><b><?=_($value['CHAIN'])?></b></div>
+			</div>
+		</div>
+	<?php } ?>
+</div>
 
-      <div class="l-unit<? if($status == 'suspended') echo ' l-unit--suspended';?> animated fadeIn">
-        <div class="l-unit__col l-unit__col--right">
-              <div class="clearfix l-unit__stat-col--left super-compact">
-                  <input id="check<?php echo $i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select')?>" name="ipchain[]" value="<?php echo $ip . ':' . $value['CHAIN'] ?>">
-                </div>
-              <div class="clearfix l-unit__stat-col--left wide-3"><b><?=$ip?></b></div>
-              <!-- START QUICK ACTION TOOLBAR AREA -->
-              <div class="clearfix l-unit__stat-col--left compact-4">
-                <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-                    <div class="actions-panel clearfix">
-                      <div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
-                        <a id="delete_link_<?=$i?>" class="data-controls do_delete">
-                          <i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
-                          <input type="hidden" name="delete_url" value="/delete/firewall/banlist/?ip=<?=$ip?>&chain=<?=$value['CHAIN']?>&token=<?=$_SESSION['token']?>" />
-                          <div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
-                            <p class="confirmation"><?=sprintf(_('DELETE_IP_CONFIRMATION'),$key)?></p>
-                          </div>
-                        </a>
-                      </div>
-                    </div>
-                  </div>
-                </div>
-                <!-- END QUICK ACTION TOOLBAR AREA -->
-                <div class="clearfix l-unit__stat-col--left text-center compact-5"><?=_($data[$key]['DATE'])?></div>
-                <div class="clearfix l-unit__stat-col--left text-center compact-5"><?=$data[$key]['TIME']?></div>
-                <div class="clearfix l-unit__stat-col--left text-center wide"><b><?=_($value['CHAIN'])?></b></div>
-            </div>
-      </div>
-      <?}?>
-    </div>
-
-    <div id="vstobjects">
-        <div class="l-separator"></div>
-    <div class="l-center">
-        <div class="l-unit-ft">
-          <table class='data'></table>
-          <div class="data-count l-unit__col l-unit__col--right clearfix">
-            <?php
-              if ( $i == 0) {
-                echo _('There are currently no banned IP addresses.');
-              }else{
-                printf(ngettext('%d banned IP address', '%d banned IP addresses', $i),$i);
-              }
-            ?>
-          </div>
-          <div class="data-count l-unit__col l-unit__col--right back clearfix">
-           
-          </div>
-      </div>
-    </div>
-  </div>
+<div id="vstobjects">
+	<div class="l-separator"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right clearfix">
+				<?php
+					if ( $i == 0) {
+						echo _('There are currently no banned IP addresses.');
+					} else {
+						printf(ngettext('%d banned IP address', '%d banned IP addresses', $i),$i);
+					}
+				?>
+			</div>
+			<div class="data-count l-unit__col l-unit__col--right back clearfix">
+			</div>
+		</div>
+	</div>
+</div>

+ 111 - 113
web/templates/pages/list_firewall_ipset.html

@@ -1,117 +1,115 @@
-    <div class="l-center">
-      <div class="l-sort clearfix noselect">
-        <div class="l-unit-toolbar__buttonstrip">
-          <a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/firewall/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-          <a href="/add/firewall/ipset/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add IP list')?></a>
-        </div>
-        <div class="l-sort-toolbar clearfix">
-          <table>
-            <tr>
-              <td>
-                <form action="/bulk/firewall/ipset/" method="post" id="objects">
-                <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                <div class="l-select">
-                  <select name="action" id="">
-                    <option value=""><?=_('apply to selected')?></option>
-                    <option value="delete"><?php print _('delete') ?></option>
-                  </select>
-                </div>
-                <button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected')?>"><i class="fas fa-arrow-right"></i></button>
-                </form>
-              </td>
-            </tr>
-          </table>
-        </div>
-      </div>
-    </div>
+<!-- Begin toolbar -->
+<div class="l-center">
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/firewall/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+			<a href="/add/firewall/ipset/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add IP list');?></a>
+		</div>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td>
+						<form action="/bulk/firewall/ipset/" method="post" id="objects">
+							<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+							<div class="l-select">
+								<select name="action" id="">
+									<option value=""><?=_('apply to selected');?></option>
+									<option value="delete"><?=_('delete') ?></option>
+								</select>
+							</div>
+							<button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected');?>"><i class="fas fa-arrow-right"></i></button>
+						</form>
+					</td>
+				</tr>
+			</table>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
-  
-    <div class="l-center units">
-          <div class="header table-header">
-              <div class="l-unit__col l-unit__col--right">
-                    <div class="clearfix l-unit__stat-col--left super-compact">
-                        <input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all')?>" onChange="checkedAll('objects');">
-                    </div>
-                    <div class="clearfix l-unit__stat-col--left wide-3"><b><?php print _('Ip List Name');?></b></div>
-                    <div class="clearfix l-unit__stat-col--left compact-4"><b>&nbsp;</b></div>  
-                    <div class="clearfix l-unit__stat-col--left text-center compact-5"><b><?php print _('Autoupdate');?></b></div>
-                    <div class="clearfix l-unit__stat-col--left text-center compact-4"><b><?php print _('Ip Version');?></b></div>
-                    <div class="clearfix l-unit__stat-col--left text-center compact-4"><b><?php print _('Date');?></b></div>
-                    <div class="clearfix l-unit__stat-col--left text-center compact-4"><b><?php print _('Time');?></b></div>
-               </div>
-            </div>
+<div class="l-separator"></div>
 
-      <?php
-        foreach ($data as $key => $value) {
-          ++$i;
+<div class="l-center units">
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left super-compact">
+				<input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all');?>" onChange="checkedAll('objects');">
+			</div>
+			<div class="clearfix l-unit__stat-col--left wide-3"><b><?=_('Ip List Name');?></b></div>
+			<div class="clearfix l-unit__stat-col--left compact-4"><b>&nbsp;</b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact-5"><b><?=_('Autoupdate');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact-4"><b><?=_('Ip Version');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact-4"><b><?=_('Date');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact-4"><b><?=_('Time');?></b></div>
+		</div>
+	</div>
 
-          if ($data[$key]['SUSPENDED'] == 'yes') {
-            $status = 'suspended';
-          } else {
-            $status = 'active';
-          }
+	<!-- Begin firewall IP address list item loop -->
+	<?php
+		foreach ($data as $key => $value) {
+			++$i;
+			if ($data[$key]['SUSPENDED'] == 'yes') {
+				$status = 'suspended';
+			} else {
+				$status = 'active';
+			}
+			list($listname, $chain) = explode(":", $key);
+		?>
+		<div class="l-unit<?php if ($status == 'suspended') echo ' l-unit--suspended';?> animated fadeIn">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left super-compact">
+					<input id="check<?=$i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select');?>" name="setname[]" value="<?=$listname ?>">
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide-3"><b><?=$listname?></b></div>
+				<!-- START QUICK ACTION TOOLBAR AREA -->
+				<div class="clearfix l-unit__stat-col--left compact-4">
+					<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+						<div class="actions-panel clearfix">
+							<div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
+								<a id="delete_link_<?=$i?>" class="data-controls do_delete">
+									<i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
+									<input type="hidden" name="delete_url" value="/delete/firewall/ipset/?listname=<?=$listname?>&token=<?=$_SESSION['token']?>" />
+									<div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation');?>">
+										<p class="confirmation"><?=sprintf(_('DELETE_IPSET_CONFIRMATION'), $key)?></p>
+									</div>
+								</a>
+							</div>
+						</div>
+					</div>
+				</div>
+				<!-- END QUICK ACTION TOOLBAR AREA -->
+				<div class="clearfix l-unit__stat-col--left text-center compact-5"><b>
+						<?php if ($data[$key]['AUTOUPDATE'] == 'no') { ?>
+							<i class="fas fa-times-circle status-icon red"></i>
+						<?php } else { ?>
+							<i class="fas fa-check-circle status-icon green"></i>
+						<?php } ?>
+					</b>
+				</div>
+				<div class="clearfix l-unit__stat-col--left text-center compact-4"><?=_($data[$key]['IP_VERSION'])?></div>
+				<div class="clearfix l-unit__stat-col--left text-center compact-4"><?=_($data[$key]['DATE'])?></div>
+				<div class="clearfix l-unit__stat-col--left text-center compact-4"><?=$data[$key]['TIME']?></div>
+			</div>
+		</div>
+	<?php } ?>
+</div>
 
-          list($listname, $chain) = explode(":", $key);
-      ?>
-
-      <div class="l-unit<? if($status == 'suspended') echo ' l-unit--suspended';?> animated fadeIn">
-        <div class="l-unit__col l-unit__col--right">
-              <div class="clearfix l-unit__stat-col--left super-compact">
-                  <input id="check<?php echo $i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select')?>" name="setname[]" value="<?php echo $listname ?>">
-                </div>
-              <div class="clearfix l-unit__stat-col--left wide-3"><b><?=$listname?></b></div>
-              <!-- START QUICK ACTION TOOLBAR AREA -->
-              <div class="clearfix l-unit__stat-col--left compact-4">
-                <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-                    <div class="actions-panel clearfix">
-
-                      <div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
-                        <a id="delete_link_<?=$i?>" class="data-controls do_delete">
-                          <i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
-                          <input type="hidden" name="delete_url" value="/delete/firewall/ipset/?listname=<?=$listname?>&token=<?=$_SESSION['token']?>" />
-                          <div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
-                            <p class="confirmation"><?=sprintf(_('DELETE_IPSET_CONFIRMATION'), $key)?></p>
-                          </div>
-                        </a>
-                      </div>
-                    </div>
-                  </div>
-                </div>
-                <!-- END QUICK ACTION TOOLBAR AREA -->
-                <div class="clearfix l-unit__stat-col--left text-center compact-5"><b>
-                    <? if($data[$key]['AUTOUPDATE'] == 'no'){ ?>
-                        <i class="fas fa-times-circle status-icon red"></i>
-                    <? } else {?>
-                        <i class="fas fa-check-circle status-icon green"></i>
-                    <? } ?>
-                    </b>
-                </div>
-                <div class="clearfix l-unit__stat-col--left text-center compact-4"><?=_($data[$key]['IP_VERSION'])?></div>
-                <div class="clearfix l-unit__stat-col--left text-center compact-4"><?=_($data[$key]['DATE'])?></div>
-                <div class="clearfix l-unit__stat-col--left text-center compact-4"><?=$data[$key]['TIME']?></div>
-            </div>
-      </div>
-      <?}?>
-    </div>
-
-    <div id="vstobjects">
-        <div class="l-separator"></div>
-    <div class="l-center">
-        <div class="l-unit-ft">
-          <table class='data'></table>
-          <div class="data-count l-unit__col l-unit__col--right clearfix">
-            <?php
-              if ( $i == 0) {
-                echo _('There are currently no IP lists defined.');
-              }else{
-                 printf(ngettext('%d Ipset list', '%d Ipset lists', $i),$i);
-              }
-            ?>
-          </div>
-          <div class="data-count l-unit__col l-unit__col--right back clearfix">
-           
-          </div>
-      </div>
-    </div>
-  </div>
+<div id="vstobjects">
+	<div class="l-separator"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right clearfix">
+				<?php
+					if ( $i == 0) {
+						echo _('There are currently no IP lists defined.');
+					} else {
+						printf(ngettext('%d Ipset list', '%d Ipset lists', $i),$i);
+					}
+				?>
+			</div>
+			<div class="data-count l-unit__col l-unit__col--right back clearfix">
+			</div>
+		</div>
+	</div>
+</div>

+ 111 - 111
web/templates/pages/list_ip.html

@@ -1,116 +1,116 @@
-    <div class="l-center">
-      <div class="l-sort clearfix noselect">
-        <div class="l-unit-toolbar__buttonstrip">
-          <a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/server/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-          <a href="/add/ip/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add IP')?></a>
-        </div>
-        <ul class="context-menu sort-order animated fadeIn" style="display:none;">
-          <li entity="sort-date" sort_as_int="1"><span class="name <? if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-ip"><span class="name"><?=_('ip')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-netmask"><span class="name"><?=_('Netmask')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-interface"><span class="name"><?=_('Interface')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-domains" sort_as_int="1"><span class="name"><?=_('Domains')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-owner"><span class="name"><?=_('Owner')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li> 
-        </ul>
-        <div class="l-sort-toolbar clearfix">
-          <table>
-            <tr>
-              <td class="sort-by" title="<?=_('Sort items');?>">
-                  <?=_('sort by');?>: <span><b><?=_('Date')?> <i class="fas fa-sort-alpha-down"></i></b></span>
-                </td>
-              <td>
-                <form action="/bulk/ip/" method="post" id="objects">
-                <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                <div class="l-select">
-                  <select name="action" id="">
-                    <option value=""><?=_('apply to selected')?></option>
-                    <option value="reread IP"><?=_('reread IP')?></option>
-                    <option value="delete"><?=_('delete')?></option>
-                  </select>
-                </div>
-                <button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected')?>"><i class="fas fa-arrow-right"></i></button>
-                </form>
-              </td>
-            </tr>
-          </table>
-        </div>
-      </div>
-    </div>
+<!-- Begin toolbar -->
+<div class="l-center">
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/server/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+			<a href="/add/ip/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add IP');?></a>
+		</div>
+		<ul class="context-menu sort-order animated fadeIn" style="display:none;">
+			<li entity="sort-date" sort_as_int="1"><span class="name <?php if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-ip"><span class="name"><?=_('ip');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-netmask"><span class="name"><?=_('Netmask');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-interface"><span class="name"><?=_('Interface');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-domains" sort_as_int="1"><span class="name"><?=_('Domains');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-owner"><span class="name"><?=_('Owner');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+		</ul>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td class="sort-by" title="<?=_('Sort items');?>">
+						<?=_('sort by');?>: <span><b><?=_('Date');?> <i class="fas fa-sort-alpha-down"></i></b></span>
+					</td>
+					<td>
+						<form action="/bulk/ip/" method="post" id="objects">
+							<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+							<div class="l-select">
+								<select name="action" id="">
+									<option value=""><?=_('apply to selected');?></option>
+									<option value="reread IP"><?=_('reread IP');?></option>
+									<option value="delete"><?=_('delete');?></option>
+								</select>
+							</div>
+							<button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected');?>"><i class="fas fa-arrow-right"></i></button>
+						</form>
+					</td>
+				</tr>
+			</table>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center units">
-      <div class="header table-header">     
-        <div class="l-unit__col l-unit__col--right">
-          <div>
-            <div class="clearfix l-unit__stat-col--left super-compact">
-              <input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all')?>" onChange="checkedAll('objects');">
-            </div>           
-            <div class="clearfix l-unit__stat-col--left wide-3"><b><?php print _('IP Address');?></b></div>
-            <div class="clearfix l-unit__stat-col--left compact text-right"><b>&nbsp;</b></div>
-            <div class="clearfix l-unit__stat-col--left text-center compact-5"><b><?php print _('Netmask');?></b></div>
-            <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Interface');?></b></div>
-            <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Status');?></b></div>
-            <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Domains');?></b></div>
-            <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Owner');?></b></div>
-          </div>
-        </div>
-     </div>
+<div class="l-center units">
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div>
+				<div class="clearfix l-unit__stat-col--left super-compact">
+					<input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all');?>" onChange="checkedAll('objects');">
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide-3"><b><?=_('IP Address');?></b></div>
+				<div class="clearfix l-unit__stat-col--left compact text-right"><b>&nbsp;</b></div>
+				<div class="clearfix l-unit__stat-col--left text-center compact-5"><b><?=_('Netmask');?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Interface');?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Status');?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Domains');?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Owner');?></b></div>
+			</div>
+		</div>
+	</div>
 
-      <?php
-        foreach ($data as $key => $value) {
-           ++$i;
-      ?>
+	<!-- Begin IP address list item loop -->
+	<?php
+		foreach ($data as $key => $value) {
+			++$i;
+		?>
+		<div class="l-unit <?php if ($data[$key]['SUSPENDED'] == 'yes') echo 'l-unit--suspended'; if($_SESSION['favourites']['IP'][$key] == 1) echo ' l-unit--starred'; ?> animated fadeIn" v_unit_id="<?=$key?>"
+			v_section="ip" sort-ip="<?=str_replace('.', '', $key)?>" sort-date="<?=strtotime($data[$key]['DATE'] .' '. $data[$key]['TIME'] )?>"
+			sort-netmask="<?=str_replace('.', '', $data[$key]['NETMASK'])?>" sort-interface="<?=$data[$key]['INTERFACE']?>" sort-domains="<?=$data[$key]['U_WEB_DOMAINS']?>"
+			sort-owner="<?=$data[$key]['OWNER']?>" sort-star="<?php if ($_SESSION['favourites']['IP'][$key] == 1) echo '1'; else echo '0'; ?>">
 
-      <div class="l-unit <? if($data[$key]['SUSPENDED'] == 'yes') echo 'l-unit--suspended'; if($_SESSION['favourites']['IP'][$key] == 1) echo ' l-unit--starred'; ?> animated fadeIn" v_unit_id="<?=$key?>"
-v_section="ip" sort-ip="<?=str_replace('.', '', $key)?>" sort-date="<?=strtotime($data[$key]['DATE'] .' '. $data[$key]['TIME'] )?>"
-sort-netmask="<?=str_replace('.', '', $data[$key]['NETMASK'])?>" sort-interface="<?=$data[$key]['INTERFACE']?>" sort-domains="<?=$data[$key]['U_WEB_DOMAINS']?>"
-sort-owner="<?=$data[$key]['OWNER']?>" sort-star="<? if($_SESSION['favourites']['IP'][$key] == 1) echo '1'; else echo '0'; ?>">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left super-compact">
+					<input id="check<?=$i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select');?>" name="ip[]" value="<?=$key?>">
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide-3"><b><a href="/edit/ip/?ip=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing IP Address');?>"><?=$key?> <?php if (!empty($data[$key]['NAT'])) echo ' → ' . $data[$key]['NAT'] . ''; ?></a></b>
+				</div>
+				<!-- START QUICK ACTION TOOLBAR AREA -->
+				<div class="clearfix l-unit__stat-col--left compact text-right">
+					<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+						<div class="actions-panel clearfix">
+							<div class="actions-panel__col actions-panel__logs shortcut-enter" key-action="href"><a href="/edit/ip/?ip=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing IP Address');?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
+							<div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
+								<a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete');?>">
+									<i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
+									<input type="hidden" name="delete_url" value="/delete/ip/?ip=<?=$key?>&token=<?=$_SESSION['token']?>" />
+									<div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation');?>">
+										<p class="confirmation"><?=sprintf(_('DELETE_IP_CONFIRMATION'),$key)?></p>
+									</div>
+								</a>
+							</div>
+						</div>
+					</div>
+				</div>
+				<!-- END QUICK ACTION TOOLBAR AREA -->
+				<div class="clearfix l-unit__stat-col--left text-center compact-5"><?=$data[$key]['NETMASK']?></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><?=$data[$key]['INTERFACE']?></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=_($data[$key]['STATUS'])?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=$data[$key]['U_WEB_DOMAINS']?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=$data[$key]['OWNER']?></b></div>
+			</div>
+		</div>
+	<?php } ?>
+</div>
 
-          <div class="l-unit__col l-unit__col--right">
-              <div class="clearfix l-unit__stat-col--left super-compact">
-                <input id="check<?php echo $i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select')?>" name="ip[]" value="<?=$key?>">
-              </div>
-              <div class="clearfix l-unit__stat-col--left wide-3"><b><a href="/edit/ip/?ip=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing IP Address')?>"><?=$key?> <?php if (!empty($data[$key]['NAT'])) echo ' → ' . $data[$key]['NAT'] . ''; ?></a></b>
-              </div>
-              <!-- START QUICK ACTION TOOLBAR AREA -->
-              <div class="clearfix l-unit__stat-col--left compact text-right">
-                    <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-                        <div class="actions-panel clearfix">
-                          <div class="actions-panel__col actions-panel__logs shortcut-enter" key-action="href"><a href="/edit/ip/?ip=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing IP Address')?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
-                          <div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
-                            <a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete')?>">
-                              <i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
-                              <input type="hidden" name="delete_url" value="/delete/ip/?ip=<?=$key?>&token=<?=$_SESSION['token']?>" />
-                              <div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
-                                <p class="confirmation"><?=sprintf(_('DELETE_IP_CONFIRMATION'),$key)?></p>
-                              </div>
-                            </a>
-                          </div>
-                        </div>
-                      </div>
-                </div>
-              <!-- END QUICK ACTION TOOLBAR AREA -->
-              <div class="clearfix l-unit__stat-col--left text-center compact-5"><?=$data[$key]['NETMASK']?></div>
-              <div class="clearfix l-unit__stat-col--left text-center"><?=$data[$key]['INTERFACE']?></div>
-              <div class="clearfix l-unit__stat-col--left text-center"><b><?=_($data[$key]['STATUS'])?></b></div>
-              <div class="clearfix l-unit__stat-col--left text-center"><b><?=$data[$key]['U_WEB_DOMAINS']?></b></div>
-              <div class="clearfix l-unit__stat-col--left text-center"><b><?=$data[$key]['OWNER']?></b></div>
-            </div>
-        </div>
-      <?}?>
-    </div>
-
-    <div id="vstobjects">
-        <div class="l-separator"></div>
-    <div class="l-center">
-        <div class="l-unit-ft">
-          <table class='data'></table>
-          <div class="data-count l-unit__col l-unit__col--right clearfix">
-            <?php
-            printf(ngettext('%d IP address', '%d IP addresses', $i),$i);
-            ?>
-          </div>
-      </div>
-    </div>
-  </div>
+<div id="vstobjects">
+	<div class="l-separator"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right clearfix">
+				<?php printf(ngettext('%d IP address', '%d IP addresses', $i),$i); ?>
+			</div>
+		</div>
+	</div>
+</div>

+ 62 - 62
web/templates/pages/list_key.html

@@ -1,69 +1,69 @@
-    <div class="l-center">
-      <div class="l-sort clearfix noselect">
-        <div class="l-unit-toolbar__buttonstrip">
-          <a class="ui-button cancel" dir="ltr" id="btn-back" href="/edit/user/?user=<?php echo $user;?>&token=<?=$_SESSION['token']?>"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-          <a href="/add/key/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add SSH Key')?></a>
-      </div>
-     </div>
-    </div>
-    
+<!-- Begin toolbar -->
+<div class="l-center">
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/edit/user/?user=<?=$user;?>&token=<?=$_SESSION['token']?>"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+			<a href="/add/key/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add SSH Key');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
+
 <div class="l-separator"></div>
 
 <div class="l-center units">
-  <div class="header table-header">     
-    <div class="l-unit__col l-unit__col--right">
-      <div class="clearfix l-unit__stat-col--left wide-3"><b><?php print _('SSH_ID');?></b></div>
-      <div class="clearfix l-unit__stat-col--left compact-2">
-        &nbsp;
-      </div> 
-      <div class="clearfix l-unit__stat-col--left wide-7"><b><?php print _('SSH KEY');?></b></div>
-    </div>
-  </div>
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left wide-3"><b><?=_('SSH_ID');?></b></div>
+			<div class="clearfix l-unit__stat-col--left compact-2">
+				&nbsp;
+			</div>
+			<div class="clearfix l-unit__stat-col--left wide-7"><b><?=_('SSH KEY');?></b></div>
+		</div>
+	</div>
 
- <?php
- 	$i = 0;
-    foreach ($data as $key => $value) {
-    ++$i;
-  ?>
-  <div class="l-unit header animated fadeIn" style="<?if ($data[$key]['ID'] === 'filemanager.ssh.key'){ echo 'display: none;'; }?>">
-    <div class="l-unit__col l-unit__col--right">
-      <div class="clearfix l-unit__stat-col--left wide-3"><b><?=htmlspecialchars($data[$key]['ID']);?></b></div>
-          <div class="clearfix l-unit__stat-col--left text-left compact-2">
-            <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-              <div class="actions-panel clearfix">
-                <div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
-                  <a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete')?>">
-                    <i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
-                    <? if (($_SESSION['userContext'] === 'admin') && (isset($_GET['user'])) && ($_GET['user'] !== 'admin')) { ?>
-                      <input type="hidden" name="delete_url" value="/delete/key/?user=<?=$_GET['user']?>&key=<?=$key?>&token=<?=$_SESSION['token']?>" />
-                      <? } else { ?>
-                        <input type="hidden" name="delete_url" value="/delete/key/?key=<?=$key?>&token=<?=$_SESSION['token']?>" />
-                      <? } ?>
-                    <div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
-                      <p class="confirmation"><?=sprintf(_('DELETE_KEY_CONFIRM'),$key)?></p>
-                    </div>
-                  </a>
-                </div>
-              </div>
-            </div>
-          </div>
-        <div class="clearfix l-unit__stat-col--left wide-7"><b><?=htmlspecialchars($data[$key]['KEY'], ENT_QUOTES);?></b></div>
-      </div>
-    </div>
-  <?}?>
+	<!-- Begin SSH key list item loop -->
+	<?php
+		$i = 0;
+			foreach ($data as $key => $value) {
+			++$i;
+		?>
+		<div class="l-unit header animated fadeIn" style="<?php if ($data[$key]['ID'] === 'filemanager.ssh.key'){ echo 'display: none;'; }?>">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left wide-3"><b><?=htmlspecialchars($data[$key]['ID']);?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-left compact-2">
+					<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+						<div class="actions-panel clearfix">
+							<div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
+								<a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete');?>">
+									<i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
+									<?php if (($_SESSION['userContext'] === 'admin') && (isset($_GET['user'])) && ($_GET['user'] !== 'admin')) { ?>
+										<input type="hidden" name="delete_url" value="/delete/key/?user=<?=$_GET['user']?>&key=<?=$key?>&token=<?=$_SESSION['token']?>" />
+									<?php } else { ?>
+										<input type="hidden" name="delete_url" value="/delete/key/?key=<?=$key?>&token=<?=$_SESSION['token']?>" />
+									<?php } ?>
+									<div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation');?>">
+										<p class="confirmation"><?=sprintf(_('DELETE_KEY_CONFIRM'),$key)?></p>
+									</div>
+								</a>
+							</div>
+						</div>
+					</div>
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide-7"><b><?=htmlspecialchars($data[$key]['KEY'], ENT_QUOTES);?></b></div>
+			</div>
+		</div>
+	<?php } ?>
 </div>
 
 <div id="vstobjects">
-    <div class="l-separator"></div>
-        <div class="l-center">
-            <div class="l-unit-ft">
-                <table class='data'></table>
-                <div class="data-count l-unit__col l-unit__col--right clearfix">
-                <?php
-                printf(ngettext('%d SSH Key', '%d SSH Keys', $i),$i);
-                ?>
-      </div>
-    </div>
-  </div>
-</div>
-    
+	<div class="l-separator"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right clearfix">
+				<?php printf(ngettext('%d SSH Key', '%d SSH Keys', $i),$i); ?>
+			</div>
+		</div>
+	</div>
+</div>

+ 96 - 95
web/templates/pages/list_log.html

@@ -1,107 +1,108 @@
+<!-- Begin toolbar -->
 <div class="l-center">
-  <div class="l-sort clearfix noselect">
-    <div class="l-unit-toolbar__buttonstrip">
-      <? if (($_SESSION['userContext'] === 'admin') && ($_SESSION['look'] === 'admin')) {?>
-        <a href="/list/user/" id="btn-back" class="ui-button cancel" dir="ltr"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-      <? } else if (($_SESSION['userContext'] === 'admin') && ($_GET['user'] === 'system')) { ?>
-        <a href="/list/server/" id="btn-back" class="ui-button cancel" dir="ltr"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-      <? } else {?>
-        <? if (($_SESSION['userContext'] === 'admin') && (isset($_GET['user'])) && ($_GET['user'] !== 'admin')) { ?>
-        <a href="/edit/user/?user=<?php echo $_GET['user']; ?>&token=<?=$_SESSION['token']?>" id="btn-back" class="ui-button cancel" dir="ltr"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-        <? } else { ?>
-        <a href="/edit/user/?user=<?php echo $user;?>&token=<?=$_SESSION['token']?>" id="btn-back" class="ui-button cancel" dir="ltr"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-        <? } ?>
-      <? } ?>
-      <? if (($_SESSION['userContext'] === 'admin') && ($_GET['user'] !== 'admin')) { ?>
-        <? if (($_SESSION['userContext'] === 'admin') && (isset($_GET['user'])) && ($_GET['user'] !== 'admin')) { ?>
-          <? if ($_GET['user'] !== 'system') {?>
-            <a href="/list/log/auth/?user=<?php echo $_GET['user']; ?>&token=<?=$_SESSION['token']?>" id="btn-back" class="ui-button cancel" dir="ltr" title="<?=_('Login history');?>"><i class="fas fa-binoculars status-icon green"></i><?=_('Login history')?></a>
-          <? } ?>
-        <? } else { ?>
-          <a href="/list/log/auth/" id="btn-back" class="ui-button cancel" dir="ltr" title="<?=_('Login history');?>"><i class="fas fa-binoculars status-icon green"></i><?=_('Login history')?></a>
-        <? } ?>
-      <? } ?>
-      <? if ($_SESSION['userContext'] === 'user') {?>
-        <a href="/list/log/auth/" id="btn-back" class="ui-button cancel" dir="ltr" title="<?=_('Login history');?>"><i class="fas fa-binoculars status-icon green"></i><?=_('Login history')?></a>
-      <? } ?>
-    </div>
-    <div class="l-unit-toolbar__buttonstrip float-right">
-      <a href="javascript:location.reload();" class="ui-button cancel" dir="ltr"><i class="fas fa-redo status-icon green"></i><?=_('Refresh')?></a>
-    <? if (($_SESSION['userContext'] === 'admin') && ($_SESSION['look'] === 'admin') && ($_SESSION['POLICY_SYSTEM_PROTECTED_ADMIN'] === 'yes')) {?>
-      <!-- Hide delete buttons-->
-    <? } else { ?>
-      <? if (($_SESSION['userContext'] === 'admin') || (($_SESSION['userContext'] === 'user') && ($_SESSION['POLICY_USER_DELETE_LOGS'] !== 'no'))) {?>
-        <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')?>
-            <? if (($_SESSION['userContext'] === 'admin') && (isset($_GET['user']))) {?>
-              <input type="hidden" name="delete_url" value="/delete/log/?user=<?=$_GET['user'];?>&token=<?=$_SESSION['token']?>" />
-            <? } else { ?>
-              <input type="hidden" name="delete_url" value="/delete/log/?token=<?=$_SESSION['token']?>" />
-            <? } ?>
-              <div class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
-                <p class="confirmation"><?=_('DELETE_LOGS_CONFIRMATION')?></p>
-              </div>
-            </a>
-          </div>
-        <? } ?>
-      <? } ?>
-    </div>
-  </div>
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<?php if (($_SESSION['userContext'] === 'admin') && ($_SESSION['look'] === 'admin')) {?>
+				<a href="/list/user/" id="btn-back" class="ui-button cancel" dir="ltr"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+			<?php } else if (($_SESSION['userContext'] === 'admin') && ($_GET['user'] === 'system')) { ?>
+				<a href="/list/server/" id="btn-back" class="ui-button cancel" dir="ltr"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+			<?php } else { ?>
+				<?php if (($_SESSION['userContext'] === 'admin') && (isset($_GET['user'])) && ($_GET['user'] !== 'admin')) { ?>
+					<a href="/edit/user/?user=<?=$_GET['user']; ?>&token=<?=$_SESSION['token']?>" id="btn-back" class="ui-button cancel" dir="ltr"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+				<?php } else { ?>
+					<a href="/edit/user/?user=<?=$user;?>&token=<?=$_SESSION['token']?>" id="btn-back" class="ui-button cancel" dir="ltr"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+				<?php } ?>
+			<?php } ?>
+			<?php if (($_SESSION['userContext'] === 'admin') && ($_GET['user'] !== 'admin')) { ?>
+				<?php if (($_SESSION['userContext'] === 'admin') && (isset($_GET['user'])) && ($_GET['user'] !== 'admin')) { ?>
+					<?php if ($_GET['user'] !== 'system') {?>
+						<a href="/list/log/auth/?user=<?=$_GET['user']; ?>&token=<?=$_SESSION['token']?>" id="btn-back" class="ui-button cancel" dir="ltr" title="<?=_('Login history');?>"><i class="fas fa-binoculars status-icon green"></i><?=_('Login history');?></a>
+					<?php } ?>
+				<?php } else { ?>
+					<a href="/list/log/auth/" id="btn-back" class="ui-button cancel" dir="ltr" title="<?=_('Login history');?>"><i class="fas fa-binoculars status-icon green"></i><?=_('Login history');?></a>
+				<?php } ?>
+			<?php } ?>
+			<?php if ($_SESSION['userContext'] === 'user') {?>
+				<a href="/list/log/auth/" id="btn-back" class="ui-button cancel" dir="ltr" title="<?=_('Login history');?>"><i class="fas fa-binoculars status-icon green"></i><?=_('Login history');?></a>
+			<?php } ?>
+		</div>
+		<div class="l-unit-toolbar__buttonstrip float-right">
+			<a href="javascript:location.reload();" class="ui-button cancel" dir="ltr"><i class="fas fa-redo status-icon green"></i><?=_('Refresh');?></a>
+			<?php if (($_SESSION['userContext'] === 'admin') && ($_SESSION['look'] === 'admin') && ($_SESSION['POLICY_SYSTEM_PROTECTED_ADMIN'] === 'yes')) {?>
+				<!-- Hide delete buttons-->
+			<?php } else { ?>
+				<?php if (($_SESSION['userContext'] === 'admin') || (($_SESSION['userContext'] === 'user') && ($_SESSION['POLICY_USER_DELETE_LOGS'] !== 'no'))) {?>
+					<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');?>
+							<?php if (($_SESSION['userContext'] === 'admin') && (isset($_GET['user']))) {?>
+								<input type="hidden" name="delete_url" value="/delete/log/?user=<?=$_GET['user'];?>&token=<?=$_SESSION['token']?>" />
+							<?php } else { ?>
+								<input type="hidden" name="delete_url" value="/delete/log/?token=<?=$_SESSION['token']?>" />
+							<?php } ?>
+							<div class="confirmation-text-delete hidden" title="<?=_('Confirmation');?>">
+								<p class="confirmation"><?=_('DELETE_LOGS_CONFIRMATION');?></p>
+							</div>
+						</a>
+					</div>
+				<?php } ?>
+			<?php } ?>
+		</div>
+	</div>
 </div>
+<!-- End toolbar -->
 
 <div class="l-separator"></div>
 
 <div class="l-center units">
 
-  <div class="header table-header">     
-    <div class="l-unit__col l-unit__col--right">
-      <div class="clearfix l-unit__stat-col--left super-compact text-center">&nbsp;</div>
-      <div class="clearfix l-unit__stat-col--left"><b><?php print _('Date');?></b></div>
-      <div class="clearfix l-unit__stat-col--left compact-2"><b><?php print _('Time');?></b></div>
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left super-compact text-center">&nbsp;</div>
+			<div class="clearfix l-unit__stat-col--left"><b><?=_('Date');?></b></div>
+			<div class="clearfix l-unit__stat-col--left compact-2"><b><?=_('Time');?></b></div>
+			<div class="clearfix l-unit__stat-col--left"><b><?=_('Category');?></b></div>
+			<div class="clearfix l-unit__stat-col--left"><b><?=_('Message');?></b></div>
+		</div>
+	</div>
 
-      <div class="clearfix l-unit__stat-col--left"><b><?php print _('Category');?></b></div>
-      <div class="clearfix l-unit__stat-col--left"><b><?php print _('Message');?></b></div>
-    </div>
-  </div>
+	<!-- Begin log history entry loop -->
+	<?php
+		foreach ($data as $key => $value) {
+			++$i;
 
-  <?php
-      foreach ($data as $key => $value) {
-        ++$i;
-      ?>
-      <div class="l-unit header animated fadeIn">
-        <div class="l-unit__col l-unit__col--right">
-          <div class="clearfix l-unit__stat-col--left super-compact text-center">
-            <? if ($data[$key]['LEVEL'] === 'Info') {?>
-              <i class="fas fa-info-circle status-icon blue"></i>
-            <? } ?>
-            <? if ($data[$key]['LEVEL'] === 'Warning') {?>
-              <i class="fas fa-exclamation-triangle status-icon orange"></i>
-            <? } ?>
-            <? if ($data[$key]['LEVEL'] === 'Error') {?>
-              <i class="fas fa-times-circle status-icon red"></i>
-            <? } ?>
-          </div>
-          <div class="clearfix l-unit__stat-col--left"><b><?=translate_date($data[$key]['DATE'])?></b></div>
-          <div class="clearfix l-unit__stat-col--left compact-2"><b><?=htmlspecialchars($data[$key]['TIME']);?></b></div>
-
-          <div class="clearfix l-unit__stat-col--left"><b><?=htmlspecialchars($data[$key]['CATEGORY']);?></b></div>
-          <div class="clearfix l-unit__stat-col--left wide-7"><?=htmlspecialchars($data[$key]['MESSAGE'], ENT_QUOTES);?></div>
-        </div>
-      </div>
-  <?}?>
+			if ($data[$key]['LEVEL'] === 'Info') {
+				$level_icon = 'fa-info-circle status-icon blue';
+			}
+			if ($data[$key]['LEVEL'] === 'Warning') {
+				$level_icon = 'fa-exclamation-triangle status-icon orange';
+			}
+			if ($data[$key]['LEVEL'] === 'Error') {
+				$level_icon = 'fa-times-circle status-icon red';
+			}
+		?>
+		<div class="l-unit header animated fadeIn">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left super-compact text-center">
+					<i class="fas <?=$level_icon;?>"></i>
+				</div>
+				<div class="clearfix l-unit__stat-col--left"><b><?=translate_date($data[$key]['DATE'])?></b></div>
+				<div class="clearfix l-unit__stat-col--left compact-2"><b><?=htmlspecialchars($data[$key]['TIME']);?></b></div>
+				<div class="clearfix l-unit__stat-col--left"><b><?=htmlspecialchars($data[$key]['CATEGORY']);?></b></div>
+				<div class="clearfix l-unit__stat-col--left wide-7"><?=htmlspecialchars($data[$key]['MESSAGE'], ENT_QUOTES);?></div>
+			</div>
+		</div>
+	<?php } ?>
 </div>
 
 <div id="vstobjects">
-  <div class="l-separator"></div>
-  <div class="l-center">
-    <div class="l-unit-ft">
-      <table class='data'></table>
-      <div class="data-count l-unit__col l-unit__col--right clearfix">
-        <?
-          printf(ngettext('%d log record', '%d log records', $i),$i);
-        ?>
-      </div>
-    </div>
-  </div>
-</div>
+	<div class="l-separator"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right clearfix">
+				<?php printf(ngettext('%d log record', '%d log records', $i),$i); ?>
+			</div>
+		</div>
+	</div>
+</div>

+ 86 - 85
web/templates/pages/list_log_auth.html

@@ -1,96 +1,97 @@
+<!-- Begin toolbar -->
 <div class="l-center">
-  <div class="l-sort clearfix noselect">
-    <div class="l-unit-toolbar__buttonstrip">
-      <? if (($_SESSION['userContext'] === 'admin') && (isset($_GET['user'])) && ($_GET['user'] !== 'admin')) { ?>
-        <a href="/list/log/?user=<?php echo $_GET['user']; ?>&token=<?=$_SESSION['token']?>" id="btn-back" class="ui-button cancel" dir="ltr"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-        <? } else { ?>
-        <a href="/list/log/" id="btn-back" class="ui-button cancel" dir="ltr"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-        <? } ?>
-    </div>
-    <div class="l-unit-toolbar__buttonstrip float-right">
-      <a href="javascript:location.reload();" class="ui-button cancel" dir="ltr"><i class="fas fa-redo status-icon green"></i><?=_('Refresh')?></a>
-      <? if (($_SESSION['userContext'] === 'admin') && ($_SESSION['look'] === 'admin') && ($_SESSION['POLICY_SYSTEM_PROTECTED_ADMIN'] === 'yes')) {?>
-          <!-- Hide delete buttons-->
-      <? } else { ?>
-        <? if (($_SESSION['userContext'] === 'admin') || (($_SESSION['userContext'] === 'user') && ($_SESSION['POLICY_USER_DELETE_LOGS'] !== 'no'))) {?>
-          <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')?>
-                <? if (($_SESSION['userContext'] === 'admin') && (isset($_GET['user']))) {?>
-                  <input type="hidden" name="delete_url" value="/delete/log/auth/?user=<?=$_GET['user'];?>&token=<?=$_SESSION['token']?>" />
-                <? } else { ?>
-                  <input type="hidden" name="delete_url" value="/delete/log/auth/?token=<?=$_SESSION['token']?>" />
-                <? } ?>
-                <div class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
-                  <p class="confirmation"><?=_('DELETE_LOGS_CONFIRMATION')?></p>
-                </div>
-            </a>
-          </div>
-        <? } ?>
-      <? } ?>
-    </div>
-  </div>
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<?php if (($_SESSION['userContext'] === 'admin') && (isset($_GET['user'])) && ($_GET['user'] !== 'admin')) { ?>
+				<a href="/list/log/?user=<?=$_GET['user']; ?>&token=<?=$_SESSION['token']?>" id="btn-back" class="ui-button cancel" dir="ltr"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+			<?php } else { ?>
+				<a href="/list/log/" id="btn-back" class="ui-button cancel" dir="ltr"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+			<?php } ?>
+		</div>
+		<div class="l-unit-toolbar__buttonstrip float-right">
+			<a href="javascript:location.reload();" class="ui-button cancel" dir="ltr"><i class="fas fa-redo status-icon green"></i><?=_('Refresh');?></a>
+			<?php if (($_SESSION['userContext'] === 'admin') && ($_SESSION['look'] === 'admin') && ($_SESSION['POLICY_SYSTEM_PROTECTED_ADMIN'] === 'yes')) {?>
+				<!-- Hide delete buttons-->
+			<?php } else { ?>
+				<?php if (($_SESSION['userContext'] === 'admin') || (($_SESSION['userContext'] === 'user') && ($_SESSION['POLICY_USER_DELETE_LOGS'] !== 'no'))) {?>
+					<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');?>
+							<?php if (($_SESSION['userContext'] === 'admin') && (isset($_GET['user']))) {?>
+								<input type="hidden" name="delete_url" value="/delete/log/auth/?user=<?=$_GET['user'];?>&token=<?=$_SESSION['token']?>" />
+							<?php } else { ?>
+								<input type="hidden" name="delete_url" value="/delete/log/auth/?token=<?=$_SESSION['token']?>" />
+							<?php } ?>
+							<div class="confirmation-text-delete hidden" title="<?=_('Confirmation');?>">
+								<p class="confirmation"><?=_('DELETE_LOGS_CONFIRMATION');?></p>
+							</div>
+						</a>
+					</div>
+				<?php } ?>
+			<?php } ?>
+		</div>
+	</div>
 </div>
+<!-- End toolbar -->
 
 <div class="l-separator"></div>
 
 <div class="l-center units">
-<div class="header table-header">     
-    <div class="l-unit__col l-unit__col--right">
-      <div class="clearfix l-unit__stat-col--left super-compact text-center">
-        <b><?php print _('Active');?></b>
-      </div>
-      <div class="clearfix l-unit__stat-col--left compact text-center">
-        <b><?php print _('Status');?></b>
-      </div>
-      <div class="clearfix l-unit__stat-col--left"><b><?php print _('Date');?></b></div>
-      <div class="clearfix l-unit__stat-col--left compact-2"><b><?php print _('Time');?></b></div>
-      <div class="clearfix l-unit__stat-col--left"><b><?php print _('IP address');?></b></div>
-      <div class="clearfix l-unit__stat-col--left wide-6"><b><?php print _('Browser');?></b></div>
-    </div>
-  </div> 
-<?php
-  foreach ($data as $key => $value) {
-    ++$i;
-  ?>
-  <div class="l-unit header animated fadeIn">
-    <div class="l-unit__col l-unit__col--right">
-      <div class="clearfix l-unit__stat-col--left super-compact text-center">
-        <? if ($data[$key]['ACTION'] == 'login') { ?>
-          <? if ($data[$key]['ACTIVE'] === 'yes') {?>
-            <i class="fas fa-sign-in-alt status-icon maroon icon-pad-right" title="<?=_('Login')?>"></i>
-          <? } else {?>
-            <i class="fas fa-sign-in-alt status-icon dim icon-pad-right" title="<?=_('Login')?>"></i>
-          <? } ?>
-        <? } ?>
-      </div>
-      <div class="clearfix l-unit__stat-col--left compact text-center">
-        <? if ($data[$key]['STATUS'] == 'success') { ?>
-          <i class="fas fa-check-circle status-icon green icon-pad-right" title="<?=_('Success')?>"></i>
-        <? } else {?>
-          <i class="fas fa-minus-circle status-icon red icon-pad-right" title="<?=_('Failed')?>"></i>
-        <? } ?>
-      </div>
-      <div class="clearfix l-unit__stat-col--left"><b><?=translate_date($data[$key]['DATE'])?></b></div>
-      <div class="clearfix l-unit__stat-col--left compact-2"><b><?=htmlspecialchars($data[$key]['TIME']);?></b></div>
-      <div class="clearfix l-unit__stat-col--left"><?=htmlspecialchars($data[$key]['IP']);?></div>
-      <div class="clearfix l-unit__stat-col--left wide-7"><?=htmlspecialchars($data[$key]['USER_AGENT']);?></b></div>
-    </div>
-  </div>
-<?}?>
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left text-center">
+				<b><?=_('Status');?></b>
+			</div>
+			<div class="clearfix l-unit__stat-col--left"><b><?=_('Date');?></b></div>
+			<div class="clearfix l-unit__stat-col--left compact-2"><b><?=_('Time');?></b></div>
+			<div class="clearfix l-unit__stat-col--left"><b><?=_('IP address');?></b></div>
+			<div class="clearfix l-unit__stat-col--left wide-7"><b><?=_('Browser');?></b></div>
+		</div>
+	</div>
+
+	<!-- Begin log history entry loop -->
+	<?php
+		foreach ($data as $key => $value) {
+			++$i;
+
+			if ($data[$key]['ACTION'] == 'login') {
+				if ($data[$key]['ACTIVE'] === 'yes') {
+					$action_icon = 'fa-sign-in-alt status-icon maroon';
+				} else {
+					$action_icon = ' fa-sign-in-alt status-icon dim';
+				}
+			}
+			if ($data[$key]['STATUS'] == 'success')  {
+					$status_icon = 'fa-check-circle status-icon green';
+					$status_title = 'Success';
+			} else {
+					$status_icon = 'fa-minus-circle status-icon red';
+					$status_title = 'Failed';
+			}
+		?>
+		<div class="l-unit header animated fadeIn">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left text-center">
+					<i class="fas <?=$status_icon;?> icon-pad-right" title="<?=$status_title;?>"></i>
+				</div>
+				<div class="clearfix l-unit__stat-col--left"><b><?=translate_date($data[$key]['DATE'])?></b></div>
+				<div class="clearfix l-unit__stat-col--left compact-2"><b><?=htmlspecialchars($data[$key]['TIME']);?></b></div>
+				<div class="clearfix l-unit__stat-col--left"><?=htmlspecialchars($data[$key]['IP']);?></div>
+				<div class="clearfix l-unit__stat-col--left wide-7"><?=htmlspecialchars($data[$key]['USER_AGENT']);?></b></div>
+			</div>
+		</div>
+	<?php } ?>
 
 </div>
 
 <div id="vstobjects">
-  <div class="l-separator"></div>
-  <div class="l-center">
-    <div class="l-unit-ft">
-      <table class='data'></table>
-      <div class="data-count l-unit_col l-unit_col--right clearfix">
-        <?
-          printf(ngettext('%d log record', '%d log records', $i),$i);
-        ?>
-      </div>
-    </div>
-  </div>
+	<div class="l-separator"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit_col l-unit_col--right clearfix">
+				<?php printf(ngettext('%d log record', '%d log records', $i),$i); ?>
+			</div>
+		</div>
+	</div>
 </div>

+ 231 - 246
web/templates/pages/list_mail.html

@@ -1,251 +1,236 @@
+<!-- Begin toolbar -->
 <div class="l-center">
-      <div class="l-sort clearfix noselect">
-        <div class="l-unit-toolbar__buttonstrip">
-          <? if ($read_only === 'true') {?>
-            <!-- Hide item creation button when impersonating 'admin' account -->
-          <? } else {?>
-            <a href="/add/mail/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add Mail Domain')?></a>
-          <? } ?>
-        </div>
-        <ul class="context-menu sort-order animated fadeIn" style="display:none;">
-          <li entity="sort-accounts" sort_as_int="1"><span class="name"><?=_('Accounts')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-date" sort_as_int="1"><span class="name <? if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-disk" sort_as_int="1"><span class="name"><?=_('Disk')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-name"><span class="name <? if ($_SESSION['userSortOrder'] === 'name') { echo 'active'; } ?>"><?=_('Name')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-        </ul>
-        <div class="l-sort-toolbar clearfix">
-          <table>
-            <tr>
-              <td class="sort-by" title="<?=_('Sort items');?>">
-                <?=_('sort by');?>: <span>
-                  <b>
-                    <? if ($_SESSION['userSortOrder'] === 'name') { $label = 'Name'; } else { $label = 'Date'; } ?>
-                    <?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
-                  </b>
-                </span>
-              </td>
-              <td class="l-sort-toolbar__search-box">
-                <form action="/search/" method="get">
-                  <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                  <input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search')?>" />
-                  <button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search')?>"><i class="fas fa-search"></i></button>
-                </form>
-              </td>
-              <? if ($read_only === 'true') {?>
-                <!-- Hide bulk actions for domain items when impersonating 'admin' account-->
-                <? } else { ?>
-                  <td>
-                    <form action="/bulk/mail/" method="post" id="objects">
-                    <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                    <div class="l-select">
-                      <select name="action" id="">
-                        <option value=""><?=_('apply to selected')?></option>
-                        <? if ($_SESSION['userContext'] === 'admin') {?>
-                          <option value="rebuild"><?=_('rebuild')?></option>
-                        <? } ?>
-                        <option value="suspend"><?=_('suspend')?></option>
-                        <option value="unsuspend"><?=_('unsuspend')?></option>
-                        <option value="delete"><?=_('delete')?></option>
-                      </select>
-                    </div>
-                    <button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected')?>"><i class="fas fa-arrow-right"></i></button>
-                    </form>
-                  </td>
-                <? } ?>
-            </tr>
-          </table>
-        </div>
-      </div>
-    </div>
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<?php if ($read_only !== 'true') {?>
+				<a href="/add/mail/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add Mail Domain');?></a>
+			<?php } ?>
+		</div>
+		<ul class="context-menu sort-order animated fadeIn" style="display:none;">
+			<li entity="sort-accounts" sort_as_int="1"><span class="name"><?=_('Accounts');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-date" sort_as_int="1"><span class="name <?php if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-disk" sort_as_int="1"><span class="name"><?=_('Disk');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-name"><span class="name <?php if ($_SESSION['userSortOrder'] === 'name') { echo 'active'; } ?>"><?=_('Name');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+		</ul>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td class="sort-by" title="<?=_('Sort items');?>">
+						<?=_('sort by');?>: <span>
+							<b>
+								<?php if ($_SESSION['userSortOrder'] === 'name') { $label = 'Name'; } else { $label = 'Date'; } ?>
+								<?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
+							</b>
+						</span>
+					</td>
+					<td class="l-sort-toolbar__search-box">
+						<form action="/search/" method="get">
+							<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+							<input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search');?>" />
+							<button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search');?>"><i class="fas fa-search"></i></button>
+						</form>
+					</td>
+					<?php if ($read_only !== 'true') {?>
+						<td>
+							<form action="/bulk/mail/" method="post" id="objects">
+								<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+								<div class="l-select">
+									<select name="action" id="">
+										<option value=""><?=_('apply to selected');?></option>
+										<?php if ($_SESSION['userContext'] === 'admin') {?>
+											<option value="rebuild"><?=_('rebuild');?></option>
+										<?php } ?>
+										<option value="suspend"><?=_('suspend');?></option>
+										<option value="unsuspend"><?=_('unsuspend');?></option>
+										<option value="delete"><?=_('delete');?></option>
+									</select>
+								</div>
+								<button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected');?>"><i class="fas fa-arrow-right"></i></button>
+							</form>
+						</td>
+					<?php } ?>
+				</tr>
+			</table>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center units">
-      <div class="header table-header">
-        <div class="l-unit__col l-unit__col--right">
-            <div class="clearfix l-unit__stat-col--left super-compact">
-              <input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all')?>" onChange="checkedAll('objects');" <?=$display_mode;?>>
-            </div>
-            <div class="clearfix l-unit__stat-col--left wide-3"><b><?php print _('Name');?></b></div>
-            <div class="clearfix l-unit__stat-col--left text-right compact-5"><b>&nbsp;</b></div>
-            <div class="clearfix l-unit__stat-col--left text-center compact-2"><b><?php print _('Accounts');?></b></div>
-            <div class="clearfix l-unit__stat-col--left text-center compact-2"><b><?php print _('Disk');?></b></div>
-            <div class="clearfix l-unit__stat-col--left text-center compact-3"><b><?php print _('Antivirus');?></b></div>
-            <div class="clearfix l-unit__stat-col--left text-center compact-3"><b><?php print _('AntiSpam');?></b></div>
-            <div class="clearfix l-unit__stat-col--left text-center compact-3"><b><?php print _('DKIM');?></b></div>
-            <div class="clearfix l-unit__stat-col--left text-center compact-3"><b><?php print _('SSL');?></b></div>
-          </div>
-        </div>
+<div class="l-center units">
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left super-compact">
+				<input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all');?>" onChange="checkedAll('objects');" <?=$display_mode;?>>
+			</div>
+			<div class="clearfix l-unit__stat-col--left wide-3"><b><?=_('Name');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-right compact-5"><b>&nbsp;</b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact-2"><b><?=_('Accounts');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact-2"><b><?=_('Disk');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact-3"><b><?=_('Antivirus');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact-3"><b><?=_('AntiSpam');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact-3"><b><?=_('DKIM');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact-3"><b><?=_('SSL');?></b></div>
+		</div>
+	</div>
 
-      <?
-        list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"].":");
-        $webmail = "webmail";
-        if (!empty($_SESSION['WEBMAIL_ALIAS'])) $webmail = $_SESSION['WEBMAIL_ALIAS'];
+	<!-- Begin mail domain list item loop -->
+	<?php
+		list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"].":");
+		$webmail = "webmail";
+		if (!empty($_SESSION['WEBMAIL_ALIAS'])) $webmail = $_SESSION['WEBMAIL_ALIAS'];
+		foreach ($data as $key => $value) {
+			++$i;
+			if ($data[$key]['SUSPENDED'] == 'yes') {
+				$status = 'suspended';
+				$spnd_action = 'unsuspend';
+				$spnd_icon = 'fa-play';
+				$spnd_confirmation = _('UNSUSPEND_DOMAIN_CONFIRMATION');
+				if ($data[$key]['ANTIVIRUS'] == 'no') {
+					$antivirus_icon = 'fa-times-circle';
+				} else {
+					$antivirus_icon = 'fa-check-circle';
+				}
+				if ($data[$key]['ANTISPAM'] == 'no') {
+					$antispam_icon = 'fa-times-circle';
+				} else {
+					$antispam_icon = 'fa-check-circle';
+				}
+				if ($data[$key]['DKIM'] == 'no') {
+					$dkim_icon = 'fa-times-circle';
+				} else {
+					$dkim_icon = 'fa-check-circle';
+				}
+				if ($data[$key]['SSL'] == 'no') {
+					$ssl_icon = 'fa-times-circle';
+				} else {
+					$ssl_icon = 'fa-check-circle';
+				}
+			} else {
+				$status = 'active';
+				$spnd_action = 'suspend';
+				$spnd_icon = 'fa-pause';
+				$spnd_confirmation = _('SUSPEND_DOMAIN_CONFIRMATION');
+				if ($data[$key]['ANTIVIRUS'] == 'no') {
+					$antivirus_icon = 'fa-times-circle status-icon red';
+				} else {
+					$antivirus_icon = 'fa-check-circle status-icon green';
+				}
+				if ($data[$key]['ANTISPAM'] == 'no') {
+					$antispam_icon = 'fa-times-circle status-icon red';
+				} else {
+					$antispam_icon = 'fa-check-circle status-icon green';
+				}
+				if ($data[$key]['DKIM'] == 'no') {
+					$dkim_icon = 'fa-times-circle status-icon red';
+				} else {
+					$dkim_icon = 'fa-check-circle status-icon green';
+				}
+				if ($data[$key]['SSL'] == 'no') {
+					$ssl_icon = 'fa-times-circle status-icon red';
+				} else {
+					$ssl_icon = 'fa-check-circle status-icon green';
+				}
+			}
+			if (empty($data[$key]['CATCHALL'])) {
+				$data[$key]['CATCHALL'] = '/dev/null';
+			}
+		?>
+		<div class="l-unit <?php if ($status == 'suspended') echo 'l-unit--suspended'; if($_SESSION['favourites']['MAIL'][$key] == 1) echo ' l-unit--starred'; ?> animated fadeIn" v_unit_id="<?=$key?>" v_section="mail"
+			sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>" sort-name="<?=$key?>" sort-disk="<?=$data[$key]['U_DISK']?>"
+			sort-accounts="<?=$data[$key]['ACCOUNTS']?>" sort-star="<?php if ($_SESSION['favourites']['MAIL'][$key] == 1) echo " 1"; else echo "0" ; ?>">
+			<div class="l-unit__col l-unit__col--right">
+				<div>
+					<div class="clearfix l-unit__stat-col--left super-compact">
+						<input id="check<?=$i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select');?>" name="domain[]" value="<?=$key?>" <?=$display_mode;?>>
+					</div>
+					<div class="clearfix l-unit__stat-col--left wide-3 truncate"><b><a href="?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('mail accounts');?>: <?=$key?>"><?=$key?></a></b></div>
+					<!-- START QUICK ACTION TOOLBAR AREA -->
+					<div class="clearfix l-unit__stat-col--left text-right compact-5">
+						<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+							<div class="actions-panel clearfix">
+								<?php if ($read_only === 'true') {?>
+									<!-- Restrict ability to edit, delete, or suspend domain items when impersonating 'admin' account -->
+									<div class="actions-panel__col actions-panel__edit shortcut-l" key-action="href"><a href="?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('mail accounts');?>"><i class="fas fa-users status-icon blue status-icon dim"></i></a></div>
+									<div class="actions-panel__col actions-panel__edit shortcut-l" key-action="href"><a href="?domain=<?=$key?>&dns=1&token=<?=$_SESSION['token']?>" title="<?=_('DNS records mail');?>"><i class="fas fa-atlas status-icon blue status-icon dim"></i></a></div>
+									<?php if ($data[$key]['SUSPENDED'] == 'no') {?>
+										<div class="actions-panel__col actions-panel__edit" key-action="href"><a href="http://<?=$webmail;?>.<?=$key?>/" target="_blank" title="<?=_('open webmail');?>"><i class="fas fa-paper-plane status-icon lightblue status-icon dim"></i></a></div>
+									<?php } ?>
+								<?php } else { ?>
+									<?php if ($data[$key]['SUSPENDED'] == 'no') {?>
+										<div class="actions-panel__col actions-panel__logs shortcut-n" key-action="href"><a href="/add/mail/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Add Mail Account');?>"><i class="fas fa-plus-circle status-icon green status-icon dim"></i></a></div>
+										<?php if($_SESSION['WEBMAIL_SYSTEM']){?>
+											<?php if (!empty($data[$key]['WEBMAIL'])) {?>
+												<div class="actions-panel__col actions-panel__edit" key-action="href"><a href="http://<?=$webmail;?>.<?=$key?>/" target="_blank" title="<?=_('open webmail');?>"><i class="fas fa-paper-plane status-icon lightblue status-icon dim"></i></a></div>
+											<?php } ?>
+										<?php } ?>
+										<div class="actions-panel__col actions-panel__logs shortcut-enter" key-action="href"><a href="/edit/mail/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Mail Domain');?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
+									<?php } ?>
+									<div class="actions-panel__col actions-panel__edit shortcut-l" key-action="href"><a href="?domain=<?=$key?>&dns=1&token=<?=$_SESSION['token']?>" title="<?=_('DNS records');?>"><i class="fas fa-atlas status-icon blue status-icon dim"></i></a></div>
+									<div class="actions-panel__col actions-panel__suspend shortcut-s" key-action="js">
+										<a id="<?=$spnd_action ?>_link_<?=$i?>" class="data-controls do_<?=$spnd_action?>" title="<?=_($spnd_action)?>">
+											<i class="fas <?=$spnd_icon?> status-icon highlight status-icon dim do_<?=$spnd_action?>"></i>
+											<input type="hidden" name="<?=$spnd_action?>_url" value="/<?=$spnd_action?>/mail/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" />
+											<div id="<?=$spnd_action?>_dialog_<?=$i?>" class="confirmation-text-suspention hidden" title="<?=_('Confirmation');?>">
+												<p class="confirmation"><?=sprintf($spnd_confirmation,$key)?></p>
+											</div>
+										</a>
+									</div>
+									<div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
+										<a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete');?>">
+											<i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
+											<input type="hidden" name="delete_url" value="/delete/mail/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" />
+											<div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation');?>">
+												<p class="confirmation"><?=sprintf(_('DELETE_DOMAIN_CONFIRMATION'),$key)?></p>
+											</div>
+										</a>
+									</div>
+								<?php } ?>
+							</div>
+						</div>
+					</div>
+					<!-- END QUICK ACTION TOOLBAR AREA -->
+					<div class="clearfix l-unit__stat-col--left text-center compact-2"><b>
+							<?php 
+								if ($data[$key]['ACCOUNTS']) { 
+									$mail_accounts = htmlentities($data[$key]['ACCOUNTS']);
+								} else {
+									$mail_accounts = '0'; 
+								}
+							?>
+							<span><?=$mail_accounts;?></span>
+						</b>
+					</div>
+					<div class="clearfix l-unit__stat-col--left text-center compact-2"><b>
+							<?=humanize_usage_size($data[$key]['U_DISK'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['U_DISK'])?></span>
+					</div>
+					<div class="clearfix l-unit__stat-col--left text-center compact-3">
+						<i class="fas <?=$antivirus_icon;?>"></i>
+					</div>
+					<div class="clearfix l-unit__stat-col--left text-center compact-3">
+						<i class="fas <?=$antispam_icon;?>"></i>
+					</div>
+					<div class="clearfix l-unit__stat-col--left text-center compact-3">
+						<i class="fas <?=$dkim_icon;?>"></i>
+					</div>
+					<div class="clearfix l-unit__stat-col--left text-center compact-3">
+						<i class="fas <?=$ssl_icon;?>"></i>
+					</div>
+				</div>
+			</div>
+		</div>
+	<?php } ?>
+</div>
 
-        foreach ($data as $key => $value) {
-          ++$i;
-          if ($data[$key]['SUSPENDED'] == 'yes') {
-            $status = 'suspended';
-            $spnd_action = 'unsuspend';
-            $spnd_icon = 'fa-play';
-            $spnd_confirmation = _('UNSUSPEND_DOMAIN_CONFIRMATION');
-          } else {
-            $status = 'active';
-            $spnd_action = 'suspend';
-            $spnd_icon = 'fa-pause';
-            $spnd_confirmation = _('SUSPEND_DOMAIN_CONFIRMATION');
-          }
-          if (empty($data[$key]['CATCHALL'])) {
-            $data[$key]['CATCHALL'] = '/dev/null';
-          }
-      ?>
-
-
-      <div class="l-unit <? if($status == 'suspended') echo 'l-unit--suspended'; if($_SESSION['favourites']['MAIL'][$key] == 1) echo ' l-unit--starred'; ?> animated fadeIn" v_unit_id="<?=$key?>" v_section="mail"
-sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>" sort-name="<?=$key?>" sort-disk="<?=$data[$key]['U_DISK']?>"
-sort-accounts="<?=$data[$key]['ACCOUNTS']?>" sort-star="<? if($_SESSION['favourites']['MAIL'][$key] == 1) echo "1"; else echo "0"; ?>">
-            <div class="l-unit__col l-unit__col--right">
-              <div>
-                  <div class="clearfix l-unit__stat-col--left super-compact">
-                    <input id="check<?php echo $i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select')?>" name="domain[]" value="<?php echo $key ?>" <?=$display_mode;?>>
-                  </div>
-                  <div class="clearfix l-unit__stat-col--left wide-3 truncate"><b><a href="?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('mail accounts')?>: <?=$key?>"><?=$key?></a></b></div>
-                  <!-- START QUICK ACTION TOOLBAR AREA -->
-                  <div class="clearfix l-unit__stat-col--left text-right compact-5">
-                      <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-                          <div class="actions-panel clearfix">
-                            <? if ($read_only === 'true') {?>
-                              <!-- Restrict ability to edit, delete, or suspend domain items when impersonating 'admin' account -->
-                              <div class="actions-panel__col actions-panel__edit shortcut-l" key-action="href"><a href="?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('mail accounts')?>"><i class="fas fa-users status-icon blue status-icon dim"></i></a></div>
-                              <div class="actions-panel__col actions-panel__edit shortcut-l" key-action="href"><a href="?domain=<?=$key?>&dns=1&token=<?=$_SESSION['token']?>" title="<?=_('DNS records mail')?>"><i class="fas fa-atlas status-icon blue status-icon dim"></i></a></div>
-                              <? if ($data[$key]['SUSPENDED'] == 'no') {?>
-                                <div class="actions-panel__col actions-panel__edit" key-action="href"><a href="http://<?=$webmail;?>.<?=$key?>/" target="_blank" title="<?=_('open webmail')?>"><i class="fas fa-paper-plane status-icon lightblue status-icon dim"></i></a></div>
-                              <? } ?>
-                            <? } else { ?>
-                              <? if ($data[$key]['SUSPENDED'] == 'no') {?>
-                                <div class="actions-panel__col actions-panel__logs shortcut-n" key-action="href"><a href="/add/mail/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Add Mail Account')?>"><i class="fas fa-plus-circle status-icon green status-icon dim"></i></a></div>
-                                <?php if($_SESSION['WEBMAIL_SYSTEM']){?>
-                                  <? if (!empty($data[$key]['WEBMAIL'])) {?>
-                                    <div class="actions-panel__col actions-panel__edit" key-action="href"><a href="http://<?=$webmail;?>.<?=$key?>/" target="_blank" title="<?=_('open webmail')?>"><i class="fas fa-paper-plane status-icon lightblue status-icon dim"></i></a></div>
-                                  <? } ?>
-                                <? } ?>
-                                <div class="actions-panel__col actions-panel__logs shortcut-enter" key-action="href"><a href="/edit/mail/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Mail Domain')?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
-                              <? } ?>
-                              <div class="actions-panel__col actions-panel__edit shortcut-l" key-action="href"><a href="?domain=<?=$key?>&dns=1&token=<?=$_SESSION['token']?>" title="<?=_('DNS records')?>"><i class="fas fa-atlas status-icon blue status-icon dim"></i></a></div>
-                              <div class="actions-panel__col actions-panel__suspend shortcut-s" key-action="js">
-                                <a id="<?=$spnd_action ?>_link_<?=$i?>" class="data-controls do_<?=$spnd_action?>" title="<?=_($spnd_action)?>">
-                                  <i class="fas <?=$spnd_icon?> status-icon highlight status-icon dim do_<?=$spnd_action?>"></i>
-                                  <input type="hidden" name="<?=$spnd_action?>_url" value="/<?=$spnd_action?>/mail/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" />
-                                  <div id="<?=$spnd_action?>_dialog_<?=$i?>" class="confirmation-text-suspention hidden" title="<?=_('Confirmation')?>">
-                                    <p class="confirmation"><?=sprintf($spnd_confirmation,$key)?></p>
-                                  </div>
-                                </a>
-                              </div>
-                              <div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
-                                <a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete')?>">
-                                  <i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
-                                  <input type="hidden" name="delete_url" value="/delete/mail/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" />
-                                  <div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
-                                    <p class="confirmation"><?=sprintf(_('DELETE_DOMAIN_CONFIRMATION'),$key)?></p>
-                                  </div>
-                                </a>
-                              </div>
-                            <? } ?>                          
-                          </div>
-                        </div>
-                  </div>
-                  <!-- END QUICK ACTION TOOLBAR AREA -->
-                  <div class="clearfix l-unit__stat-col--left text-center compact-2"><b>
-                    <? if($data[$key]['ACCOUNTS']) { echo '<span>'.$data[$key]['ACCOUNTS'].'</span>'; ?>
-                    <? } else {?>
-                      <span>0</span>
-                    <? } ?>
-                    </b>
-                  </div>
-                  <div class="clearfix l-unit__stat-col--left text-center compact-2"><b>
-                    <?=humanize_usage_size($data[$key]['U_DISK'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['U_DISK'])?></span>
-                  </div>
-                  <div class="clearfix l-unit__stat-col--left text-center compact-3"><b>
-                      <? if($data[$key]['SUSPENDED'] == 'no'){ ?>
-                        <? if($data[$key]['ANTIVIRUS'] == 'no'){ ?>
-                          <i class="fas fa-times-circle status-icon red"></i>
-                        <? } else {?>
-                          <i class="fas fa-check-circle status-icon green"></i>
-                        <? } ?>
-                      <? } else {?>
-                        <? if($data[$key]['ANTIVIRUS'] == 'no'){ ?>
-                          <i class="fas fa-times-circle"></i>
-                        <? } else {?>
-                          <i class="fas fa-check-circle"></i>
-                        <? } ?>
-                      <? } ?>
-                    </b>
-                  </div>
-                  <div class="clearfix l-unit__stat-col--left text-center compact-3"><b>
-                      <? if($data[$key]['SUSPENDED'] == 'no'){ ?>
-                        <? if($data[$key]['ANTISPAM'] == 'no'){ ?>
-                          <i class="fas fa-times-circle status-icon red"></i>
-                        <? } else {?>
-                          <i class="fas fa-check-circle status-icon green"></i>
-                        <? } ?>
-                      <? } else {?>
-                        <? if($data[$key]['ANTISPAM'] == 'no'){ ?>
-                          <i class="fas fa-times-circle"></i>
-                        <? } else {?>
-                          <i class="fas fa-check-circle"></i>
-                        <? } ?>
-                      <? } ?>
-                    </b>
-                  </div>
-                  <div class="clearfix l-unit__stat-col--left text-center compact-3"><b>
-                      <? if($data[$key]['SUSPENDED'] == 'no'){ ?>
-                        <? if($data[$key]['DKIM'] == 'no'){ ?>
-                          <i class="fas fa-times-circle status-icon red"></i>
-                        <? } else {?>
-                          <i class="fas fa-check-circle status-icon green"></i>
-                        <? } ?>
-                      <? } else {?>
-                        <? if($data[$key]['DKIM'] == 'no'){ ?>
-                          <i class="fas fa-times-circle"></i>
-                        <? } else {?>
-                          <i class="fas fa-check-circle"></i>
-                        <? } ?>
-                      <? } ?>
-                    </b>
-                  </div>
-                  <div class="clearfix l-unit__stat-col--left text-center compact-3"><b>
-                      <? if($data[$key]['SUSPENDED'] == 'no'){ ?>
-                        <? if($data[$key]['SSL'] == 'no'){ ?>
-                          <i class="fas fa-times-circle status-icon red"></i>
-                        <? } else {?>
-                          <i class="fas fa-check-circle status-icon green"></i>
-                        <? } ?>
-                      <? } else {?>
-                        <? if($data[$key]['SSL'] == 'no'){ ?>
-                          <i class="fas fa-times-circle"></i>
-                        <? } else {?>
-                          <i class="fas fa-check-circle"></i>
-                        <? } ?>
-                      <? } ?>
-                    </b>
-                  </div>
-              </div>
-            </div>
-      </div>
-      <?}?>
-    </div>
-
-
-    <div id="vstobjects">
-      <div class="l-separator"></div>
-      <div class="l-center">
-        <div class="l-unit-ft">
-          <table class='data'></table>
-          <div class="data-count l-unit__col l-unit__col--right clearfix">
-              <?php
-                 printf(ngettext('%d mail domain', '%d mail domains', $i),$i);
-              ?>
-          </div>
-        </div>
-      </div>
-    </div>
+<div id="vstobjects">
+	<div class="l-separator"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right clearfix">
+				<?php printf(ngettext('%d mail domain', '%d mail domains', $i),$i); ?>
+			</div>
+		</div>
+	</div>
+</div>

+ 209 - 222
web/templates/pages/list_mail_acc.html

@@ -1,229 +1,216 @@
 <?php
-    $v_webmail_alias = "webmail";
-    if (!empty($_SESSION['WEBMAIL_ALIAS'])) $v_webmail_alias = $_SESSION['WEBMAIL_ALIAS'];
+	$v_webmail_alias = "webmail";
+	if (!empty($_SESSION['WEBMAIL_ALIAS'])) $v_webmail_alias = $_SESSION['WEBMAIL_ALIAS'];
 ?>
-    <div class="l-center">
-      <div class="l-sort clearfix noselect">
-        <div class="l-unit-toolbar__buttonstrip">
-          <a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/mail/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-          <? if ($read_only === 'true') {?>
-            <!-- Hide item creation button when impersonating 'admin' account -->
-          <? } else { ?>
-            <a href="/add/mail/?domain=<?=htmlentities($_GET['domain'])?>" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add Mail Account')?></a>
-            <a href="/edit/mail/?domain=<?=htmlentities($_GET['domain'])?>" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-pencil-alt status-icon blue"></i><?=_('Editing Mail Domain')?></a>
-          <? } ?>
-        </div>
-        <ul class="context-menu sort-order animated fadeIn" style="display:none;">
-          <li entity="sort-date" sort_as_int="1"><span class="name <? if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-disk" sort_as_int="1"><span class="name"><?=_('Disk')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-name"><span class="name <? if ($_SESSION['userSortOrder'] === 'name') { echo 'active'; } ?>"><?=_('Name')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-quota" sort_as_int="1"><span class="name"><?=_('Quota')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-        </ul>
-        <div class="l-sort-toolbar clearfix">
-          <table>
-            <tr>
-              <td class="sort-by" title="<?=_('Sort items');?>">
-                <?=_('sort by');?>: <span>
-                  <b>
-                    <? if ($_SESSION['userSortOrder'] === 'name') { $label = 'Name'; } else { $label = 'Date'; } ?>
-                    <?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
-                  </b>
-                </span>
-              </td>
-              <td class="l-sort-toolbar__search-box">
-                <form action="/search/" method="get">
-                  <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                  <input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search')?>" />
-                  <button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search')?>"><i class="fas fa-search"></i></button>
-                </form>
-              </td>
-              <? if ($read_only === 'true') {?>
-                <!-- Hide bulk actions for domain items when impersonating 'admin' account-->
-              <? } else { ?>
-                <td>
-                  <form action="/bulk/mail/" method="post" id="objects">
-                  <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                  <div class="l-select">
-                    <select name="action" id="">
-                      <option value=""><?=_('apply to selected')?></option>
-                      <option value="suspend"><?=_('suspend')?></option>
-                      <option value="unsuspend"><?=_('unsuspend')?></option>
-                      <option value="delete"><?=_('delete')?></option>
-                    </select>
-                  </div>
-                  <button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected')?>"><i class="fas fa-arrow-right"></i></button>
-                  </form>
-                </td>
-              <? } ?>
-            </tr>
-          </table>
-        </div>
-      </div>
-    </div>
+<!-- Begin toolbar -->
+<div class="l-center">
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/mail/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+			<?php if ($read_only !== 'true') { ?>
+				<a href="/add/mail/?domain=<?=htmlentities($_GET['domain'])?>" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add Mail Account');?></a>
+				<a href="/edit/mail/?domain=<?=htmlentities($_GET['domain'])?>" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-pencil-alt status-icon blue"></i><?=_('Editing Mail Domain');?></a>
+			<?php } ?>
+		</div>
+		<ul class="context-menu sort-order animated fadeIn" style="display:none;">
+			<li entity="sort-date" sort_as_int="1"><span class="name <?php if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-disk" sort_as_int="1"><span class="name"><?=_('Disk');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-name"><span class="name <?php if ($_SESSION['userSortOrder'] === 'name') { echo 'active'; } ?>"><?=_('Name');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-quota" sort_as_int="1"><span class="name"><?=_('Quota');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+		</ul>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td class="sort-by" title="<?=_('Sort items');?>">
+						<?=_('sort by');?>: <span>
+							<b>
+								<?php if ($_SESSION['userSortOrder'] === 'name') { $label = 'Name'; } else { $label = 'Date'; } ?>
+								<?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
+							</b>
+						</span>
+					</td>
+					<td class="l-sort-toolbar__search-box">
+						<form action="/search/" method="get">
+							<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+							<input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search');?>" />
+							<button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search');?>"><i class="fas fa-search"></i></button>
+						</form>
+					</td>
+					<?php if ($read_only !== 'true') { ?>
+						<td>
+							<form action="/bulk/mail/" method="post" id="objects">
+								<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+								<div class="l-select">
+									<select name="action" id="">
+										<option value=""><?=_('apply to selected');?></option>
+										<option value="suspend"><?=_('suspend');?></option>
+										<option value="unsuspend"><?=_('unsuspend');?></option>
+										<option value="delete"><?=_('delete');?></option>
+									</select>
+								</div>
+								<button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected');?>"><i class="fas fa-arrow-right"></i></button>
+							</form>
+						</td>
+					<?php } ?>
+				</tr>
+			</table>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center units">
-        <div class="header table-header">     
-            <div class="l-unit__col l-unit__col--right">
-              <div>
-                  <div class="clearfix l-unit__stat-col--left super-compact">
-                      <input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all')?>" onChange="checkedAll('objects');" <?=$display_mode;?>>
-                  </div>
-                  <div class="clearfix l-unit__stat-col--left wide-3"><b><?php print _('Name');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-right compact-4"><b>&nbsp;</b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center compact"><b><?php print _('Disk');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Quota');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Aliases');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Forwarding');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Autoreply');?></b></div>
-              </div>
-            </div>
-          </div>
+<div class="l-center units">
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div>
+				<div class="clearfix l-unit__stat-col--left super-compact">
+					<input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all');?>" onChange="checkedAll('objects');" <?=$display_mode;?>>
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide-3"><b><?=_('Name');?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-right compact-4"><b>&nbsp;</b></div>
+				<div class="clearfix l-unit__stat-col--left text-center compact"><b><?=_('Disk');?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Quota');?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Aliases');?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Forwarding');?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Autoreply');?></b></div>
+			</div>
+		</div>
+	</div>
 
-      <?
-        foreach ($data as $key => $value) {
-          ++$i;
-          if ($data[$key]['SUSPENDED'] == 'yes') {
-            $status = 'suspended';
-            $spnd_action = 'unsuspend';
-            $spnd_icon = 'fa-play';
-            $spnd_confirmation = _('UNSUSPEND_MAIL_ACCOUNT_CONFIRMATION');
-          } else {
-            $status = 'active';
-            $spnd_action = 'suspend';
-            $spnd_icon = 'fa-pause';
-            $spnd_confirmation = _('SUSPEND_MAIL_ACCOUNT_CONFIRMATION');
-          }
-      ?>
+	<!-- Begin mail account list item loop -->
+	<?php
+		foreach ($data as $key => $value) {
+			++$i;
+			if ($data[$key]['SUSPENDED'] == 'yes') {
+				$status = 'suspended';
+				$spnd_action = 'unsuspend';
+				$spnd_icon = 'fa-play';
+				$spnd_confirmation = _('UNSUSPEND_MAIL_ACCOUNT_CONFIRMATION');
+				if ($data[$key]['ALIAS'] == '') {
+					$alias_icon = 'fa-minus-circle';
+				} else {
+					$alias_icon = 'fa-check-circle';
+				}
+				if ($data[$key]['FWD'] == '') {
+					$fwd_icon = 'fa-minus-circle';
+				} else {
+					$fwd_icon = 'fa-check-circle';
+				}
+				if ($data[$key]['AUTOREPLY'] == 'no') {
+					$autoreply_icon = 'fa-minus-circle';
+				} else {
+					$autoreply_icon = 'fa-check-circle';
+				}
+			} else {
+				$status = 'active';
+				$spnd_action = 'suspend';
+				$spnd_icon = 'fa-pause';
+				$spnd_confirmation = _('SUSPEND_MAIL_ACCOUNT_CONFIRMATION');
+				if ($data[$key]['ALIAS'] == '') {
+					$alias_icon = 'fa-minus-circle';
+				} else {
+					$alias_icon = 'fa-check-circle status-icon green';
+				}
+				if ($data[$key]['FWD'] == '') {
+					$fwd_icon = 'fa-minus-circle';
+				} else {
+					$fwd_icon = 'fa-check-circle status-icon green';
+				}
+				if ($data[$key]['AUTOREPLY'] == 'no') {
+					$autoreply_icon = 'fa-minus-circle';
+				} else {
+					$autoreply_icon = 'fa-check-circle status-icon green';
+				}
+			}
+		?>
+		<div class="l-unit <?php if ($status == 'suspended') echo 'l-unit--suspended'; if($_SESSION['favourites']['MAIL_ACC'][$key." @".$_GET['domain']]==1) echo ' l-unit--starred' ; ?> animated fadeIn"
+			v_unit_id="<?=$key."@".$_GET['domain']?>" v_section="mail_acc" sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>" sort-name="<?=$key?>" sort-disk="<?=$data[$key]['U_DISK']?>"
+			sort-quota="<?=$data[$key]['QUOTA']?>" sort-star="
+			<?php if ($_SESSION['favourites']['MAIL_ACC'][$key."@".$_GET['domain']] == 1) echo '1'; else echo '0'; ?>">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left super-compact">
+					<input id="check<?=$i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select');?>" name="account[]" value="<?=$key?>" <?=$display_mode;?>>
+					<input type="hidden" value="<?=$_GET['domain'] ?>" name="domain" />
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide-3 truncate">
+					<?php if (($read_only === 'true') || ($data[$key]['SUSPENDED'] == 'yes')) { ?>
+						<b><?=$key."@".$_GET['domain']?></b>
+					<?php } else { ?>
+						<b><a href="/edit/mail/?domain=<?=htmlspecialchars($_GET['domain'])?>&account=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Mail Account');?>: <?=$key?>@<?=htmlspecialchars($_GET['domain'])?>"><?=$key."@".$_GET['domain']?></a></b>
+					<?php } ?>
+				</div>
+				<!-- START QUICK ACTION TOOLBAR AREA -->
+				<div class="clearfix l-unit__stat-col--left text-right compact-4">
+					<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+						<div class="actions-panel clearfix">
+							<?php if ($read_only === 'true') { ?>
+								<!-- Restrict the ability to edit, delete, or suspend domain items when impersonating 'admin' account -->
+								<?php if ($data[$key]['SUSPENDED'] == 'yes') { ?>
+									&nbsp;
+								<?php } else { ?>
+									<div class="actions-panel__col actions-panel__edit" key-action="href"><a href="http://<?=$v_webmail_alias;?>.<?=htmlspecialchars($_GET['domain'])?>/?_user=<?=$key?>@<?=htmlspecialchars($_GET['domain'])?>" target="_blank" title="<?=_('open webmail');?>"><i class="fas fa-envelope-open-text status-icon maroon status-icon dim"></i></a></div>
+								<?php } ?>
+							<?php } else { ?>
+								<?php if ($data[$key]['SUSPENDED'] == 'no') { ?>
+									<?php if($_SESSION['WEBMAIL_SYSTEM']){?>
+										<?php if (!empty($data[$key]['WEBMAIL'])) { ?>
+											<div class="actions-panel__col actions-panel__edit" key-action="href"><a href="http://<?=$v_webmail_alias;?>.<?=htmlspecialchars($_GET['domain'])?>/?_user=<?=$key?>@<?=htmlspecialchars($_GET['domain'])?>" target="_blank" title="<?=_('open webmail');?>"><i class="fas fa-envelope-open-text status-icon maroon status-icon dim"></i></a></div>
+										<?php } ?>
+									<?php } ?>
+								<div class="actions-panel__col actions-panel__logs shortcut-enter" key-action="href"><a href="/edit/mail/?domain=<?=htmlspecialchars($_GET['domain'])?>&account=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Mail Account');?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
+								<?php } ?>
+								<div class="actions-panel__col actions-panel__suspend shortcut-s" key-action="js">
+									<a id="<?=$spnd_action ?>_link_<?=$i?>" class="data-controls do_<?=$spnd_action?>" title="<?=_($spnd_action)?>">
+										<i class="fas <?=$spnd_icon?> status-icon highlight status-icon dim do_<?=$spnd_action?>"></i>
+										<input type="hidden" name="<?=$spnd_action?>_url" value="/<?=$spnd_action?>/mail/?domain=<?=htmlspecialchars($_GET['domain'])?>&account=<?=$key?>&token=<?=$_SESSION['token']?>" />
+										<div id="<?=$spnd_action?>_dialog_<?=$i?>" class="confirmation-text-suspention hidden" title="<?=_('Confirmation');?>">
+											<p class="confirmation"><?=sprintf($spnd_confirmation,$key)?></p>
+										</div>
+									</a>
+								</div>
+								<div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
+									<a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete');?>">
+										<i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
+										<input type="hidden" name="delete_url" value="/delete/mail/?domain=<?=htmlspecialchars($_GET['domain'])?>&account=<?=$key?>&token=<?=$_SESSION['token']?>" />
+										<div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation');?>">
+											<p class="confirmation"><?=sprintf(_('DELETE_MAIL_ACCOUNT_CONFIRMATION'),$key)?></p>
+										</div>
+									</a>
+								</div>
+							<?php } ?>
+						</div>
+					</div>
+					<!-- END QUICK ACTION TOOLBAR AREA -->
+				</div>
 
+				<div class="clearfix l-unit__stat-col--left text-center compact"><b><?=humanize_usage_size($data[$key]['U_DISK'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['U_DISK'])?></span></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=_(humanize_usage_size($data[$key]['QUOTA'])) ?></b> <span class="text-small"><?=_(humanize_usage_measure($data[$key]['QUOTA'])) ?></span></div>
+				<div class="clearfix l-unit__stat-col--left text-center">
+					<i class="fas <?=$alias_icon;?>"></i>
+				</div>
+				<div class="clearfix l-unit__stat-col--left text-center">
+					<i class="fas <?=$fwd_icon;?>"></i>
+				</div>
+				<div class="clearfix l-unit__stat-col--left text-center">
+					<i class="fas <?=$autoreply_icon;?>"></i>
+				</div>
+			</div>
+		</div>
+	<?php } ?>
+</div>
 
-      <div class="l-unit <? if($status == 'suspended') echo 'l-unit--suspended'; if($_SESSION['favourites']['MAIL_ACC'][$key."@".$_GET['domain']] == 1) echo ' l-unit--starred'; ?> animated fadeIn"
- v_unit_id="<?=$key."@".$_GET['domain']?>" v_section="mail_acc" sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>" sort-name="<?=$key?>" sort-disk="<?=$data[$key]['U_DISK']?>"
- sort-quota="<?=$data[$key]['QUOTA']?>" sort-star="<? if($_SESSION['favourites']['MAIL_ACC'][$key."@".$_GET['domain']] == 1) echo '1'; else echo '0'; ?>">
-            <div class="l-unit__col l-unit__col--right">
-              <div class="clearfix l-unit__stat-col--left super-compact">
-                <input id="check<?php echo $i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select')?>" name="account[]" value="<?php echo $key ?>" <?=$display_mode;?>>
-                <input type="hidden" value="<?php echo $_GET['domain'] ?>" name="domain" />
-              </div>
-              <div class="clearfix l-unit__stat-col--left wide-3 truncate">
-                <? if (($read_only === 'true') || ($data[$key]['SUSPENDED'] == 'yes')) {?>
-                  <b><?=$key."@".$_GET['domain']?></b>
-                <? } else { ?>
-                  <b><a href="/edit/mail/?domain=<?=htmlspecialchars($_GET['domain'])?>&account=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Mail Account')?>: <?=$key?>@<?=htmlspecialchars($_GET['domain'])?>"><?=$key."@".$_GET['domain']?></a></b>
-                <? } ?>
-              </div>
-              <!-- START QUICK ACTION TOOLBAR AREA -->
-              <div class="clearfix l-unit__stat-col--left text-right compact-4">
-                <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-                  <div class="actions-panel clearfix">
-                    <? if ($read_only === 'true') {?>
-                      <!-- Restrict the ability to edit, delete, or suspend domain items when impersonating 'admin' account -->
-                      <? if ($data[$key]['SUSPENDED'] == 'yes') {?>
-                        &nbsp;
-                      <? } else { ?>
-                        <div class="actions-panel__col actions-panel__edit" key-action="href"><a href="http://<?=$v_webmail_alias;?>.<?=htmlspecialchars($_GET['domain'])?>/?_user=<?=$key?>@<?=htmlspecialchars($_GET['domain'])?>" target="_blank" title="<?=_('open webmail')?>"><i class="fas fa-envelope-open-text status-icon maroon status-icon dim"></i></a></div>
-                      <? } ?>
-                    <? } else { ?>
-                      <? if ($data[$key]['SUSPENDED'] == 'no') {?>
-                        <?php if($_SESSION['WEBMAIL_SYSTEM']){?>
-                          <? if (!empty($data[$key]['WEBMAIL'])) {?>
-                            <div class="actions-panel__col actions-panel__edit" key-action="href"><a href="http://<?=$v_webmail_alias;?>.<?=htmlspecialchars($_GET['domain'])?>/?_user=<?=$key?>@<?=htmlspecialchars($_GET['domain'])?>" target="_blank" title="<?=_('open webmail')?>"><i class="fas fa-envelope-open-text status-icon maroon status-icon dim"></i></a></div>
-                          <? } ?>
-                        <? } ?>
-                        <div class="actions-panel__col actions-panel__logs shortcut-enter" key-action="href"><a href="/edit/mail/?domain=<?=htmlspecialchars($_GET['domain'])?>&account=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Mail Account')?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
-                      <? } ?>
-                      <div class="actions-panel__col actions-panel__suspend shortcut-s" key-action="js">
-                        <a id="<?=$spnd_action ?>_link_<?=$i?>" class="data-controls do_<?=$spnd_action?>" title="<?=_($spnd_action)?>">
-                          <i class="fas <?=$spnd_icon?> status-icon highlight status-icon dim do_<?=$spnd_action?>"></i>
-                          <input type="hidden" name="<?=$spnd_action?>_url" value="/<?=$spnd_action?>/mail/?domain=<?=htmlspecialchars($_GET['domain'])?>&account=<?php echo $key ?>&token=<?=$_SESSION['token']?>" />
-                          <div id="<?=$spnd_action?>_dialog_<?=$i?>" class="confirmation-text-suspention hidden" title="<?=_('Confirmation')?>">
-                            <p class="confirmation"><?=sprintf($spnd_confirmation,$key)?></p>
-                          </div>
-                        </a>
-                      </div>
-                      <div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
-                        <a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete')?>">
-                          <i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
-                          <input type="hidden" name="delete_url" value="/delete/mail/?domain=<?=htmlspecialchars($_GET['domain'])?>&account=<?=$key?>&token=<?=$_SESSION['token']?>" />
-                          <div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
-                            <p class="confirmation"><?=sprintf(_('DELETE_MAIL_ACCOUNT_CONFIRMATION'),$key)?></p>
-                          </div>
-                        </a>
-                      </div>
-                    <? } ?>
-                  </div>
-            </div>
-              <!-- END QUICK ACTION TOOLBAR AREA -->
-            </div>
-            
-            <div class="clearfix l-unit__stat-col--left text-center compact"><b><?=humanize_usage_size($data[$key]['U_DISK'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['U_DISK'])?></span></div>
-            <div class="clearfix l-unit__stat-col--left text-center"><b><?=_(humanize_usage_size($data[$key]['QUOTA'])) ?></b> <span class="text-small"><?=_(humanize_usage_measure($data[$key]['QUOTA'])) ?></span></div>
-            <div class="clearfix l-unit__stat-col--left text-center"><b>
-                      <? if($data[$key]['SUSPENDED'] == 'no'){ ?>
-                          <? if($data[$key]['ALIAS'] == ''){ ?>
-                            <i class="fas fa-minus-circle"></i>
-                          <? } else {?>
-                            <i class="fas fa-check-circle status-icon green"></i>
-                          <? } ?>
-                      <? } else {?>
-                        <? if($data[$key]['ALIAS'] == ''){ ?>
-                          <i class="fas fa-minus-circle"></i>
-                        <? } else {?>
-                          <i class="fas fa-check-circle"></i>
-                        <? } ?>
-                      <? } ?>
-                    </b>
-              </div>
-              <div class="clearfix l-unit__stat-col--left text-center"><b>
-                      <? if($data[$key]['SUSPENDED'] == 'no'){ ?>
-                          <? if($data[$key]['FWD'] == ''){ ?>
-                            <i class="fas fa-minus-circle"></i>
-                          <? } else {?>
-                            <i class="fas fa-check-circle status-icon green"></i>
-                          <? } ?>
-                      <? } else {?>
-                          <? if($data[$key]['FWD'] == ''){ ?>
-                            <i class="fas fa-minus-circle"></i>
-                          <? } else {?>
-                            <i class="fas fa-check-circle"></i>
-                          <? } ?>
-                       <? } ?>
-                    </b>
-                </div>
-                <div class="clearfix l-unit__stat-col--left text-center"><b>
-                      <? if($data[$key]['SUSPENDED'] == 'no'){ ?>
-                          <? if($data[$key]['AUTOREPLY'] == 'no'){ ?>
-                            <i class="fas fa-minus-circle"></i>
-                          <? } else {?>
-                            <i class="fas fa-check-circle status-icon green"></i>
-                          <? } ?>
-                      <? } else {?>
-                          <? if($data[$key]['AUTOREPLY'] == 'no'){ ?>
-                            <i class="fas fa-minus-circle"></i>
-                          <? } else {?>
-                            <i class="fas fa-check-circle"></i>
-                          <? } ?>
-                          <? } ?>
-                    </b>
-                </div>
-            </div>
-      </div>
-      <?}?>
-    </div>
-
-    <div id="vstobjects">
-      <div class="l-separator"></div>
-      <div class="l-center">
-        <div class="l-unit-ft">
-          <table class='data'></table>
-          <div class="data-count l-unit__col l-unit__col--right clearfix">
-            <?php
-               printf(ngettext('%d mail account', '%d mail accounts', $i),$i);
-            ?>
-          </div>
-          <div class="data-count l-unit__col l-unit__col--right back clearfix">
-          </div>
-        </div>
-      </div>
-    </div>
+<div id="vstobjects">
+	<div class="l-separator"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right clearfix">
+				<?php printf(ngettext('%d mail account', '%d mail accounts', $i),$i); ?>
+			</div>
+			<div class="data-count l-unit__col l-unit__col--right back clearfix">
+			</div>
+		</div>
+	</div>
+</div>

+ 78 - 86
web/templates/pages/list_mail_dns.html

@@ -1,96 +1,88 @@
 <?php
-$v_webmail_alias = "webmail";
-if (!empty($_SESSION['WEBMAIL_ALIAS'])) $v_webmail_alias = $_SESSION['WEBMAIL_ALIAS'];
+	$v_webmail_alias = "webmail";
+	if (!empty($_SESSION['WEBMAIL_ALIAS'])) $v_webmail_alias = $_SESSION['WEBMAIL_ALIAS'];
 ?>
 <div class="l-center">
-  <div class="l-sort clearfix noselect">
-    <div class="l-unit-toolbar__buttonstrip">
-      <a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/mail/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-    </div>
-    <div class="l-sort-toolbar clearfix">
-      <table>
-        <tr>
-          <td class="sort-by" title="<?=_('Sort items');?>">
-             
-          </td>
-          <td class="l-sort-toolbar__search-box">
-            
-          </td>
-          <td>
-    
-          </td>
-        </tr>
-      </table>
-    </div>
-  </div>
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/mail/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+		</div>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td></td>
+				</tr>
+			</table>
+		</div>
+	</div>
 </div>
 
 <div class="l-separator"></div>
 
 <div class="l-center units">
-    <div class="header table-header">     
-        <div class="l-unit__col l-unit__col--right">
-          <div>
-              <div class="clearfix l-unit__stat-col--left wide-3"><b><?php print _('Record');?></b></div>
-              <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Type');?></b></div>
-              <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Priority');?></b></div>
-              <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('TTL');?></b></div>
-              <div class="clearfix l-unit__stat-col--left wide-3"><b><?php print _('IP or Value');?></b></div>
-          </div>
-        </div>
-    </div>
-    
-    <div class="l-unit animated fadeIn">
-                    <div class="l-unit__col l-unit__col--right">
-                      <div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" style="width:200px !important;" value="mail.<?=htmlspecialchars($_GET['domain']);?>"/></b> </div>
-                    <div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>A</b></div>
-                    <div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>10</b></div>
-                    <div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>14400</b></div>
-                    <div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" value="<?php echo array_key_first($ips);?>"/></b></div>
-              </div>
-    </div>
-    <?php if($_SESSION['WEBMAIL_SYSTEM']){?>
-    <div class="l-unit animated fadeIn">
-                  <div class="l-unit__col l-unit__col--right">
-                    <div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" style="width:200px !important;" value="<?=$v_webmail_alias;?>.<?=htmlspecialchars($_GET['domain']);?>"/></b> </div>
-                  <div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>A</b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>&nbsp;</b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>14400</b></div>
-                  <div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" value="<?php echo array_key_first($ips);?>"/></b></div>
-            </div>
-    </div>
-    <?php } ?>
-    <div class="l-unit animated fadeIn">
-          <div class="l-unit__col l-unit__col--right">
-            <div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" style="width:200px !important;" value="@"/></b> </div>
-          <div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>TXT</b></div>
-          <div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>&nbsp;</b></div>
-          <div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>14400</b></div>
-          <div class="clearfix l-unit__stat-col--left  wide-3 "><b><input type="text" class="vst-input" value="<?php echo htmlspecialchars('"v=spf1 a mx ip4:'.array_key_first($ips).'; -all"');?>"/></b></div>
-          </div>
-    </div>
-<?php foreach($dkim as $key => $value){ ?>
-<div class="l-unit animated fadeIn">
-      <div class="l-unit__col l-unit__col--right">
-        <div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" style="width:200px !important;" value="<?=htmlspecialchars($key);?>"/></b></div>
-      <div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>TXT</b></div>
-      <div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>&nbsp;</b></div>
-      <div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>3600</b></div>
-      <div class="clearfix l-unit__stat-col--left  wide-3 "><b><input type="text" class="vst-input" value="<?=htmlspecialchars(str_replace("'",'"',$dkim[$key]['TXT']));?>"</b></div>
-      </div>
-</div>
-<?php } ?>
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div>
+				<div class="clearfix l-unit__stat-col--left wide-3"><b><?=_('Record');?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Type');?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Priority');?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('TTL');?></b></div>
+				<div class="clearfix l-unit__stat-col--left wide-3"><b><?=_('IP or Value');?></b></div>
+			</div>
+		</div>
+	</div>
+
+	<div class="l-unit animated fadeIn">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" style="width:200px !important;" value="mail.<?=htmlspecialchars($_GET['domain']);?>" /></b> </div>
+			<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>A</b></div>
+			<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>10</b></div>
+			<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>14400</b></div>
+			<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" value="<?=array_key_first($ips);?>" /></b></div>
+		</div>
+	</div>
+	<?php if($_SESSION['WEBMAIL_SYSTEM']){?>
+		<div class="l-unit animated fadeIn">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" style="width:200px !important;" value="<?=$v_webmail_alias;?>.<?=htmlspecialchars($_GET['domain']);?>" /></b> </div>
+				<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>A</b></div>
+				<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>&nbsp;</b></div>
+				<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>14400</b></div>
+				<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" value="<?=array_key_first($ips);?>" /></b></div>
+			</div>
+		</div>
+	<?php } ?>
+	<div class="l-unit animated fadeIn">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" style="width:200px !important;" value="@" /></b> </div>
+			<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>TXT</b></div>
+			<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>&nbsp;</b></div>
+			<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>14400</b></div>
+			<div class="clearfix l-unit__stat-col--left  wide-3 "><b><input type="text" class="vst-input" value="<?=htmlspecialchars('"v=spf1 a mx ip4:'.array_key_first($ips).'; -all"');?>" /></b></div>
+		</div>
+	</div>
+	<?php foreach($dkim as $key => $value){ ?>
+		<div class="l-unit animated fadeIn">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" style="width:200px !important;" value="<?=htmlspecialchars($key);?>" /></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>TXT</b></div>
+				<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>&nbsp;</b></div>
+				<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>3600</b></div>
+				<div class="clearfix l-unit__stat-col--left  wide-3 "><b><input type="text" class="vst-input" value="<?=htmlspecialchars(str_replace("'",'"',$dkim[$key]['TXT']));?>" </b></div>
+			</div>
+		</div>
+	<?php } ?>
 </div>
 <div id="vstobjects">
-  <div class="l-separator"></div>
-  <div class="l-center">
-    <div class="l-unit-ft">
-      <table class='data'></table>
-      <div class="data-count l-unit__col l-unit__col--right clearfix">
-    
-      </div>
-      <div class="data-count l-unit__col l-unit__col--right back clearfix">
-      </div>
-    </div>
-  </div>
-</div>
+	<div class="l-separator"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right clearfix">
+
+			</div>
+			<div class="data-count l-unit__col l-unit__col--right back clearfix">
+			</div>
+		</div>
+	</div>
+</div>

+ 227 - 227
web/templates/pages/list_packages.html

@@ -1,231 +1,231 @@
-  <div class="l-center">
-    <div class="l-sort clearfix noselect">
-      <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>
-        <a href="/add/package/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add Package')?></a>
-    </div>
-      <ul class="context-menu sort-order animated fadeIn" style="display:none;">
-        <li entity="sort-date" sort_as_int="1"><span class="name <? if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-        <li entity="sort-name"><span class="name <? if ($_SESSION['userSortOrder'] === 'name') { echo 'active'; } ?>"><?=_('Name')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-      </ul>
-      <div class="l-sort-toolbar clearfix">
-        <table>
-          <tr>
-            <td class="sort-by" title="<?=_('Sort items');?>">
-              <?=_('sort by');?>: <span>
-                <b>
-                  <? if ($_SESSION['userSortOrder'] === 'name') { $label = 'Name'; } else { $label = 'Date'; } ?>
-                  <?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
-                </b>
-              </span>
-            <td>
-              <form action="/bulk/package/" method="post" id="objects">
-                <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                <div class="l-select">
-                  <select class="" name="action">
-                    <option value=""><?=_('apply to selected')?></option>
-                    <option value="delete"><?=_('delete')?></option>
-                  </select>
-                </div>
-                <button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected')?>"><i class="fas fa-arrow-right"></i></button>
-              </form>
-            </td>
-          </tr>
-        </table>
-      </div>
-    </div>
-  </div>
-
-  <div class="l-separator"></div>
-
-  <div class="l-center units">
-      <div class="table-header"> 
-          <div class="l-unit__col l-unit__col--right">
-                <div class="clearfix l-unit__stat-col--left super-compact">
-                  <input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all')?>" onChange="checkedAll('objects');">
-                </div>
-                <div class="clearfix l-unit__stat-col--left wide-2"><b><?php print _('Package');?></b></div>
-                <div class="clearfix l-unit__stat-col--left compact-3 text-right"><b>&nbsp;</b></div>
-                <div class="clearfix l-unit__stat-col--left text-center compact"><b><i class="fas fa-terminal" title="<?php print _('Shell');?>"></i></b></div>
-                <div class="clearfix l-unit__stat-col--left text-center compact"><b><i class="fas fa-hdd" title="<?php print _('Quota');?>"></i></b></div>
-                <div class="clearfix l-unit__stat-col--left text-center compact"><b><i class="fas fa-exchange-alt" title="<?php print _('Bandwidth');?>"></i></b></div>
-                <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-globe-americas" title="<?php print _('Web Domains');?>"></i></b></div>
-                <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-link" title="<?php print _('Web Aliases');?>"></i></b></div>
-                <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-atlas" title="<?php print _('DNS Domains');?>"></i></b></div>
-                <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-globe" title="<?php print _('DNS Records');?>"></i></b></div>
-                <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-mail-bulk" title="<?php print _('Mail Domains');?>"></i></b></div>
-                <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-inbox" title="<?php print _('Mail Accounts');?>"></i></b></div>
-                <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-database" title="<?php print _('Databases');?>"></i></b></div>
-                <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-clock" title="<?php print _('Cron Jobs');?>"></i></b></div>
-                <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-file-archive" title="<?php print _('Backups');?>"></i></b></div>
-           </div>
-        </div>
+<!-- Begin toolbar -->
+<div class="l-center">
+	<div class="l-sort clearfix noselect">
+		<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>
+			<a href="/add/package/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add Package');?></a>
+		</div>
+		<ul class="context-menu sort-order animated fadeIn" style="display:none;">
+			<li entity="sort-date" sort_as_int="1"><span class="name <?php if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-name"><span class="name <?php if ($_SESSION['userSortOrder'] === 'name') { echo 'active'; } ?>"><?=_('Name');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+		</ul>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td class="sort-by" title="<?=_('Sort items');?>">
+						<?=_('sort by');?>: <span>
+							<b>
+								<?php if ($_SESSION['userSortOrder'] === 'name') { $label = 'Name'; } else { $label = 'Date'; } ?>
+								<?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
+							</b>
+						</span>
+					<td>
+						<form action="/bulk/package/" method="post" id="objects">
+							<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+							<div class="l-select">
+								<select class="" name="action">
+									<option value=""><?=_('apply to selected');?></option>
+									<option value="delete"><?=_('delete');?></option>
+								</select>
+							</div>
+							<button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected');?>"><i class="fas fa-arrow-right"></i></button>
+						</form>
+					</td>
+				</tr>
+			</table>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <?php
-      foreach ($data as $key => $value) {
-        ++$i;
-    ?>
+<div class="l-separator"></div>
 
-    <div class="l-unit  <? if($status == 'suspended') echo 'l-unit--suspended'; if($_SESSION['favourites']['USER'][$key] == 1) echo ' l-unit--starred';?> animated fadeIn" v_section="user"
-v_unit_id="<?=$key?>" sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>" sort-name="<?=$key?>"
-sort-bandwidth="<?=$data[$key]['U_BANDWIDTH']?>" sort-disk="<?=$data[$key]['U_DISK']?>" sort-star="<? if($_SESSION['favourites']['USER'][$key] == 1) echo '1'; else echo '0'; ?>">
-      <div class="l-unit__col l-unit__col--right">
-        <div class="clearfix l-unit__stat-col--left super-compact">
-          <input id="check<?=$i?>" class="ch-toggle" type="checkbox" title="<?=_('Select')?>" name="user[]" value="<?=$key?>">
-        </div>
-            <? if (($key == 'default') && ($_SESSION['userContext'] === 'admin') && ($_SESSION['user'] !== 'admin')) { ?>
-              <div class="clearfix l-unit__stat-col--left wide-2 truncate"><b><?=$key?></b></div>
-            <? } else {?>
-              <div class="clearfix l-unit__stat-col--left wide-2 truncate"><b><a href="/edit/package/?package=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Package')?>: <?=$key?>"><?=$key?></b></a></div>
-            <? } ?>
-            <!-- START QUICK ACTION TOOLBAR AREA -->
-            <div class="clearfix l-unit__stat-col--left text-right compact-3">
-                  <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-                      <div class="actions-panel clearfix">
-                        <? if (($key == 'default') && ($_SESSION['userContext'] === 'admin') && ($_SESSION['user'] !== 'admin')) { ?>
-                          <!-- Restrict editing default package -->
-                        <? } else {?>
-                          <div class="actions-panel__col actions-panel__edit shortcut-enter" key-action="href"><a href="/edit/package/?package=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Package')?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>            
-                        <? } ?>
-                        <div class="actions-panel__col actions-panel__edit" key-action="href"><a href="/copy/package/?package=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Copy')?>"><i class="fas fa-clone status-icon teal status-icon dim"></i></a></div>
-                        <? if ($key == 'default') { ?>
-                          <!-- Restrict deleting default package -->
-                        <? } else {?>
-                          <div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
-                            <a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('Delete')?>">
-                              <i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
-                              <input type="hidden" name="delete_url" value="/delete/package/?package=<?=$key?>&token=<?=$_SESSION['token']?>" />
-                              <div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
-                                <p class="confirmation"><?=sprintf(_('DELETE_PACKAGE_CONFIRMATION'),$key)?></p>
-                              </div>
-                            </a>
-                          </div>
-                        <? } ?>
-                      </div>
-                    </div>
-            </div>
-            <!-- END QUICK ACTION TOOLBAR AREA -->
-            <div class="clearfix l-unit__stat-col--left text-center compact">
-              <? if($data[$key]['SHELL'] == 'nologin'){ ?>
-                <i class="fas fa-minus-circle status-icon large" title="<?=_('SSH Access')?>: <?=$data[$key]['SHELL']?>"> </i>
-              <? } else {?>
-                <i class="fas fa-check-circle status-icon green large"></i>
-              <? } ?>
-            </div>
-            <div class="clearfix l-unit__stat-col--left text-center compact">
-              <span title="<?=_('Quota')?>: <?=humanize_usage_size($data[$key]['DISK_QUOTA'])?> <?=humanize_usage_measure($data[$key]['DISK_QUOTA'])?>">
-                <?php if (preg_match('/[a-z]/i', $data[$key]['DISK_QUOTA'])): ?>
-                  <b>&infin;</b>
-                <?php else: ?>
-                    <b><?=humanize_usage_size($data[$key]['DISK_QUOTA'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['DISK_QUOTA'])?></span>
-                <?php endif; ?>
-              </span>
-            </div>
-            <div class="clearfix l-unit__stat-col--left text-center compact">
-              <span title="<?=_('Bandwidth')?>: <?=humanize_usage_size($data[$key]['BANDWIDTH'])?> <?=humanize_usage_measure($data[$key]['BANDWIDTH'])?>">
-                <? if($data[$key]['BANDWIDTH'] == 'unlimited'){ ?>
-                  <b>&infin;</b>
-                <? } else {?>
-                  <b><?=humanize_usage_size($data[$key]['BANDWIDTH'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['BANDWIDTH'])?></span>
-                <? } ?>
-              </span>
-            </div>
-            <div class="clearfix l-unit__stat-col--left text-center super-compact">
-              <span class="jump-top badge gray raised" title="<?=_('Web Domains')?>: <?=$data[$key]['WEB_DOMAINS']?>">
-                <? if($data[$key]['WEB_DOMAINS'] == 'unlimited'){ ?>
-                  <b>&infin;</b>
-                <? } else {?>
-                 <b><?=$data[$key]['WEB_DOMAINS']?></b>
-                <? } ?>
-              </span>
-            </div>
-            <div class="clearfix l-unit__stat-col--left text-center super-compact">
-                <span class="jump-top badge gray raised" title="<?=_('Web Aliases')?>: <?=$data[$key]['WEB_ALIASES']?>">
-                  <? if($data[$key]['WEB_ALIASES'] == 'unlimited'){ ?>
-                    <b>&infin;</b>
-                  <? } else {?>
-                   <b><?=$data[$key]['WEB_ALIASES']?></b>
-                  <? } ?>
-                </span>
-            </div>
-            <div class="clearfix l-unit__stat-col--left text-center super-compact">
-                <span class="jump-top badge gray raised" title="<?=_('DNS Domains')?>: <?=$data[$key]['DNS_DOMAINS']?>">
-                  <? if($data[$key]['DNS_DOMAINS'] == 'unlimited'){ ?>
-                    <b>&infin;</b>
-                  <? } else {?>
-                   <b><?=$data[$key]['DNS_DOMAINS']?></b>
-                  <? } ?>
-                </span>
-            </div>
-            <div class="clearfix l-unit__stat-col--left text-center super-compact">
-                <span class="jump-top badge gray raised" title="<?=_('DNS Records')?>: <?=$data[$key]['DNS_RECORDS']?>">
-                  <? if($data[$key]['DNS_RECORDS'] == 'unlimited'){ ?>
-                    <b>&infin;</b>
-                  <? } else {?>
-                   <b><?=$data[$key]['DNS_RECORDS']?></b>
-                  <? } ?>
-                </span>
-            </div>
-            <div class="clearfix l-unit__stat-col--left text-center super-compact">
-                <span class="jump-top badge gray raised" title="<?=_('Mail Domains')?>: <?=$data[$key]['MAIL_DOMAINS']?>">
-                  <? if($data[$key]['MAIL_DOMAINS'] == 'unlimited'){ ?>
-                    <b>&infin;</b>
-                  <? } else {?>
-                   <b><?=$data[$key]['MAIL_DOMAINS']?></b>
-                  <? } ?>
-                </span>
-            </div>
-            <div class="clearfix l-unit__stat-col--left text-center super-compact">
-                <span class="jump-top badge gray raised" title="<?=_('Mail Accounts')?>: <?=$data[$key]['MAIL_ACCOUNTS']?>">
-                  <? if($data[$key]['MAIL_ACCOUNTS'] == 'unlimited'){ ?>
-                    <b>&infin;</b>
-                  <? } else {?>
-                   <b><?=$data[$key]['MAIL_ACCOUNTS']?></b>
-                  <? } ?>
-                </span>
-            </div>
-            <div class="clearfix l-unit__stat-col--left text-center super-compact">
-                <span class="jump-top badge gray raised" title="<?=_('Databases')?>: <?=$data[$key]['DATABASES']?>">
-                  <? if($data[$key]['DATABASES'] == 'unlimited'){ ?>
-                    <b>&infin;</b>
-                  <? } else {?>
-                   <b><?=$data[$key]['DATABASES']?></b>
-                  <? } ?>
-                </span>
-              </div>
-              <div class="clearfix l-unit__stat-col--left text-center super-compact">
-                  <span class="jump-top badge gray raised" title="<?=_('Cron Jobs')?>: <?=$data[$key]['CRON_JOBS']?>">
-                    <? if($data[$key]['CRON_JOBS'] == 'unlimited'){ ?>
-                      <b>&infin;</b>
-                    <? } else {?>
-                     <b><?=$data[$key]['CRON_JOBS']?></b>
-                    <? } ?>
-                  </span>
-                </div>
-                <div class="clearfix l-unit__stat-col--left text-center super-compact">
-                  <span class="jump-top badge gray raised" title="<?=_('Backups')?>: <?=$data[$key]['BACKUPS']?>">
-                    <? if($data[$key]['BACKUPS'] == 'unlimited'){ ?>
-                      <b>&infin;</b>
-                    <? } else {?>
-                     <b><?=$data[$key]['BACKUPS']?></b>
-                    <? } ?>
-                  </span>
-                </div>
-        </div>
-       </div>
-    <?}?>
-  </div>
+<div class="l-center units">
+	<div class="table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left super-compact">
+				<input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all');?>" onChange="checkedAll('objects');">
+			</div>
+			<div class="clearfix l-unit__stat-col--left wide-2"><b><?=_('Package');?></b></div>
+			<div class="clearfix l-unit__stat-col--left compact-3 text-right"><b>&nbsp;</b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact"><b><i class="fas fa-terminal" title="<?=_('Shell');?>"></i></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact"><b><i class="fas fa-hdd" title="<?=_('Quota');?>"></i></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact"><b><i class="fas fa-exchange-alt" title="<?=_('Bandwidth');?>"></i></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-globe-americas" title="<?=_('Web Domains');?>"></i></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-link" title="<?=_('Web Aliases');?>"></i></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-atlas" title="<?=_('DNS Domains');?>"></i></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-globe" title="<?=_('DNS Records');?>"></i></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-mail-bulk" title="<?=_('Mail Domains');?>"></i></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-inbox" title="<?=_('Mail Accounts');?>"></i></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-database" title="<?=_('Databases');?>"></i></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-clock" title="<?=_('Cron Jobs');?>"></i></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-file-archive" title="<?=_('Backups');?>"></i></b></div>
+		</div>
+	</div>
 
-  <div id="vstobjects">
-      <div class="l-separator visible"></div>
-  <div class="l-center">
-      <div class="l-unit-ft">
-        <table class='data'></table>
-        <div class="data-count l-unit__col l-unit__col--right clearfix">
-            <?php
-             printf(ngettext('%d package', '%d packages', $i),$i);
-            ?>
-        </div>
-    </div>
-  </div>
+	<!-- Begin package list item loop -->
+	<?php
+		foreach ($data as $key => $value) {
+			++$i;
+		?>
+		<div class="l-unit  <?php if ($status == 'suspended') echo 'l-unit--suspended'; if($_SESSION['favourites']['USER'][$key] == 1) echo ' l-unit--starred';?> animated fadeIn" v_section="user"
+			v_unit_id="<?=$key?>" sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>" sort-name="<?=$key?>"
+			sort-bandwidth="<?=$data[$key]['U_BANDWIDTH']?>" sort-disk="<?=$data[$key]['U_DISK']?>" sort-star="<?php if ($_SESSION['favourites']['USER'][$key] == 1) echo '1'; else echo '0'; ?>">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left super-compact">
+					<input id="check<?=$i?>" class="ch-toggle" type="checkbox" title="<?=_('Select');?>" name="user[]" value="<?=$key?>">
+				</div>
+				<?php if (($key == 'default') && ($_SESSION['userContext'] === 'admin') && ($_SESSION['user'] !== 'admin')) { ?>
+					<div class="clearfix l-unit__stat-col--left wide-2 truncate"><b><?=$key?></b></div>
+				<?php } else {?>
+					<div class="clearfix l-unit__stat-col--left wide-2 truncate"><b><a href="/edit/package/?package=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Package');?>: <?=$key?>"><?=$key?></b></a></div>
+				<?php } ?>
+				<!-- START QUICK ACTION TOOLBAR AREA -->
+				<div class="clearfix l-unit__stat-col--left text-right compact-3">
+					<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+						<div class="actions-panel clearfix">
+							<?php if (($key == 'default') && ($_SESSION['userContext'] === 'admin') && ($_SESSION['user'] !== 'admin')) { ?>
+								<!-- Restrict editing default package -->
+							<?php } else {?>
+								<div class="actions-panel__col actions-panel__edit shortcut-enter" key-action="href"><a href="/edit/package/?package=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Package');?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
+							<?php } ?>
+							<div class="actions-panel__col actions-panel__edit" key-action="href"><a href="/copy/package/?package=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Copy');?>"><i class="fas fa-clone status-icon teal status-icon dim"></i></a></div>
+							<?php if ($key == 'default') { ?>
+								<!-- Restrict deleting default package -->
+							<?php } else {?>
+								<div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
+									<a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('Delete');?>">
+										<i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
+										<input type="hidden" name="delete_url" value="/delete/package/?package=<?=$key?>&token=<?=$_SESSION['token']?>" />
+										<div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation');?>">
+											<p class="confirmation"><?=sprintf(_('DELETE_PACKAGE_CONFIRMATION'),$key)?></p>
+										</div>
+									</a>
+								</div>
+							<?php } ?>
+						</div>
+					</div>
+				</div>
+				<!-- END QUICK ACTION TOOLBAR AREA -->
+				<div class="clearfix l-unit__stat-col--left text-center compact">
+					<?php if ($data[$key]['SHELL'] == 'nologin'){ ?>
+						<i class="fas fa-minus-circle status-icon large" title="<?=_('SSH Access');?>: <?=$data[$key]['SHELL']?>"> </i>
+					<?php } else {?>
+						<i class="fas fa-check-circle status-icon green large"></i>
+					<?php } ?>
+				</div>
+				<div class="clearfix l-unit__stat-col--left text-center compact">
+					<span title="<?=_('Quota');?>: <?=humanize_usage_size($data[$key]['DISK_QUOTA'])?> <?=humanize_usage_measure($data[$key]['DISK_QUOTA'])?>">
+						<?php if (preg_match('/[a-z]/i', $data[$key]['DISK_QUOTA'])): ?>
+							<b>&infin;</b>
+						<?php else: ?>
+							<b><?=humanize_usage_size($data[$key]['DISK_QUOTA'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['DISK_QUOTA'])?></span>
+						<?php endif; ?>
+					</span>
+				</div>
+				<div class="clearfix l-unit__stat-col--left text-center compact">
+					<span title="<?=_('Bandwidth');?>: <?=humanize_usage_size($data[$key]['BANDWIDTH'])?> <?=humanize_usage_measure($data[$key]['BANDWIDTH'])?>">
+						<?php if ($data[$key]['BANDWIDTH'] == 'unlimited'){ ?>
+							<b>&infin;</b>
+						<?php } else {?>
+							<b><?=humanize_usage_size($data[$key]['BANDWIDTH'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['BANDWIDTH'])?></span>
+						<?php } ?>
+					</span>
+				</div>
+				<div class="clearfix l-unit__stat-col--left text-center super-compact">
+					<span class="jump-top badge gray raised" title="<?=_('Web Domains');?>: <?=$data[$key]['WEB_DOMAINS']?>">
+						<?php if ($data[$key]['WEB_DOMAINS'] == 'unlimited'){ ?>
+							<b>&infin;</b>
+						<?php } else {?>
+							<b><?=$data[$key]['WEB_DOMAINS']?></b>
+						<?php } ?>
+					</span>
+				</div>
+				<div class="clearfix l-unit__stat-col--left text-center super-compact">
+					<span class="jump-top badge gray raised" title="<?=_('Web Aliases');?>: <?=$data[$key]['WEB_ALIASES']?>">
+						<?php if ($data[$key]['WEB_ALIASES'] == 'unlimited'){ ?>
+							<b>&infin;</b>
+						<?php } else {?>
+							<b><?=$data[$key]['WEB_ALIASES']?></b>
+						<?php } ?>
+					</span>
+				</div>
+				<div class="clearfix l-unit__stat-col--left text-center super-compact">
+					<span class="jump-top badge gray raised" title="<?=_('DNS Domains');?>: <?=$data[$key]['DNS_DOMAINS']?>">
+						<?php if ($data[$key]['DNS_DOMAINS'] == 'unlimited'){ ?>
+							<b>&infin;</b>
+						<?php } else {?>
+							<b><?=$data[$key]['DNS_DOMAINS']?></b>
+						<?php } ?>
+					</span>
+				</div>
+				<div class="clearfix l-unit__stat-col--left text-center super-compact">
+					<span class="jump-top badge gray raised" title="<?=_('DNS Records');?>: <?=$data[$key]['DNS_RECORDS']?>">
+						<?php if ($data[$key]['DNS_RECORDS'] == 'unlimited'){ ?>
+							<b>&infin;</b>
+						<?php } else {?>
+							<b><?=$data[$key]['DNS_RECORDS']?></b>
+						<?php } ?>
+					</span>
+				</div>
+				<div class="clearfix l-unit__stat-col--left text-center super-compact">
+					<span class="jump-top badge gray raised" title="<?=_('Mail Domains');?>: <?=$data[$key]['MAIL_DOMAINS']?>">
+						<?php if ($data[$key]['MAIL_DOMAINS'] == 'unlimited'){ ?>
+							<b>&infin;</b>
+						<?php } else {?>
+							<b><?=$data[$key]['MAIL_DOMAINS']?></b>
+						<?php } ?>
+					</span>
+				</div>
+				<div class="clearfix l-unit__stat-col--left text-center super-compact">
+					<span class="jump-top badge gray raised" title="<?=_('Mail Accounts');?>: <?=$data[$key]['MAIL_ACCOUNTS']?>">
+						<?php if ($data[$key]['MAIL_ACCOUNTS'] == 'unlimited'){ ?>
+							<b>&infin;</b>
+						<?php } else {?>
+							<b><?=$data[$key]['MAIL_ACCOUNTS']?></b>
+						<?php } ?>
+					</span>
+				</div>
+				<div class="clearfix l-unit__stat-col--left text-center super-compact">
+					<span class="jump-top badge gray raised" title="<?=_('Databases');?>: <?=$data[$key]['DATABASES']?>">
+						<?php if ($data[$key]['DATABASES'] == 'unlimited'){ ?>
+							<b>&infin;</b>
+						<?php } else {?>
+							<b><?=$data[$key]['DATABASES']?></b>
+						<?php } ?>
+					</span>
+				</div>
+				<div class="clearfix l-unit__stat-col--left text-center super-compact">
+					<span class="jump-top badge gray raised" title="<?=_('Cron Jobs');?>: <?=$data[$key]['CRON_JOBS']?>">
+						<?php if ($data[$key]['CRON_JOBS'] == 'unlimited'){ ?>
+							<b>&infin;</b>
+						<?php } else {?>
+							<b><?=$data[$key]['CRON_JOBS']?></b>
+						<?php } ?>
+					</span>
+				</div>
+				<div class="clearfix l-unit__stat-col--left text-center super-compact">
+					<span class="jump-top badge gray raised" title="<?=_('Backups');?>: <?=$data[$key]['BACKUPS']?>">
+						<?php if ($data[$key]['BACKUPS'] == 'unlimited'){ ?>
+							<b>&infin;</b>
+						<?php } else {?>
+							<b><?=$data[$key]['BACKUPS']?></b>
+						<?php } ?>
+					</span>
+				</div>
+			</div>
+		</div>
+	<?php } ?>
 </div>
+
+<div id="vstobjects">
+	<div class="l-separator visible"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right clearfix">
+				<?php printf(ngettext('%d package', '%d packages', $i),$i); ?>
+			</div>
+		</div>
+	</div>
+</div>

+ 64 - 67
web/templates/pages/list_rrd.html

@@ -1,73 +1,70 @@
-    <div class="l-center">
-      <div class="l-sort clearfix noselect">
-        <div class="l-unit-toolbar__buttonstrip">
-          <a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/server/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-          <a href="/list/server/?cpu" class="ui-button cancel" dir="ltr"><i class="fas fa-chart-pie status-icon green"></i><?=_('show: CPU / MEM / NET / DISK');?></a>
-        </div>
-        <div class="l-sort-toolbar clearfix">
-          <table>
-            <tr>
-              <td>
-                <a class="vst<?php if ((empty($_GET['period'])) || ($_GET['period'] == 'daily')) echo " selected" ?>" href="?period=daily"><?=_('Daily')?></a>
-                <a class="vst<?php if ((!empty($_GET['period'])) && ($_GET['period'] == 'weekly')) echo " selected" ?>" href="?period=weekly"><?=_('Weekly')?></a>
-                <a class="vst<?php if ((!empty($_GET['period'])) && ($_GET['period'] == 'monthly')) echo " selected" ?>" href="?period=monthly"><?=_('Monthly')?></a>
-                <a class="vst<?php if ((!empty($_GET['period'])) && ($_GET['period'] == 'yearly')) echo " selected" ?>" href="?period=yearly"><?=_('Yearly')?></a>
-              </td>
+<!-- Begin toolbar -->
+<div class="l-center">
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/server/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+			<a href="/list/server/?cpu" class="ui-button cancel" dir="ltr"><i class="fas fa-chart-pie status-icon green"></i><?=_('show: CPU / MEM / NET / DISK');?></a>
+		</div>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td>
+						<a class="vst<?php if ((empty($_GET['period'])) || ($_GET['period'] == 'daily')) echo " selected" ?>" href="?period=daily"><?=_('Daily');?></a>
+						<a class="vst<?php if ((!empty($_GET['period'])) && ($_GET['period'] == 'weekly')) echo " selected" ?>" href="?period=weekly"><?=_('Weekly');?></a>
+						<a class="vst<?php if ((!empty($_GET['period'])) && ($_GET['period'] == 'monthly')) echo " selected" ?>" href="?period=monthly"><?=_('Monthly');?></a>
+						<a class="vst<?php if ((!empty($_GET['period'])) && ($_GET['period'] == 'yearly')) echo " selected" ?>" href="?period=yearly"><?=_('Yearly');?></a>
+					</td>
 
-              <td>
-                <div class="timer-container" style="float:right;">
-                  <span class="timer-button pause"></span>
-                  <span class="timer-button play hidden"></span>
+					<td>
+						<div class="timer-container" style="float:right;">
+							<span class="timer-button pause"></span>
+							<span class="timer-button play hidden"></span>
 
-                  <div class="refresh-timer">
-                    <div class="movement left">
-                      <div class="loader-half left"></div>
-                    </div>
-                    <div class="movement right">
-                      <div class="loader-half right"></div>
-                    </div>
-                  </div>
-                </div>
-              </td>
-            </tr>
-          </table>
-        </div>
-      </div>
-    </div>
-
-    <div class="l-separator"></div>
-
-    <div class="l-center units animated fadeIn">
-      <?php
-        if (empty($_GET['period'])) {
-          $period='daily';
-        } else {
-          $period=$_GET['period'];
-        }
-
-        foreach ($data as $key => $value) {
-      ?>
-
-      <div class="l-unit l-unit__stats">
-
-        <div class="l-unit__col l-unit__col--right">
-          <div class="l-unit__name separate">
-            <?= _($data[$key]['TITLE'])?>
-          </div>
-
-         <div>
-          <a href="/list/rrd/image.php?/rrd/<?php echo $data[$key]['TYPE']."/".$period."-".$data[$key]['RRD'].".png"?>" target="_blank"><img class="graph-rounded" src="/list/rrd/image.php?/rrd/<?=$data[$key]['TYPE']."/".$period."-".$data[$key]['RRD'].".png"?>"></a>
-         </div>
-
-        </div>
+							<div class="refresh-timer">
+								<div class="movement left">
+									<div class="loader-half left"></div>
+								</div>
+								<div class="movement right">
+									<div class="loader-half right"></div>
+								</div>
+							</div>
+						</div>
+					</td>
+				</tr>
+			</table>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-      </div>
-      <?}?>
+<div class="l-separator"></div>
 
-    </div>
+<div class="l-center units animated fadeIn">
+	<!-- Begin graph list item loop -->
+	<?php
+		if (empty($_GET['period'])) {
+			$period='daily';
+		} else {
+			$period=$_GET['period'];
+		}
+		foreach ($data as $key => $value) {
+		?>
+		<div class="l-unit l-unit__stats">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="l-unit__name separate">
+					<?= _($data[$key]['TITLE'])?>
+				</div>
+				<div>
+					<a href="/list/rrd/image.php?/rrd/<?=$data[$key]['TYPE']."/".$period."-".$data[$key]['RRD'].".png"?>" target="_blank"><img class="graph-rounded" src="/list/rrd/image.php?/rrd/<?=$data[$key]['TYPE']."/".$period."-".$data[$key]['RRD'].".png"?>"></a>
+				</div>
+			</div>
+		</div>
+	<?php } ?>
 
-    <div id="vstobjects">
-        <div class="l-separator"></div>
-    <div class="l-center">
-    </div>
 </div>
+
+<div id="vstobjects">
+	<div class="l-separator"></div>
+	<div class="l-center">
+	</div>
+</div>

+ 156 - 155
web/templates/pages/list_search.html

@@ -1,162 +1,163 @@
+<!-- Begin toolbar -->
 <div class="l-center">
-    <div class="l-sort clearfix noselect">
-      <div class="l-unit-toolbar__buttonstrip">
-        <a href="javascript:window.history.back();" id="btn-back" class="ui-button cancel" dir="ltr"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-        <a href="javascript:location.reload();" class="ui-button cancel" dir="ltr"><i class="fas fa-sync status-icon green"></i> <?=_('Refresh')?></a>
-      </div>
-      <ul class="context-menu sort-order animated fadeIn" style="display:none;">
-        <li entity="sort-date" sort_as_int="1"><span class="name <? if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-        <li entity="sort-name"><span class="name <? if ($_SESSION['userSortOrder'] === 'name') { echo 'active'; } ?>"><?=_('Name')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-      </ul>
-      <div class="l-sort-toolbar clearfix">
-        <table>
-          <tr>
-            <td class="sort-by" title="<?=_('Sort items');?>">
-              <?=_('sort by');?>: <span><b><?=_('Date')?> <i class="fas fa-sort-alpha-down"></i></b></span>
-            </td>
-            <td class="l-sort-toolbar__search-box">
-              <form action="/search/" method="get">
-                <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                <input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search')?>" />
-                <button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search')?>"><i class="fas fa-search"></i></button>
-              </form>
-            </td>
-          </tr>
-        </table>
-      </div>
-    </div>
-  </div>
-    <div class="l-separator"></div>
-    <!-- /.l-separator -->
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a href="javascript:window.history.back();" id="btn-back" class="ui-button cancel" dir="ltr"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+			<a href="javascript:location.reload();" class="ui-button cancel" dir="ltr"><i class="fas fa-sync status-icon green"></i> <?=_('Refresh');?></a>
+		</div>
+		<ul class="context-menu sort-order animated fadeIn" style="display:none;">
+			<li entity="sort-date" sort_as_int="1"><span class="name <?php if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-name"><span class="name <?php if ($_SESSION['userSortOrder'] === 'name') { echo 'active'; } ?>"><?=_('Name');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+		</ul>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td class="sort-by" title="<?=_('Sort items');?>">
+						<?=_('sort by');?>: <span><b><?=_('Date');?> <i class="fas fa-sort-alpha-down"></i></b></span>
+					</td>
+					<td class="l-sort-toolbar__search-box">
+						<form action="/search/" method="get">
+							<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+							<input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search');?>" />
+							<button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search');?>"><i class="fas fa-search"></i></button>
+						</form>
+					</td>
+				</tr>
+			</table>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-center units">
-        <div class="header table-header">     
-            <div class="l-unit__col l-unit__col--right">
-                <div class="clearfix l-unit__stat-col--left super-compact">
-                    &nbsp;
-                </div> 
-              <div class="clearfix l-unit__stat-col--left text-center compact-2"><b><?php print _('Status');?></b></div>
-              <div class="clearfix l-unit__stat-col--left wide-5"><b><?php print _('Search Results');?></b></div>
-              <div class="clearfix l-unit__stat-col--left compact-3"><b>&nbsp;</b></div>
-              <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Date');?></b></div>
-              <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Owner');?></b></div>
-              <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Type');?></b></div>
+<div class="l-separator"></div>
 
-            </div>
-          </div>
-      <?
-        foreach ($data as $key => $value) {
-          ++$i;
-          if ($value['SUSPENDED'] == 'yes') {
-            $status = 'suspended';
-            $spnd_action = 'unsuspend';
-          } else {
-            $status = 'active';
-            $spnd_action = 'suspend';
-          }
-          if ($value['TYPE'] == 'db') {
-            $object = 'database';
-          } else {
-            $object = strtolower($value['TYPE'] . ' ' . $value['KEY']);
-          }
+<div class="l-center units">
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left super-compact">
+				&nbsp;
+			</div>
+			<div class="clearfix l-unit__stat-col--left text-center compact-2"><b><?=_('Status');?></b></div>
+			<div class="clearfix l-unit__stat-col--left wide-5"><b><?=_('Search Results');?></b></div>
+			<div class="clearfix l-unit__stat-col--left compact-3"><b>&nbsp;</b></div>
+			<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Date');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Owner');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Type');?></b></div>
+		</div>
+	</div>
 
-          $uniq_id = $value['TYPE'] . '-';
-          if ($value['KEY'] == 'ACCOUNT'){
-            $uniq_id .= 'acc-';
-          }
-          $uniq_id .= sha1($value['RESULT']);
-        ?>
+	<!-- Begin search result item loop -->
+	<?php
+		foreach ($data as $key => $value) {
+			++$i;
 
+			if ($value['SUSPENDED'] == 'yes') {
+				$status = 'suspended';
+				$spnd_action = 'unsuspend';
+			} else {
+				$status = 'active';
+				$spnd_action = 'suspend';
+			}
 
-      <div class="l-unit <? if($status == 'suspended') echo 'l-unit--suspended'; if($_COOKIE[$uniq_id] == 1) echo ' l-unit--starred'; ?> animated fadeIn" id="web-unit-<?=$i?>" uniq-id="<?=$uniq_id?>" sort-date="<?=strtotime($value['DATE'].' '.$value['TIME'])?>" sort-name="<?=$value['RESULT']?>" sort-type="<?=_($object)?>" sort-owner="<?=$value['USER']?>" sort-status="<?=$status?>"
-        style="<?if (($_SESSION['POLICY_SYSTEM_HIDE_ADMIN'] === 'yes') && ($value['USER']) === 'admin') { echo 'display: none;';}?>">
-            
-      <div class="l-unit__col l-unit__col--right">
-          <div class="clearfix l-unit__stat-col--left super-compact text-center">
-              <? if ($object === 'web domain') {
-                $icon = 'fa-globe-americas';
-              }?>
-              <? if ($object === 'mail domain') {
-                $icon = 'fa-mail-bulk';
-              }?>
-              <? if ($object === 'dns domain') {
-                $icon = 'fa-atlas';
-              }?>
-              <? if ($object === 'dns record') {
-                $icon = 'fa-atlas';
-              }?>
-              <? if ($object === 'database') {
-                $icon = 'fa-database';
-              }?>
-              <? if ($object === 'cron job') {
-                $icon = 'fa-clock';
-              }?>
-              <i class="fa <?=$icon;?> status-icon dim"></i>
-            </div>
-            <div class="clearfix l-unit__stat-col--left compact-2 text-center">
-              <b>
-                <? if ($status === 'active') {?>
-                  <i class="fas fa-check-circle status-icon green"></i>
-                <? } ?>
-                <? if ($status === 'suspended') {?>
-                  <i class="fas fa-exclamation-triangle status-icon orange"></i>
-                <? } ?>
-            </b>
-          </div>
-            <div class="clearfix l-unit__stat-col--left wide-5 truncate">
-                <?
-                if ($value['KEY'] == 'RECORD') {
-                  $edit_lnk = '/edit/'.$value['TYPE'].'/?domain='.$value['PARENT'].'&record_id='.$value['LINK'].'&user='.$value['USER'].'&token='.$_SESSION['token'].'';
-                }
-                if ($value['KEY'] == 'ACCOUNT') {
-                  $edit_lnk = '/edit/'.$value['TYPE'].'/?domain='.$value['PARENT'].'&account='.$value['LINK'].'&user='.$value['USER'].'&token='.$_SESSION['token'].'';
-                }
-                if ($value['KEY'] == 'JOB') {
-                  $edit_lnk = '/edit/'.$value['TYPE'].'/?job='.$value['LINK'].'&user='.$value['USER'].'&token='.$_SESSION['token'].'';
-                }
-                if ($value['KEY'] == 'DATABASE') {
-                  $edit_lnk = '/edit/'.$value['TYPE'].'/?database='.$value['RESULT'].'&user='.$value['USER'].'&token='.$_SESSION['token'].'';
-                }
-                if (($value['KEY'] != 'RECORD') && ($value['KEY'] != 'ACCOUNT') && ($value['KEY'] != 'JOB') && ($value['KEY'] != 'DATABASE') ) {
-                  $edit_lnk = '/edit/'.$value['TYPE'].'/?'.strtolower($value['KEY']).'='.$value['RESULT'].'&user='.$value['USER'].'&token='.$_SESSION['token'].'';
-                }
-              ?>
-              <b>
-                <? if (($_SESSION['userContext'] === 'admin') && ($_SESSION['user'] !== 'admin') && ($value['USER'] === 'admin') && ($_SESSION['POLICY_SYSTEM_PROTECTED_ADMIN'] === 'yes')) {?>
-                  <?=$value['RESULT']?>
-                <?} else {?>
-                  <a href="<?php echo $edit_lnk; ?>"><?=$value['RESULT']?></a>
-                <?}?>
-              </b>
-            </div>
-            <div class="clearfix l-unit__stat-col--left text-right compact-3">
-                  <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-                      <div class="actions-panel clearfix">
-                        &nbsp;
-                       </div>
-                    </div>
-                  <!-- END QUICK ACTION TOOLBAR AREA -->
-              </div>
-              <div class="clearfix l-unit__stat-col--left text-center"><?=translate_date($value['DATE'])?></div>
-              <div class="clearfix l-unit__stat-col--left text-center"><b>
-                <a href="/search/?q=<?php echo $_GET['q'] ?>&u=<?php echo $value['USER']; ?>"><?php echo $value['USER']; ?></a></b></div>
-              <div class="clearfix l-unit__stat-col--left text-center"><?=_($object)?></b></div>
-            </div>
-        </div>
-    
-      <?}?>
-      </div>
+			if ($value['TYPE'] == 'db') {
+				$object = 'database';
+			} else {
+				$object = strtolower($value['TYPE'] . ' ' . $value['KEY']);
+			}
 
-    <div id="vstobjects">
-      <div class="l-separator"></div>
-      <div class="l-center">
-        <div class="l-unit-ft">
-          <table class='data'></table>
-          <div class="data-count l-unit__col l-unit__col--right clearfix">
-              <?php
-               printf(ngettext('%d object', '%d objects', $i),$i);
-              ?>
-          </div>
-        </div>
-      </div>
-    </div>
+			$uniq_id = $value['TYPE'] . '-';
+			if ($value['KEY'] == 'ACCOUNT'){
+				$uniq_id .= 'acc-';
+			}
+			$uniq_id .= sha1($value['RESULT']);
+		?>
+		<div class="l-unit <?php if($status == 'suspended') echo 'l-unit--suspended'; if($_COOKIE[$uniq_id] == 1) echo ' l-unit--starred'; ?> animated fadeIn" id="web-unit-<?=$i?>" uniq-id="<?=$uniq_id?>" sort-date="<?=strtotime($value['DATE'].' '.$value['TIME'])?>" sort-name="<?=$value['RESULT']?>" sort-type="<?=_($object)?>" sort-owner="<?=$value['USER']?>" sort-status="<?=$status?>"
+			style="<?php if (($_SESSION['POLICY_SYSTEM_HIDE_ADMIN'] === 'yes') && ($value['USER']) === 'admin') { echo 'display: none;';}?>">
+
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left super-compact text-center">
+					<?php 
+						if ($object === 'web domain') {
+								$icon = 'fa-globe-americas';
+						}
+						if ($object === 'mail domain') {
+								$icon = 'fa-mail-bulk';
+						}
+						if ($object === 'dns domain') {
+								$icon = 'fa-atlas';
+						}
+						if ($object === 'dns record') {
+								$icon = 'fa-atlas';
+						}
+						if ($object === 'database') {
+								$icon = 'fa-database';
+						}
+						if ($object === 'cron job') {
+								$icon = 'fa-clock';
+						}
+					?>
+					<i class="fa <?=$icon;?> status-icon dim"></i>
+				</div>
+				<div class="clearfix l-unit__stat-col--left compact-2 text-center">
+					<b>
+						<?php if ($status === 'active') {?>
+							<i class="fas fa-check-circle status-icon green"></i>
+						<?php  } ?>
+						<?php if ($status === 'suspended') {?>
+							<i class="fas fa-exclamation-triangle status-icon orange"></i>
+						<?php  } ?>
+					</b>
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide-5 truncate">
+					<?php
+						if ($value['KEY'] == 'RECORD') {
+							$edit_lnk = '/edit/'.$value['TYPE'].'/?domain='.$value['PARENT'].'&record_id='.$value['LINK'].'&user='.$value['USER'].'&token='.$_SESSION['token'].'';
+						}
+						if ($value['KEY'] == 'ACCOUNT') {
+							$edit_lnk = '/edit/'.$value['TYPE'].'/?domain='.$value['PARENT'].'&account='.$value['LINK'].'&user='.$value['USER'].'&token='.$_SESSION['token'].'';
+						}
+						if ($value['KEY'] == 'JOB') {
+							$edit_lnk = '/edit/'.$value['TYPE'].'/?job='.$value['LINK'].'&user='.$value['USER'].'&token='.$_SESSION['token'].'';
+						}
+						if ($value['KEY'] == 'DATABASE') {
+							$edit_lnk = '/edit/'.$value['TYPE'].'/?database='.$value['RESULT'].'&user='.$value['USER'].'&token='.$_SESSION['token'].'';
+						}
+						if (($value['KEY'] != 'RECORD') && ($value['KEY'] != 'ACCOUNT') && ($value['KEY'] != 'JOB') && ($value['KEY'] != 'DATABASE') ) {
+							$edit_lnk = '/edit/'.$value['TYPE'].'/?'.strtolower($value['KEY']).'='.$value['RESULT'].'&user='.$value['USER'].'&token='.$_SESSION['token'].'';
+						}
+					?>
+					<b>
+						<?php if (($_SESSION['userContext'] === 'admin') && ($_SESSION['user'] !== 'admin') && ($value['USER'] === 'admin') && ($_SESSION['POLICY_SYSTEM_PROTECTED_ADMIN'] === 'yes')) {?>
+							<?=$value['RESULT']?>
+						<?} else {?>
+							<a href="<?=$edit_lnk; ?>"><?=$value['RESULT']?></a>
+						<?php } ?>
+					</b>
+				</div>
+				<div class="clearfix l-unit__stat-col--left text-right compact-3">
+					<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+						<div class="actions-panel clearfix">
+							&nbsp;
+						</div>
+					</div>
+				</div>
+				<div class="clearfix l-unit__stat-col--left text-center"><?=translate_date($value['DATE'])?></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b>
+						<a href="/search/?q=<?=$_GET['q'] ?>&u=<?=$value['USER']; ?>"><?=$value['USER']; ?></a></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><?=_($object)?></b></div>
+			</div>
+		</div>
+	<?php } ?>
+</div>
+
+<div id="vstobjects">
+	<div class="l-separator"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right clearfix">
+				<?php printf(ngettext('%d object', '%d objects', $i),$i); ?>
+			</div>
+		</div>
+	</div>
+</div>

+ 36 - 33
web/templates/pages/list_server_info.html

@@ -1,39 +1,42 @@
 <!doctype html>
 <html lang="en">
+
 <head>
-  <!-- Load necessary CSS and JavaScript from source -->
-  <?php require ''.$_SERVER['HESTIA'].'/web/templates/includes/title.html'; ?>
-  <?php require ''.$_SERVER['HESTIA'].'/web/templates/includes/css.html'; ?>
-  <?php require ''.$_SERVER['HESTIA'].'/web/templates/includes/top_js.html'; ?>
-  <script type="text/javascript" src="/js/jquery/jquery-1.7.2.min.js"></script>
-  <script type="text/javascript" src="/js/jquery/jquery.cookie.js"></script>
-  <script type="text/javascript" src="/js/jquery/jquery-ui-1.8.20.custom.min.js"></script>
-  <script type="text/javascript" src="/js/events.js"></script>
+	<!-- Load necessary CSS and JavaScript from source -->
+	<?php require ''.$_SERVER['HESTIA'].'/web/templates/includes/title.html'; ?>
+	<?php require ''.$_SERVER['HESTIA'].'/web/templates/includes/css.html'; ?>
+	<?php require ''.$_SERVER['HESTIA'].'/web/templates/includes/top_js.html'; ?>
+	<script type="text/javascript" src="/js/jquery/jquery-1.7.2.min.js"></script>
+	<script type="text/javascript" src="/js/jquery/jquery.cookie.js"></script>
+	<script type="text/javascript" src="/js/jquery/jquery-ui-1.8.20.custom.min.js"></script>
+	<script type="text/javascript" src="/js/events.js"></script>
 </head>
+
 <body>
-  <a href="#" class="to-top" title="<?=_('Top')?>">
-    <i class="fas fa-arrow-up"></i>
-  </a>
-  <div class="l-header">
-    <div class="l-center">
-      <a href="/list/web/" class="l-logo"></a>
-      <div class="l-menu clearfix">
-        <div class="l-menu__item"><a href="/list/rrd/" title="<?=_('Back')?>" class="no-hide"><i class="fas fa-arrow-alt-circle-left"></i></a></div>
-        <div class="l-menu__item <?php if(isset($_GET['cpu'])) echo 'l-menu__item--active' ?>"><a href="/list/server/?cpu"><i class="fas fa-microchip panel-icon"></i><?=_('CPU')?></a></div>
-        <div class="l-menu__item <?php if(isset($_GET['mem'])) echo 'l-menu__item--active' ?>"><a href="/list/server/?mem"><i class="fas fa-memory panel-icon"></i><?=_('RAM')?></a></div>
-        <div class="l-menu__item <?php if(isset($_GET['disk'])) echo 'l-menu__item--active' ?>"><a href="/list/server/?disk"><i class="fas fa-hdd panel-icon"></i><?=_('Disk')?></a></div>
-        <div class="l-menu__item <?php if(isset($_GET['net'])) echo 'l-menu__item--active' ?>"><a href="/list/server/?net"><i class="fas fa-ethernet panel-icon"></i><?=_('Network')?></a></div>
-        <?php if ((isset($_SESSION['WEB_SYSTEM'])) && (!empty($_SESSION['WEB_SYSTEM']))) {?><div class="l-menu__item <?php if(isset($_GET['web'])) echo 'l-menu__item--active' ?>"><a href="/list/server/?web"><i class="fas fa-globe-europe panel-icon"></i><?=_('Web')?></a></div><?php }?>
-        <?php if ((isset($_SESSION['DNS_SYSTEM'])) && (!empty($_SESSION['DNS_SYSTEM']))) {?><div class="l-menu__item <?php if(isset($_GET['dns'])) echo 'l-menu__item--active' ?>"><a href="/list/server/?dns"><i class="fas fa-atlas panel-icon"></i><?=_('DNS')?></a></div><?php }?>
-        <?php if ((isset($_SESSION['MAIL_SYSTEM'])) && (!empty($_SESSION['MAIL_SYSTEM']))) {?><div class="l-menu__item <?php if(isset($_GET['mail'])) echo 'l-menu__item--active' ?>"><a href="/list/server/?mail"><i class="fas fa-mail-bulk panel-icon"></i><?=_('Mail')?></a></div><?php }?>
-        <?php if ((isset($_SESSION['DB_SYSTEM'])) && (!empty($_SESSION['DB_SYSTEM']))) {?><div class="l-menu__item <?php if(isset($_GET['db'])) echo 'l-menu__item--active' ?>"><a href="/list/server/?db"><i class="fas fa-database panel-icon"></i><?=_('DB')?></a></div><?php }?>
-      </div>
-      <div class="l-profile noselect">
-        <div class="l-menu__item"><a href="javascript:location.reload();" title="<?=_('Refresh')?>"><i class="fas fa-redo"></i></a></div>
-        <div class="l-menu__item"><a href="/logout/" title="<?=_('Log out')?>" class="l-profile__logout"><i class="fas fa-sign-out-alt"></i></a></div>
-      </div>
-    </div>
-  </div>
+	<a href="#" class="to-top" title="<?=_('Top');?>">
+		<i class="fas fa-arrow-up"></i>
+	</a>
+	<div class="l-header">
+		<div class="l-center">
+			<a href="/list/web/" class="l-logo"></a>
+			<div class="l-menu clearfix">
+				<div class="l-menu__item"><a href="/list/rrd/" title="<?=_('Back');?>" class="no-hide"><i class="fas fa-arrow-alt-circle-left"></i></a></div>
+				<div class="l-menu__item <?php if(isset($_GET['cpu'])) echo 'l-menu__item--active' ?>"><a href="/list/server/?cpu"><i class="fas fa-microchip panel-icon"></i><?=_('CPU');?></a></div>
+				<div class="l-menu__item <?php if(isset($_GET['mem'])) echo 'l-menu__item--active' ?>"><a href="/list/server/?mem"><i class="fas fa-memory panel-icon"></i><?=_('RAM');?></a></div>
+				<div class="l-menu__item <?php if(isset($_GET['disk'])) echo 'l-menu__item--active' ?>"><a href="/list/server/?disk"><i class="fas fa-hdd panel-icon"></i><?=_('Disk');?></a></div>
+				<div class="l-menu__item <?php if(isset($_GET['net'])) echo 'l-menu__item--active' ?>"><a href="/list/server/?net"><i class="fas fa-ethernet panel-icon"></i><?=_('Network');?></a></div>
+				<?php if ((isset($_SESSION['WEB_SYSTEM'])) && (!empty($_SESSION['WEB_SYSTEM']))) {?><div class="l-menu__item <?php if(isset($_GET['web'])) echo 'l-menu__item--active' ?>"><a href="/list/server/?web"><i class="fas fa-globe-europe panel-icon"></i><?=_('Web');?></a></div><?php }?>
+				<?php if ((isset($_SESSION['DNS_SYSTEM'])) && (!empty($_SESSION['DNS_SYSTEM']))) {?><div class="l-menu__item <?php if(isset($_GET['dns'])) echo 'l-menu__item--active' ?>"><a href="/list/server/?dns"><i class="fas fa-atlas panel-icon"></i><?=_('DNS');?></a></div><?php }?>
+				<?php if ((isset($_SESSION['MAIL_SYSTEM'])) && (!empty($_SESSION['MAIL_SYSTEM']))) {?><div class="l-menu__item <?php if(isset($_GET['mail'])) echo 'l-menu__item--active' ?>"><a href="/list/server/?mail"><i class="fas fa-mail-bulk panel-icon"></i><?=_('Mail');?></a></div><?php }?>
+				<?php if ((isset($_SESSION['DB_SYSTEM'])) && (!empty($_SESSION['DB_SYSTEM']))) {?><div class="l-menu__item <?php if(isset($_GET['db'])) echo 'l-menu__item--active' ?>"><a href="/list/server/?db"><i class="fas fa-database panel-icon"></i><?=_('DB');?></a></div><?php }?>
+			</div>
+			<div class="l-profile noselect">
+				<div class="l-menu__item"><a href="javascript:location.reload();" title="<?=_('Refresh');?>"><i class="fas fa-redo"></i></a></div>
+				<div class="l-menu__item"><a href="/logout/" title="<?=_('Log out');?>" class="l-profile__logout"><i class="fas fa-sign-out-alt"></i></a></div>
+			</div>
+		</div>
+	</div>
 
-  <div class="server-info-output">.</div><div class="l-center">
-  <pre class="console-output animated fadeIn">
+	<div class="server-info-output">.</div>
+	<div class="l-center">
+		<pre class="console-output animated fadeIn">

+ 59 - 58
web/templates/pages/list_server_preview.html

@@ -1,60 +1,61 @@
+<!-- Begin toolbar -->
 <div class="l-center">
-    <div class="l-sort clearfix noselect">
-      <div class="l-unit-toolbar__buttonstrip">
-          <a href="/edit/server/" id="btn-back" class="ui-button cancel" dir="ltr"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-      </div>
-      <div class="l-unit-toolbar__buttonstrip float-right">
-      </div>
-    </div>
-  </div>
-  
-  <div class="l-separator"></div>
-  
-  <div class="l-center units">
-  
-    <div class="header table-header">     
-      <div class="l-unit__col l-unit__col--right">
-        <div class="clearfix l-unit__stat-col--left super-compact text-center">&nbsp;</div>
-        <div class="clearfix l-unit__stat-col--left"><b><?php print _('Category');?></b></div>
-        <div class="clearfix l-unit__stat-col--left wide-6"><b><?php print _('Name');?></b></div>
-        <div class="clearfix l-unit__stat-col--left wide-2"><b><?php print _('Status');?></b></div>
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a href="/edit/server/" id="btn-back" class="ui-button cancel" dir="ltr"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+		</div>
+		<div class="l-unit-toolbar__buttonstrip float-right">
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-      </div>
-    </div>
-      <!-- Start of item element-->
-        <div class="l-unit header animated fadeIn">
-          <div class="l-unit__col l-unit__col--right">
-            <div class="clearfix l-unit__stat-col--left super-compact text-center">
-                <i class="fas fa-database status-icon blue"></i>
-            </div>
-            <div class="clearfix l-unit__stat-col--left"><b><?=_('Databases');?></b></div>
-            <div class="clearfix l-unit__stat-col--left wide-6"><b><?=_('phpMyAdmin Single Sign On'); ?></b></div>
-            <div class="clearfix l-unit__stat-col--left wide-2">In final development stages.</div>
-          </div>
-        </div>
-      <!-- End of item element-->
-      <!-- Start of item element-->
-        <div class="l-unit header animated fadeIn">
-          <div class="l-unit__col l-unit__col--right">
-              <div class="clearfix l-unit__stat-col--left super-compact text-center">
-                  <i class="fas fa-cog status-icon blue"></i>
-              </div>
-              <div class="clearfix l-unit__stat-col--left"><b><?=_('System');?></b></div>
-              <div class="clearfix l-unit__stat-col--left wide-6"><b><?=_('Policy'); ?>: <?=_('Allow suspended users to log in with read-only access'); ?></b></div>
-              <div class="clearfix l-unit__stat-col--left wide-2">Partially implemented.</div>
-            </div>
-        </div>
-        <!-- End of item element-->
-  </div>
-  
-  <div id="vstobjects">
-    <div class="l-separator"></div>
-    <div class="l-center">
-      <div class="l-unit-ft">
-        <table class='data'></table>
-        <div class="data-count l-unit__col l-unit__col--right clearfix">
-        </div>
-      </div>
-    </div>
-  </div>
-  
+<div class="l-separator"></div>
+
+<div class="l-center units">
+
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left super-compact text-center">&nbsp;</div>
+			<div class="clearfix l-unit__stat-col--left"><b><?=_('Category');?></b></div>
+			<div class="clearfix l-unit__stat-col--left wide-6"><b><?=_('Name');?></b></div>
+			<div class="clearfix l-unit__stat-col--left wide-2"><b><?=_('Status');?></b></div>
+
+		</div>
+	</div>
+	<!-- Start of item element-->
+	<div class="l-unit header animated fadeIn">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left super-compact text-center">
+				<i class="fas fa-database status-icon blue"></i>
+			</div>
+			<div class="clearfix l-unit__stat-col--left"><b><?=_('Databases');?></b></div>
+			<div class="clearfix l-unit__stat-col--left wide-6"><b><?=_('phpMyAdmin Single Sign On'); ?></b></div>
+			<div class="clearfix l-unit__stat-col--left wide-2">In final development stages.</div>
+		</div>
+	</div>
+	<!-- End of item element-->
+	<!-- Start of item element-->
+	<div class="l-unit header animated fadeIn">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left super-compact text-center">
+				<i class="fas fa-cog status-icon blue"></i>
+			</div>
+			<div class="clearfix l-unit__stat-col--left"><b><?=_('System');?></b></div>
+			<div class="clearfix l-unit__stat-col--left wide-6"><b><?=_('Policy'); ?>: <?=_('Allow suspended users to log in with read-only access'); ?></b></div>
+			<div class="clearfix l-unit__stat-col--left wide-2">Partially implemented.</div>
+		</div>
+	</div>
+	<!-- End of item element-->
+</div>
+
+<div id="vstobjects">
+	<div class="l-separator"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right clearfix">
+			</div>
+		</div>
+	</div>
+</div>

+ 188 - 190
web/templates/pages/list_services.html

@@ -1,197 +1,195 @@
-    <div class="l-center">
-      <div class="l-sort clearfix noselect">
-        <div class="l-unit-toolbar__buttonstrip">
-          <a href="/edit/server/" class="ui-button cancel" dir="ltr"><i class="fas fa-cog status-icon maroon"></i><?=_('Configure')?></a>
-          <a href="/list/rrd/" class="ui-button cancel" dir="ltr"><i class="fas fa-chart-area status-icon green"></i><?=_('Graphs')?></a>
-          <a href="/list/ip/" class="ui-button cancel" dir="ltr"><i class="fas fa-ethernet status-icon blue"></i><?=_('IP')?></a>
-          <!-- Disable Updates Button 
-          <a href="/list/updates/" class="ui-button cancel" dir="ltr"><i class="fas fa-sync status-icon green"></i><?=_('Updates')?></a>
-          -->
-          <?php if ((isset($_SESSION['FIREWALL_SYSTEM'])) && (!empty($_SESSION['FIREWALL_SYSTEM']))) {?>
-            <a href="/list/firewall/" class="ui-button cancel" dir="ltr"><i class="fas fa-shield-alt status-icon red"></i><?=_('Firewall')?></a>
-          <?php }?>
-          <a href="/list/log/?user=system&token=<?=$_SESSION['token']?>" class="ui-button cancel" dir="ltr"><i class="fas fa-history status-icon lightblue"></i><?=_('Logs')?></a>
-          <div class="actions-panel display-inline-block" key-action="js">
-              <a class="data-controls do_servicerestart ui-button danger cancel">
-                <i class="do_servicerestart fas fa-undo status-icon red"></i><?=_('Restart')?>
-                <input type="hidden" name="servicerestart_url" value="/restart/system/?hostname=<?php echo $sys['sysinfo']['HOSTNAME'] ?>&token=<?=$_SESSION['token']?>&system_reset_token=<?php echo time(); ?>" />
-                  <div class="confirmation-text-servicerestart hidden" title="<?=_('Confirmation')?>">
-                    <p class="confirmation"><?php print sprintf(_('RESTART_CONFIRMATION'), 'Server')?></p>
-                  </div>
-              </a>
-          </div>
-        </div>
-        <ul class="context-menu sort-order animated fadeIn" style="display:none;">
-          <li entity="sort-cpu" sort_as_int="1"><span class="name"><?=_('CPU')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-memory" sort_as_int="1"><span class="name"><?=_('Memory')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-name"><span class="name active"><?=_('Name')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-        </ul>
-        <div class="l-sort-toolbar clearfix">
-          <table>
-            <tr>
-              <td class="sort-by" title="<?=_('Sort items');?>">
-                <?=_('sort by');?>: <span><b><?=_('Name')?> <i class="fas fa-sort-alpha-down"></i></b></span>
-              </td>
-              <td>
-                <form action="/bulk/service/" method="post" id="objects">
-                <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                <div class="l-select">
-                    <select class="" name="action">
-                      <option value=""><?php print _('apply to selected');?></option>
-                      <option value="stop"><?php print _('stop');?></option>
-                      <option value="start"><?php print _('start');?></option>
-                      <option value="restart"><?php print _('restart');?></option>
-                    </select>
-                </div>
-                <button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected')?>"><i class="fas fa-arrow-right"></i></button>
-                </form>
-              </td>
-            </tr>
-          </table>
-        </div>
-      </div>
-    </div>
+<!-- Begin toolbar -->
+<div class="l-center">
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a href="/edit/server/" class="ui-button cancel" dir="ltr"><i class="fas fa-cog status-icon maroon"></i><?=_('Configure');?></a>
+			<a href="/list/rrd/" class="ui-button cancel" dir="ltr"><i class="fas fa-chart-area status-icon green"></i><?=_('Graphs');?></a>
+			<a href="/list/ip/" class="ui-button cancel" dir="ltr"><i class="fas fa-ethernet status-icon blue"></i><?=_('IP');?></a>
+			<?php if ((isset($_SESSION['FIREWALL_SYSTEM'])) && (!empty($_SESSION['FIREWALL_SYSTEM']))) {?>
+				<a href="/list/firewall/" class="ui-button cancel" dir="ltr"><i class="fas fa-shield-alt status-icon red"></i><?=_('Firewall');?></a>
+			<?php }?>
+			<a href="/list/log/?user=system&token=<?=$_SESSION['token']?>" class="ui-button cancel" dir="ltr"><i class="fas fa-history status-icon lightblue"></i><?=_('Logs');?></a>
+			<div class="actions-panel display-inline-block" key-action="js">
+				<a class="data-controls do_servicerestart ui-button danger cancel">
+					<i class="do_servicerestart fas fa-undo status-icon red"></i><?=_('Restart');?>
+					<input type="hidden" name="servicerestart_url" value="/restart/system/?hostname=<?=$sys['sysinfo']['HOSTNAME'] ?>&token=<?=$_SESSION['token']?>&system_reset_token=<?=time(); ?>" />
+					<div class="confirmation-text-servicerestart hidden" title="<?=_('Confirmation');?>">
+						<p class="confirmation"><?=sprintf(_('RESTART_CONFIRMATION'), 'Server');?></p>
+					</div>
+				</a>
+			</div>
+		</div>
+		<ul class="context-menu sort-order animated fadeIn" style="display:none;">
+			<li entity="sort-cpu" sort_as_int="1"><span class="name"><?=_('CPU');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-memory" sort_as_int="1"><span class="name"><?=_('Memory');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-name"><span class="name active"><?=_('Name');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+		</ul>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td class="sort-by" title="<?=_('Sort items');?>">
+						<?=_('sort by');?>: <span><b><?=_('Name');?> <i class="fas fa-sort-alpha-down"></i></b></span>
+					</td>
+					<td>
+						<form action="/bulk/service/" method="post" id="objects">
+							<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+							<div class="l-select">
+								<select class="" name="action">
+									<option value=""><?=_('apply to selected');?></option>
+									<option value="stop"><?=_('stop');?></option>
+									<option value="start"><?=_('start');?></option>
+									<option value="restart"><?=_('restart');?></option>
+								</select>
+							</div>
+							<button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected');?>"><i class="fas fa-arrow-right"></i></button>
+						</form>
+					</td>
+				</tr>
+			</table>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
-  
-    <div class="l-center units">
+<div class="l-separator"></div>
 
-      <div class="">
-        <div class="l-unit__col l-unit__col--right server-info">
-          <div class="icon-server-info"><i class="fas fa-server"></i></div>
-          <div class="l-unit__servername separate server-info-name"><?=$sys['sysinfo']['HOSTNAME']?></div>
-          <div class="server-info-data">
-            <table class="text-small">
-               <tr>
-               <td>
-                  <div class="l-unit__stat-cols clearfix">
-                    <div class="l-unit__stat-col l-unit__stat-col--left wide"><b><?=_('Hestia Control Panel')?>:</b></div>
-                    <div class="l-unit__stat-col l-unit__stat-col--right">
-                      <? if($sys['sysinfo']['RELEASE'] != 'release') { ?>
-                        <i class="fas fa-flask icon-large status-icon red" title="<?php echo $sys['sysinfo']['RELEASE'];?>"></i>
-                      <? } ?>
-                      <? if($sys['sysinfo']['RELEASE'] == 'release') { ?>
-                        <i class="fas fa-cube icon-large status-icon" title="<?=_('Production release')?>"></i>
-                      <? } ?>
-                      &nbsp;v<?=$sys['sysinfo']['HESTIA']?></div>
-                  </div>
-                </td>
-                <td>
-                  <div class="l-unit__stat-cols clearfix">
-                    <div class="l-unit__stat-col l-unit__stat-col--left wide"><b><?=_('Operating System')?>:</b></div>
-                    <div class="l-unit__stat-col l-unit__stat-col--right"><?=$sys['sysinfo']['OS']?> <?=$sys['sysinfo']['VERSION']?> (<?=$sys['sysinfo']['ARCH']?>)</div>
-                  </div>
-                </td>
-                <td>
-                  <div class="l-unit__stat-cols clearfix">
-                    <div class="l-unit__stat-col l-unit__stat-col--left wide"><b><?=_('Load Average')?>:</b></div>
-                    <div class="l-unit__stat-col l-unit__stat-col--right"><?=$sys['sysinfo']['LOADAVERAGE']?></div>
-                  </div>
-                </td>
-                <td>
-                  <div class="l-unit__stat-cols clearfix last">
-                    <div class="l-unit__stat-col l-unit__stat-col--left wide"><b><?=_('Uptime')?>:</b></div>
-                    <div class="l-unit__stat-col l-unit__stat-col--right"><?=humanize_time($sys['sysinfo']['UPTIME'])?></div>
-                  </div>
-                </td>
-              </tr>
-             </table>
-           </div>
-         </div>
-      </div>
+<div class="l-center units">
 
-      <div class="table-header"> 
-        <div class="l-unit__col l-unit__col--right">
-        <div class="clearfix l-unit__stat-col--left super-compact">
-          <input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all')?>" onChange="checkedAll('objects');">
-        </div>
-                    
-        <div class="clearfix l-unit__stat-col--left wide-2"><b><?php print _('Service');?></b></div>
-        <div class="clearfix l-unit__stat-col--left text-right compact-2">&nbsp;</div>
-        <div class="clearfix l-unit__stat-col--left wide-3"><b><?php print _('Description');?></b></div>
-        <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Uptime');?></b></div>
-        <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('CPU');?></b></div>
-        <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Memory');?></b></div>
-      </div>
-    </div>
+	<div class="">
+		<div class="l-unit__col l-unit__col--right server-info">
+			<div class="icon-server-info"><i class="fas fa-server"></i></div>
+			<div class="l-unit__servername separate server-info-name"><?=$sys['sysinfo']['HOSTNAME']?></div>
+			<div class="server-info-data">
+				<table class="text-small">
+					<tr>
+						<td>
+							<div class="l-unit__stat-cols clearfix">
+								<div class="l-unit__stat-col l-unit__stat-col--left wide"><b><?=_('Hestia Control Panel');?>:</b></div>
+								<div class="l-unit__stat-col l-unit__stat-col--right">
+									<?php if ($sys['sysinfo']['RELEASE'] != 'release') { ?>
+										<i class="fas fa-flask icon-large status-icon red" title="<?=$sys['sysinfo']['RELEASE'];?>"></i>
+									<?php } ?>
+									<?php if ($sys['sysinfo']['RELEASE'] == 'release') { ?>
+										<i class="fas fa-cube icon-large status-icon" title="<?=_('Production release');?>"></i>
+									<?php } ?>
+									&nbsp;v<?=$sys['sysinfo']['HESTIA']?></div>
+							</div>
+						</td>
+						<td>
+							<div class="l-unit__stat-cols clearfix">
+								<div class="l-unit__stat-col l-unit__stat-col--left wide"><b><?=_('Operating System');?>:</b></div>
+								<div class="l-unit__stat-col l-unit__stat-col--right"><?=$sys['sysinfo']['OS']?> <?=$sys['sysinfo']['VERSION']?> (<?=$sys['sysinfo']['ARCH']?>)</div>
+							</div>
+						</td>
+						<td>
+							<div class="l-unit__stat-cols clearfix">
+								<div class="l-unit__stat-col l-unit__stat-col--left wide"><b><?=_('Load Average');?>:</b></div>
+								<div class="l-unit__stat-col l-unit__stat-col--right"><?=$sys['sysinfo']['LOADAVERAGE']?></div>
+							</div>
+						</td>
+						<td>
+							<div class="l-unit__stat-cols clearfix last">
+								<div class="l-unit__stat-col l-unit__stat-col--left wide"><b><?=_('Uptime');?>:</b></div>
+								<div class="l-unit__stat-col l-unit__stat-col--right"><?=humanize_time($sys['sysinfo']['UPTIME'])?></div>
+							</div>
+						</td>
+					</tr>
+				</table>
+			</div>
+		</div>
+	</div>
 
-      <?php
-        foreach ($data as $key => $value) {
-        ++$i;
-          if ($data[$key]['STATE'] == 'running') {
-            $status = 'active';
-            $action = 'stop';
-            $spnd_icon = 'fa-stop';
-          } else {
-            $status = 'suspended';
-            $action = 'start';
-            $spnd_icon = 'fa-play';
-          }
+	<div class="table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left super-compact">
+				<input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all');?>" onChange="checkedAll('objects');">
+			</div>
 
-          $cpu = $data[$key]['CPU'] / 10;
-          $cpu = number_format($cpu, 1);
-          if ($cpu == '0.0')  $cpu = 0;
-      ?>
+			<div class="clearfix l-unit__stat-col--left wide-2"><b><?=_('Service');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-right compact-2">&nbsp;</div>
+			<div class="clearfix l-unit__stat-col--left wide-3"><b><?=_('Description');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Uptime');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('CPU');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Memory');?></b></div>
+		</div>
+	</div>
 
-        <div class="l-unit <? if($status == 'suspended') echo 'l-unit--suspended';?> animated fadeIn"  sort-name="<?=strtolower($key)?>"
-          sort-memory="<?=$data[$key]['MEM']?>" sort-cpu="<?=$cpu;?>" sort-uptime="<?=$data[$key]['RTIME']?>">
-          <div class="l-unit__col l-unit__col--right">
-          <div class="clearfix l-unit__stat-col--left super-compact">
-            <input id="check<?php echo $i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select')?>" name="service[]" value="<?php echo $key ?>">
-          </div>
-          <div class="clearfix l-unit__stat-col--left wide-2">
-            <? if($data[$key]['STATE'] == 'running'){ ?>
-                <i class="fas fa-check-circle status-icon green icon-pad-right"></i>
-            <? } else {?>
-                <i class="fas fa-minus-circle status-icon red icon-pad-right"></i>
-            <? } ?>
-            <? if (($key == "php5.6-fpm") || ($key == "php7.0-fpm") || ($key == "php7.1-fpm") || ($key == "php7.2-fpm") || ($key == "php7.3-fpm") || ($key == "php7.4-fpm") || ($key == "php8.0-fpm")) {
-                $edit_url="php";
-            } else {
-                $edit_url=$key;
-            }?>
-            <b><a href="/edit/server/<? echo $edit_url ?>/" title="<?=_('edit')?>: <?=$key?>"><?=$key?></a></b>
-          </div>
-          <div class="clearfix l-unit__stat-col--left text-center compact-2">
-            <div class="actions-panel clearfix">
-              <div class="actions-panel__col actions-panel__edit shortcut-enter" key-action="href">
-                  <a href="/edit/server/<? echo $edit_url ?>/" title="<?=_('edit')?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim icon-large"></i></a>
-              </div>
-              <div class="actions-panel__col actions-panel__stop shortcut-s" key-action="js">
-                  <a id="<?=$spnd_action ?>_link_<?=$i?>" class="data-controls do_servicerestart" title="<?=_('restart')?>">
-                    <i class="do_servicerestart data-controls fas fa-undo status-icon highlight status-icon dim icon-large"></i>
-                  <input type="hidden" name="servicerestart_url" value="/restart/service/?srv=<?=$key?>&token=<?=$_SESSION['token']?>" />
-                  <div id="<?=$spnd_action?>_dialog_<?=$i?>" class="confirmation-text-servicerestart hidden" title="<?=_('Confirmation')?>">
-                    <p class="confirmation"><?php print sprintf(_('RESTART_CONFIRMATION'),$key); ?></p>
-                  </div>
-                </a>
-              </div>
-              <div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
-                <a id="delete_link_<?=$i?>" class="data-controls do_servicestop" title="<?=_($action)?>">
-                  <i class="do_servicestop fas <?=$spnd_icon?> status-icon red status-icon dim icon-large"></i>
-                  <input type="hidden" name="servicestop_url" value="/<?php echo $action ?>/service/?srv=<?=$key?>&token=<?=$_SESSION['token']?>" />
-                    <div id="delete_dialog_<?=$i?>" class="confirmation-text-servicestop hidden" title="<?=_('Confirmation')?>">
-                      <p class="confirmation"><?php if($action == 'stop'){ echo sprintf(_('Are you sure you want to stop service'),$key); }else{ echo sprintf(_('Are you sure you want to start service'),$key); }?></p>
-                    </div>
-                </a>
-              </div>
-            </div>
-          </div>
-          <div class="clearfix l-unit__stat-col--left wide-3"><?=_($data[$key]['SYSTEM'])?></div>
-          <div class="clearfix l-unit__stat-col--left text-center"><b><?=humanize_time($data[$key]['RTIME'])?></b></div>
-          <div class="clearfix l-unit__stat-col--left text-center"><b><?=$cpu?></b></div>
-          <div class="clearfix l-unit__stat-col--left text-center"><b><?=$data[$key]['MEM']?> <?=_('mb')?></b></div>
-        </div>
-      </div>
-      <?}?>
-    </div>
+	<!-- Begin services status list item loop -->
+	<?php
+		foreach ($data as $key => $value) {
+		++$i;
+			if ($data[$key]['STATE'] == 'running') {
+				$status = 'active';
+				$action = 'stop';
+				$spnd_icon = 'fa-stop';
+				$state_icon = 'fa-check-circle status-icon green';
+			} else {
+				$status = 'suspended';
+				$action = 'start';
+				$spnd_icon = 'fa-play';
+				$state_icon = 'fa-minus-circle status-icon red';
+			}
 
-    <div id="vstobjects">
-      <div class="l-separator visible"></div>
-      <div class="l-center">
-        <div class="l-unit-ft">
-          <div class="l-unit__col l-unit__col--left clearfix"></div>
-          <div class="data-count l-unit__col l-unit__col--right clearfix"></div>
-        </div>
-    </div>
-  </div>
+			if (($key == "php5.6-fpm") || ($key == "php7.0-fpm") || ($key == "php7.1-fpm") || ($key == "php7.2-fpm") || ($key == "php7.3-fpm") || ($key == "php7.4-fpm") || ($key == "php8.0-fpm")) {
+				$edit_url="php";
+			} else {
+				$edit_url=$key;
+			}
+
+			$cpu = $data[$key]['CPU'] / 10;
+			$cpu = number_format($cpu, 1);
+			if ($cpu == '0.0')  $cpu = 0;
+		?>
+		<div class="l-unit <?php if ($status == 'suspended') echo 'l-unit--suspended';?> animated fadeIn" sort-name="<?=strtolower($key)?>"
+			sort-memory="<?=$data[$key]['MEM']?>" sort-cpu="<?=$cpu;?>" sort-uptime="<?=$data[$key]['RTIME']?>">
+			<div class="l-unit__col l-unit__col--right">
+				<div class="clearfix l-unit__stat-col--left super-compact">
+					<input id="check<?=$i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select');?>" name="service[]" value="<?=$key?>">
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide-2">
+					<i class="fas <?=$state_icon;?> icon-pad-right"></i>
+					<b><a href="/edit/server/<? echo $edit_url ?>/" title="<?=_('edit');?>: <?=$key?>"><?=$key?></a></b>
+				</div>
+				<div class="clearfix l-unit__stat-col--left text-center compact-2">
+					<div class="actions-panel clearfix">
+						<div class="actions-panel__col actions-panel__edit shortcut-enter" key-action="href">
+							<a href="/edit/server/<? echo $edit_url ?>/" title="<?=_('edit');?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim icon-large"></i></a>
+						</div>
+						<div class="actions-panel__col actions-panel__stop shortcut-s" key-action="js">
+							<a id="<?=$spnd_action ?>_link_<?=$i?>" class="data-controls do_servicerestart" title="<?=_('restart');?>">
+								<i class="do_servicerestart data-controls fas fa-undo status-icon highlight status-icon dim icon-large"></i>
+								<input type="hidden" name="servicerestart_url" value="/restart/service/?srv=<?=$key?>&token=<?=$_SESSION['token']?>" />
+								<div id="<?=$spnd_action?>_dialog_<?=$i?>" class="confirmation-text-servicerestart hidden" title="<?=_('Confirmation');?>">
+									<p class="confirmation"><?=sprintf(_('RESTART_CONFIRMATION'),$key); ?></p>
+								</div>
+							</a>
+						</div>
+						<div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
+							<a id="delete_link_<?=$i?>" class="data-controls do_servicestop" title="<?=_($action)?>">
+								<i class="do_servicestop fas <?=$spnd_icon?> status-icon red status-icon dim icon-large"></i>
+								<input type="hidden" name="servicestop_url" value="/<?=$action ?>/service/?srv=<?=$key?>&token=<?=$_SESSION['token']?>" />
+								<div id="delete_dialog_<?=$i?>" class="confirmation-text-servicestop hidden" title="<?=_('Confirmation');?>">
+									<p class="confirmation"><?php if($action == 'stop'){ echo sprintf(_('Are you sure you want to stop service'),$key); }else{ echo sprintf(_('Are you sure you want to start service'),$key); }?></p>
+								</div>
+							</a>
+						</div>
+					</div>
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide-3"><?=_($data[$key]['SYSTEM'])?></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=humanize_time($data[$key]['RTIME'])?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=$cpu?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=$data[$key]['MEM']?> <?=_('mb');?></b></div>
+			</div>
+		</div>
+	<?php } ?>
+</div>
+
+<div id="vstobjects">
+	<div class="l-separator visible"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<div class="l-unit__col l-unit__col--left clearfix"></div>
+			<div class="data-count l-unit__col l-unit__col--right clearfix"></div>
+		</div>
+	</div>
+</div>

+ 89 - 90
web/templates/pages/list_ssl.html

@@ -1,94 +1,93 @@
-    <div class="l-center">
-      <div class="l-sort clearfix noselect">
-        <div class="l-sort-toolbar clearfix float-left">
+<!-- Begin toolbar -->
+<div class="l-center">
+	<div class="l-sort clearfix noselect">
+		<div class="l-sort-toolbar clearfix float-left">
 
-        </div>
-      </div>
-    </div>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn">
-      <?php
-        $back = $_SESSION['back'];
-        if (empty($back)) {
-          $back = "location.href='/generate/ssl/'";
-        } else {
-          $back = "location.href='".$back."'";
-        }
-      ?>
-        <form id="vstobjects" name="v_generate_csr" method="post">
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <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"><?=_('Generating CSR')?></span>
-                                </td>
-                            <tr>
-                                <td>
-                                    <?php
-                                        if (!empty($_SESSION['error_msg'])) {
-                                          echo "<span class=\"vst-error\"><i class=\"fas fa-exclamation-circle status-icon red\"></i> ".$_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>
+<div class="l-center animated fadeIn">
 
-                            </tr>
-                            </tr>
-                            <tr>
-                                <td class="vst-text" style="padding: 12px 0 0 0;"><?php print _('SSL Certificate');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea size="20" class="vst-textinput" name="v_crt"><?php print $v_crt ?> </textarea>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text" style="padding: 12px 0 0 0;">
-                                    <?php print _('SSL Key');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea size="20" class="vst-textinput" name="v_key"><?php print $v_key ?> </textarea>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td class="vst-text" style="padding: 24px 0 0 0;">
-                                    <?php print _('SSL CSR');?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <textarea size="20" class="vst-textinput" name="v_csr"><?php print $v_csr ?> </textarea>
-                                </td>
-                            </tr>
-                        </table>
-                        <table class="data-col2">
-                            <tr>
-                                <td style="padding: 24px 0 0 0;">
-                                    <input type="button" class="button cancel" value="<?php print _('Back');?>" onclick="<?php echo $back ?>">
-                                </td>
-                            </tr>
-                        </table>
-                    </td>
-                </tr>
-            </table>
-        </form>
-    </div>
+	<form id="vstobjects" name="v_generate_csr" method="post">
+		<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+		<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"><?=_('Generating CSR');?></span>
+							</td>
+						<tr>
+							<td>
+								<?php
+									if (!empty($_SESSION['error_msg'])) {
+										$msg_icon = 'fa-exclamation-circle status-icon red';
+										$msg_text = htmlentities($_SESSION['error_msg']);
+										$msg_id = 'vst-error';
+									} else {
+										if (!empty($_SESSION['ok_msg'])) {
+											$msg_icon = 'fa-check-circle status-icon green';
+											$msg_text = $_SESSION['ok_msg'];
+											$msg_id = 'vst-ok';
+										}
+									}
+								?>
+								<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+							</td>
+						</tr>
+						</tr>
+						<tr>
+							<td class="vst-text" style="padding: 12px 0 0 0;"><?=_('SSL Certificate');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea size="20" class="vst-textinput" name="v_crt"><?=$v_crt ?> </textarea>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text" style="padding: 12px 0 0 0;">
+								<?=_('SSL Key');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea size="20" class="vst-textinput" name="v_key"><?=$v_key ?> </textarea>
+							</td>
+						</tr>
+						<tr>
+							<td class="vst-text" style="padding: 24px 0 0 0;">
+								<?=_('SSL CSR');?>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<textarea size="20" class="vst-textinput" name="v_csr"><?=$v_csr ?> </textarea>
+							</td>
+						</tr>
+					</table>
+					<table class="data-col2">
+						<tr>
+							<td style="padding: 24px 0 0 0;">
+								<input type="button" class="button cancel" value="<?=_('Back');?>" onclick="<?=$back ?>">
+							</td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>

+ 240 - 256
web/templates/pages/list_stats.html

@@ -1,262 +1,246 @@
+<!-- Begin toolbar -->
 <div class="l-center">
-  <div class="l-sort clearfix noselect">
-      <div class="l-unit-toolbar__buttonstrip">
-        <? if (($_SESSION['userContext'] === 'admin') && (!isset($_SESSION['look']))) { ?>
-          <a class="ui-button cancel" dir="ltr" href='/list/stats/'><i class="fas fa-binoculars status-icon lightblue"></i><?=_('Overall Statistics')?></a>
-        <? } ?>
-      </div>
-    <div class="l-sort-toolbar clearfix">
-      <table>
-        <tr>
-            <td class="l-sort-toolbar__search-box">
-                <form action="/search/" method="get">
-                  <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                  <input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search')?>" />
-                  <button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search')?>"><i class="fas fa-search"></i></button>
-                </form>
-              </td>
-        </tr>
-      </table>
-      <? if (($_SESSION['userContext'] === 'admin') && (!isset($_SESSION['look']))) { ?>
-      <table>
-        <tr>
-          <td>
-            <form action="/list/stats/" method="get" id="objects">
-              <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-              <div class="l-select">
-                <select class="" name="user">
-                  <option value=""><?=_('show per user')?></option>
-                    <?
-                      foreach ($users as $key => $value) {
-                        if (($_SESSION['POLICY_SYSTEM_HIDE_ADMIN'] === 'yes') && ($value === 'admin')) {
-
-                        } else {
-                        echo "\t\t\t\t<option value=\"".$value."\"";
-                        if ((!empty($v_user)) && ( $value == $_GET['user'])){
-                          echo ' selected';
-                        }
-                          echo ">".$value."</option>\n";
-                        }
-                      }
-                      ?>
-                </select>
-              </div>
-              <button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected')?>"><i class="fas fa-arrow-right"></i></button>
-            </form>
-          </td>
-        </tr>
-      </table>
-      <? } ?>
-    </div>
-  </div>
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<?php if (($_SESSION['userContext'] === 'admin') && (!isset($_SESSION['look']))) { ?>
+				<a class="ui-button cancel" dir="ltr" href='/list/stats/'><i class="fas fa-binoculars status-icon lightblue"></i><?=_('Overall Statistics');?></a>
+			<?php } ?>
+		</div>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td class="l-sort-toolbar__search-box">
+						<form action="/search/" method="get">
+							<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+							<input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search');?>" />
+							<button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search');?>"><i class="fas fa-search"></i></button>
+						</form>
+					</td>
+				</tr>
+			</table>
+			<?php if (($_SESSION['userContext'] === 'admin') && (!isset($_SESSION['look']))) { ?>
+				<table>
+					<tr>
+						<td>
+							<form action="/list/stats/" method="get" id="objects">
+								<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+								<div class="l-select">
+									<select class="" name="user">
+										<option value=""><?=_('show per user');?></option>
+										<?php
+											foreach ($users as $key => $value) {
+												if (($_SESSION['POLICY_SYSTEM_HIDE_ADMIN'] === 'yes') && ($value === 'admin')) {
+													// Hide admin user from statistics list
+												} else {
+												echo "\t\t\t\t<option value=\"".$value."\"";
+												if ((!empty($v_user)) && ( $value == $_GET['user'])){
+													echo ' selected';
+												}
+													echo ">".$value."</option>\n";
+												}
+											}
+										?>
+									</select>
+								</div>
+								<button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected');?>"><i class="fas fa-arrow-right"></i></button>
+							</form>
+						</td>
+					</tr>
+				</table>
+			<?php } ?>
+		</div>
+	</div>
 </div>
-
+<!-- End toolbar -->
 
 <div class="l-separator"></div>
 
-<div class="l-center units">   
- <?php
-    foreach ($data as $key => $value) {
-    ++$i;
-  ?>
-    <div class="header animated fadeIn">
-      <div class="l-unit <? if($_COOKIE['stats-'.sha1($key)] == 1) echo ' l-unit--starred';?>" uniq-id="stats-<?=sha1($key)?>">
-        <div class="l-unit-toolbar clearfix">
-          <div class="l-unit-toolbar__col l-unit-toolbar__col--left">
-          </div>
-          <!-- l-unit-toolbar__col -->
-          <div class="l-unit-toolbar__col l-unit-toolbar__col--right">
-            <div class="actions-panel clearfix">
-            </div>
-            <!-- /.actiona-panel -->
-          </div>
-          <!-- l-unit-toolbar__col -->
-        </div>
-        <!-- /.l-unit-toolbar -->
-
-        <div class="l-unit__col l-unit__col--left clearfix">
-          <i class="fas fa-chart-bar status-icon dim" style="font-size: 3em;margin-left: 20px;margin-top: 10px;"></i>
-        </div>
-        <!-- /.l-unit__col -->
-        <div class="l-unit__col l-unit__col--right">
-          <div class="l-unit__name separate">
-            <?=_(strftime("%b", strtotime($key))).strftime(" %Y", strtotime($key))?>
-          </div>
-          <div class="l-unit__stats">
-            <table>
-               <tr>
-                <td>
-                  <div class="l-unit__stat-cols clearfix">
-                  <div class="l-unit__stat-cols clearfix graph">
-                    <div class="l-unit__stat-col l-unit__stat-col--left">
-                      <i class="fas fa-exchange-alt status-icon dim large icon-pad-right" title="<?php print _('Bandwidth');?>"></i><b><?=_('Bandwidth')?></b>
-                    </div>
-                    <div class="l-unit__stat-col l-unit__stat-col--right text-right volume">
-                      <b><?=humanize_usage_size($data[$key]['U_BANDWIDTH'])?></b> <?=humanize_usage_measure($data[$key]['U_BANDWIDTH'])?>
-                    </div>
-                  </div>
-                  <div class="l-percent">
-                    <div class="l-percent__fill" style="width: <?=get_percentage($data[$key]['U_BANDWIDTH'],$data[$key]['BANDWIDTH'])?>%"></div>
-                  </div>
-                  <!-- /.percent -->
-                </td>
-                <td>
-                  <div class="l-unit__stat-cols clearfix">
-                    <div class="l-unit__stat-col l-unit__stat-col--left text-right icon-pad-right text-italic"><?=_('Web Domains')?>:</div>
-                    <div class="l-unit__stat-col l-unit__stat-col--right statistics-count">
-                      <b><?=$data[$key]['U_WEB_DOMAINS']?></b>
-                    </div>
-                  </div>
-                </td>
-                <td>
-                  <div class="l-unit__stat-cols clearfix last">
-                    <div class="l-unit__stat-col l-unit__stat-col--left text-right icon-pad-right text-italic"><?=_('Mail Domains')?>:</div>
-                    <div class="l-unit__stat-col l-unit__stat-col--right statistics-count">
-                      <b><?=$data[$key]['U_MAIL_DOMAINS']?></b>
-                    </div>
-                  </div>
-                </td>
-              </tr>
-              
-              <tr>
-                <td>
-                  <div class="l-unit__stat-cols clearfix tiny">
-                      <div class="text-right">
-                        <? if (($_SESSION['userContext'] === 'user') && ($data[$key]['IP_OWNED'] != "0")) {?>
-                          <span style="float: left;font-weight:500;"><?=_('IP Addresses')?>:</span><b><?=$data[$key]['IP_OWNED']?></b> <?=_('IPs')?></span>
-                        <? } ?>
-                      </div>
-                  </div>
-                </td>
-                <td>
-                  <div class="l-unit__stat-cols clearfix">
-                    <div class="l-unit__stat-col l-unit__stat-col--left text-right icon-pad-right text-italic"><?=_('SSL Domains')?>:</div>
-                    <div class="l-unit__stat-col l-unit__stat-col--right statistics-count">
-                      <b><?=$data[$key]['U_WEB_SSL']?></b>
-                    </div>
-                  </div>
-                </td>
-                <td>
-                  <div class="l-unit__stat-cols clearfix last">
-                    <div class="l-unit__stat-col l-unit__stat-col--left text-right icon-pad-right text-italic"><?=_('Mail Accounts')?>:</div>
-                    <div class="l-unit__stat-col l-unit__stat-col--right statistics-count">
-                      <b><?=$data[$key]['U_MAIL_ACCOUNTS']?></b>
-                    </div>
-                  </div>
-                </td>
-              </tr>
-              <tr>
-                <td>
-                  <div class="l-unit__stat-cols clearfix graph">
-                    <div class="l-unit__stat-col l-unit__stat-col--left"><i class="fas fa-hdd status-icon dim large icon-pad-right" title="<?php print _('Disk');?>"></i><b><?=_('Disk')?></b></div>
-                    <div class="l-unit__stat-col l-unit__stat-col--right text-right volume">
-                      <b><?=humanize_usage_size($data[$key]['U_DISK'])?></b> <?=humanize_usage_measure($data[$key]['U_DISK'])?>
-                    </div>
-                  </div>
-                  <div class="l-percent">
-                    <div class="l-percent__fill" style="width: <?=get_percentage($data[$key]['U_DISK'],$data[$key]['DISK_QUOTA'])?>%"></div>
-                  </div>
-                  <!-- /.percent -->
-                </td>
-                <td>
-                  <div class="l-unit__stat-cols clearfix">
-                    <div class="l-unit__stat-col l-unit__stat-col--left text-right icon-pad-right text-italic"><?=_('Web Aliases')?>:</div>
-                    <div class="l-unit__stat-col l-unit__stat-col--right statistics-count">
-                      <b><?=$data[$key]['U_WEB_ALIASES']?></b>
-                    </div>
-                  </div>
-                </td>
-                <td>
-                  <div class="l-unit__stat-cols clearfix last">
-                    <div class="l-unit__stat-col l-unit__stat-col--left text-right icon-pad-right text-italic"><?=_('Databases')?>:</div>
-                    <div class="l-unit__stat-col l-unit__stat-col--right statistics-count">
-                      <b><?=$data[$key]['U_DATABASES']?></b>
-                    </div>
-                  </div>
-                </td>
-              </tr>
-              <tr>
-                <td>
-                  <div class="l-unit__stat-cols clearfix tiny">
-                    <div class="text-right">
-                      <span style="float: left;font-weight:500;"><?=_('Web')?>:</span> <b><?=humanize_usage_size($data[$key]['U_DISK_WEB'])?></b> <?=humanize_usage_measure($data[$key]['U_DISK_WEB'])?>
-                    </div>
-                    <div class="text-right">
-                      <span style="float: left;font-weight:500;"><?=_('Databases')?>:</span> <b><?=humanize_usage_size($data[$key]['U_DISK_DB'])?></b> <?=humanize_usage_measure($data[$key]['U_DISK_DB'])?>
-                    </div>
-                  </div>
-                </td>
-                <td>
-                  <div class="l-unit__stat-cols clearfix">
-                    <div class="l-unit__stat-col l-unit__stat-col--left text-right icon-pad-right text-italic"><?=_('DNS domains')?>:</div>
-                    <div class="l-unit__stat-col l-unit__stat-col--right statistics-count">
-                      <b><?=$data[$key]['U_DNS_DOMAINS']?></b>
-                    </div>
-                  </div>
-                </td>
-                <td>
-                  <div class="l-unit__stat-cols clearfix last">
-                    <div class="l-unit__stat-col l-unit__stat-col--left text-right icon-pad-right text-italic"><?=_('Cron Jobs')?>:</div>
-                    <div class="l-unit__stat-col l-unit__stat-col--right statistics-count">
-                      <b><?=$data[$key]['U_CRON_JOBS']?></b>
-                    </div>
-                  </div>
-                </td>
-              </tr>
-              <tr>
-                <td>
-                  <div class="l-unit__stat-cols clearfix tiny">
-                    <div class="text-right">
-                      <span style="float: left;font-weight:500;"><?=_('Mail')?>:</span> <b><?=humanize_usage_size($data[$key]['U_DISK_MAIL'])?></b> <?=humanize_usage_measure($data[$key]['U_DISK_MAIL'])?>
-                    </div>
-                    <div class="text-right">
-                      <span style="float: left;font-weight:500;"><?=_('User Directories')?>:</span> <b><?=humanize_usage_size($data[$key]['U_DISK_DIRS'])?></b> <?=humanize_usage_measure($data[$key]['U_DISK_DIRS'])?>
-                    </div>
-                  </div>
-                </td>
-                <td>
-                  <div class="l-unit__stat-cols clearfix">
-                    <div class="l-unit__stat-col l-unit__stat-col--left text-right icon-pad-right text-italic"><?=_('DNS records')?>:</div>
-                    <div class="l-unit__stat-col l-unit__stat-col--right statistics-count">
-                      <b><?=$data[$key]['U_DNS_RECORDS']?></b>
-                    </div>
-                  </div>
-                </td>
-                <td>
-                  <div class="l-unit__stat-cols clearfix last">
-                    <div class="l-unit__stat-col l-unit__stat-col--left text-right icon-pad-right text-italic"><?=_('Backups')?>:</div>
-                    <div class="l-unit__stat-col l-unit__stat-col--right statistics-count">
-                      <b><?=$data[$key]['U_BACKUPS']?></b>
-                    </div>
-                  </div>
-                </td>
-              </tr>
-
-            </table>
-          </div>
-        </div>
-          <!-- /.l-unit__stats -->
-        </div>
-        <!-- /.l-unit__col -->
-      </div>
-      <!-- /.l-unit -->
-      <!-- div class="l-separator"></div-->
-      <!-- /.l-separator -->
-      <?}?>
-
-    </div>
+<div class="l-center units">
+	
+	<!-- Begin statistics list item loop -->
+	<?php
+		foreach ($data as $key => $value) {
+		++$i;
+		?>
+		<div class="header animated fadeIn">
+			<div class="l-unit <?php if ($_COOKIE['stats-'.sha1($key)] == 1) echo ' l-unit--starred';?>" uniq-id="stats-<?=sha1($key)?>">
+				<div class="l-unit-toolbar clearfix">
+					<div class="l-unit-toolbar__col l-unit-toolbar__col--left">
+					</div>
+					<div class="l-unit-toolbar__col l-unit-toolbar__col--right">
+						<div class="actions-panel clearfix">
+						</div>
+					</div>
+				</div>
+				<div class="l-unit__col l-unit__col--left clearfix">
+					<i class="fas fa-chart-bar status-icon dim" style="font-size: 3em;margin-left: 20px;margin-top: 10px;"></i>
+				</div>
+				<div class="l-unit__col l-unit__col--right">
+					<div class="l-unit__name separate">
+						<?=_(strftime("%b", strtotime($key))).strftime(" %Y", strtotime($key))?>
+					</div>
+					<div class="l-unit__stats">
+						<table>
+							<tr>
+								<td>
+									<div class="l-unit__stat-cols clearfix">
+										<div class="l-unit__stat-cols clearfix graph">
+											<div class="l-unit__stat-col l-unit__stat-col--left">
+												<i class="fas fa-exchange-alt status-icon dim large icon-pad-right" title="<?=_('Bandwidth');?>"></i><b><?=_('Bandwidth');?></b>
+											</div>
+											<div class="l-unit__stat-col l-unit__stat-col--right text-right volume">
+												<b><?=humanize_usage_size($data[$key]['U_BANDWIDTH'])?></b> <?=humanize_usage_measure($data[$key]['U_BANDWIDTH'])?>
+											</div>
+										</div>
+										<div class="l-percent">
+											<div class="l-percent__fill" style="width: <?=get_percentage($data[$key]['U_BANDWIDTH'],$data[$key]['BANDWIDTH'])?>%"></div>
+										</div>
+								</td>
+								<td>
+									<div class="l-unit__stat-cols clearfix">
+										<div class="l-unit__stat-col l-unit__stat-col--left text-right icon-pad-right text-italic"><?=_('Web Domains');?>:</div>
+										<div class="l-unit__stat-col l-unit__stat-col--right statistics-count">
+											<b><?=$data[$key]['U_WEB_DOMAINS']?></b>
+										</div>
+									</div>
+								</td>
+								<td>
+									<div class="l-unit__stat-cols clearfix last">
+										<div class="l-unit__stat-col l-unit__stat-col--left text-right icon-pad-right text-italic"><?=_('Mail Domains');?>:</div>
+										<div class="l-unit__stat-col l-unit__stat-col--right statistics-count">
+											<b><?=$data[$key]['U_MAIL_DOMAINS']?></b>
+										</div>
+									</div>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<div class="l-unit__stat-cols clearfix tiny">
+										<div class="text-right">
+											<?php if (($_SESSION['userContext'] === 'admin') || ($_SESSION['userContext'] === 'user') && ($data[$key]['IP_OWNED'] != "0")) {?>
+												<span style="float: left;font-weight:500;"><?=_('IP Addresses');?>:</span><b><?=$data[$key]['IP_OWNED']?></b> <?=_('IPs');?></span>
+											<?php } ?>
+										</div>
+									</div>
+								</td>
+								<td>
+									<div class="l-unit__stat-cols clearfix">
+										<div class="l-unit__stat-col l-unit__stat-col--left text-right icon-pad-right text-italic"><?=_('SSL Domains');?>:</div>
+										<div class="l-unit__stat-col l-unit__stat-col--right statistics-count">
+											<b><?=$data[$key]['U_WEB_SSL']?></b>
+										</div>
+									</div>
+								</td>
+								<td>
+									<div class="l-unit__stat-cols clearfix last">
+										<div class="l-unit__stat-col l-unit__stat-col--left text-right icon-pad-right text-italic"><?=_('Mail Accounts');?>:</div>
+										<div class="l-unit__stat-col l-unit__stat-col--right statistics-count">
+											<b><?=$data[$key]['U_MAIL_ACCOUNTS']?></b>
+										</div>
+									</div>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<div class="l-unit__stat-cols clearfix graph">
+										<div class="l-unit__stat-col l-unit__stat-col--left"><i class="fas fa-hdd status-icon dim large icon-pad-right" title="<?=_('Disk');?>"></i><b><?=_('Disk');?></b></div>
+										<div class="l-unit__stat-col l-unit__stat-col--right text-right volume">
+											<b><?=humanize_usage_size($data[$key]['U_DISK'])?></b> <?=humanize_usage_measure($data[$key]['U_DISK'])?>
+										</div>
+									</div>
+									<div class="l-percent">
+										<div class="l-percent__fill" style="width: <?=get_percentage($data[$key]['U_DISK'],$data[$key]['DISK_QUOTA'])?>%"></div>
+									</div>
+								</td>
+								<td>
+									<div class="l-unit__stat-cols clearfix">
+										<div class="l-unit__stat-col l-unit__stat-col--left text-right icon-pad-right text-italic"><?=_('Web Aliases');?>:</div>
+										<div class="l-unit__stat-col l-unit__stat-col--right statistics-count">
+											<b><?=$data[$key]['U_WEB_ALIASES']?></b>
+										</div>
+									</div>
+								</td>
+								<td>
+									<div class="l-unit__stat-cols clearfix last">
+										<div class="l-unit__stat-col l-unit__stat-col--left text-right icon-pad-right text-italic"><?=_('Databases');?>:</div>
+										<div class="l-unit__stat-col l-unit__stat-col--right statistics-count">
+											<b><?=$data[$key]['U_DATABASES']?></b>
+										</div>
+									</div>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<div class="l-unit__stat-cols clearfix tiny">
+										<div class="text-right">
+											<span style="float: left;font-weight:500;"><?=_('Web');?>:</span> <b><?=humanize_usage_size($data[$key]['U_DISK_WEB'])?></b> <?=humanize_usage_measure($data[$key]['U_DISK_WEB'])?>
+										</div>
+										<div class="text-right">
+											<span style="float: left;font-weight:500;"><?=_('Databases');?>:</span> <b><?=humanize_usage_size($data[$key]['U_DISK_DB'])?></b> <?=humanize_usage_measure($data[$key]['U_DISK_DB'])?>
+										</div>
+									</div>
+								</td>
+								<td>
+									<div class="l-unit__stat-cols clearfix">
+										<div class="l-unit__stat-col l-unit__stat-col--left text-right icon-pad-right text-italic"><?=_('DNS domains');?>:</div>
+										<div class="l-unit__stat-col l-unit__stat-col--right statistics-count">
+											<b><?=$data[$key]['U_DNS_DOMAINS']?></b>
+										</div>
+									</div>
+								</td>
+								<td>
+									<div class="l-unit__stat-cols clearfix last">
+										<div class="l-unit__stat-col l-unit__stat-col--left text-right icon-pad-right text-italic"><?=_('Cron Jobs');?>:</div>
+										<div class="l-unit__stat-col l-unit__stat-col--right statistics-count">
+											<b><?=$data[$key]['U_CRON_JOBS']?></b>
+										</div>
+									</div>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									<div class="l-unit__stat-cols clearfix tiny">
+										<div class="text-right">
+											<span style="float: left;font-weight:500;"><?=_('Mail');?>:</span> <b><?=humanize_usage_size($data[$key]['U_DISK_MAIL'])?></b> <?=humanize_usage_measure($data[$key]['U_DISK_MAIL'])?>
+										</div>
+										<div class="text-right">
+											<span style="float: left;font-weight:500;"><?=_('User Directories');?>:</span> <b><?=humanize_usage_size($data[$key]['U_DISK_DIRS'])?></b> <?=humanize_usage_measure($data[$key]['U_DISK_DIRS'])?>
+										</div>
+									</div>
+								</td>
+								<td>
+									<div class="l-unit__stat-cols clearfix">
+										<div class="l-unit__stat-col l-unit__stat-col--left text-right icon-pad-right text-italic"><?=_('DNS records');?>:</div>
+										<div class="l-unit__stat-col l-unit__stat-col--right statistics-count">
+											<b><?=$data[$key]['U_DNS_RECORDS']?></b>
+										</div>
+									</div>
+								</td>
+								<td>
+									<div class="l-unit__stat-cols clearfix last">
+										<div class="l-unit__stat-col l-unit__stat-col--left text-right icon-pad-right text-italic"><?=_('Backups');?>:</div>
+										<div class="l-unit__stat-col l-unit__stat-col--right statistics-count">
+											<b><?=$data[$key]['U_BACKUPS']?></b>
+										</div>
+									</div>
+								</td>
+							</tr>
+						</table>
+					</div>
+				</div>
+			</div>
+		</div>
+	<?php } ?>
+</div>
 
-    <div id="vstobjects">
-        <div class="l-separator"></div>
-    <div class="l-center">
-        <div class="l-unit-ft">
-          <table class='data'></table>
-          <!-- /form -->
-          <div class="data-count l-unit__col l-unit__col--right clearfix">
-            <?php
-              printf(ngettext('%d month', '%d months', $i),$i);
-            ?>
-          </div>
-      </div>
-    </div>
-  </div>
+<div id="vstobjects">
+	<div class="l-separator"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right clearfix">
+				<?php printf(ngettext('%d month', '%d months', $i),$i); ?>
+			</div>
+		</div>
+	</div>
+</div>

+ 92 - 96
web/templates/pages/list_updates.html

@@ -1,102 +1,98 @@
-    <div class="l-center">
-      <div class="l-sort clearfix noselect">
-            <div class="l-unit-toolbar__buttonstrip">
-                <a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/server/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-                <? if($autoupdate == 'Enabled') {
-                  echo '<a class="ui-button cancel" dir="ltr" href="/delete/cron/autoupdate/?token='.$_SESSION['token'].'"><i class="fas fa-toggle-on status-icon green"></i>'._('disable autoupdate').'</a>';
-                } else {
-                  echo '<a class="ui-button cancel" dir="ltr" href="/add/cron/autoupdate/?token='.$_SESSION['token'].'"><i class="fas fa-toggle-off status-icon red"></i>'._('enable autoupdate').'</a>';
-                } ?>
-             </div>
-        <div class="l-sort-toolbar clearfix">
-          <!-- Disable option to perform package updates via web due to timeout issues with current implementation
-          <table>
-            <tr>
-              <td>
-                <form action="/bulk/hestia/" method="post" id="objects">
-                <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                <div class="l-select">
-                  <select name="action" id="">
-                    <option value=""><?=_('apply to selected')?></option>
-                    <option value="update"><?php print _('update') ?></option>
-                  </select>
-                </div>
-                <button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected')?>"><i class="fas fa-arrow-right"></i></button>
-                </form>
-              </td>
-            </tr>
-          </table>
-          -->
-        </div>
-      </div>
-    </div>
+<!-- Begin toolbar -->
+<div class="l-center">
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/server/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+			<?php
+				if($autoupdate == 'Enabled') {
+					$btn_url = '/delete/cron/autoupdate/?token='.$_SESSION['token'].'';
+					$btn_icon = 'fa-toggle-on status-icon green';
+					$btn_label = 'disable autoupdate';
+				} else {
+					$btn_url = '/add/cron/autoupdate/?token='.$_SESSION['token'].'';
+					$btn_icon = 'fa-toggle-off status-icon red';
+					$btn_label = 'enable autoupdate';
+				}
+			?>
+			<a class="ui-button cancel" dir="ltr" href="<?=$btn_url;?>"><i class="fas <?=$btn_icon;?>"></i><?=_($btn_label);?></a>
+		</div>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td>
+						<form action="/bulk/hestia/" method="post" id="objects">
+						<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+						<div class="l-select">
+							<select name="action" id="">
+								<option value=""><?=_('apply to selected');?></option>
+								<option value="update"><?=_('update') ?></option>
+							</select>
+						</div>
+						<button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected');?>"><i class="fas fa-arrow-right"></i></button>
+						</form>
+					</td>
+				</tr>
+			</table>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center units">
-        <div class="header table-header">    
-            <div class="l-unit__col l-unit__col--right">
-              <div>
-                  <div class="clearfix l-unit__stat-col--left super-compact center">
-                    &nbsp;
-                    <!-- <input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all')?>" onChange="checkedAll('objects');"> -->
-                    </div>
-                  <div class="clearfix l-unit__stat-col--left wide"><b><?php print _('Package');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left wide-5"><b><?php print _('Description');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center wide"><b><?php print _('Version');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Status');?></b></div>
-              </div>
-            </div>
-          </div>
-      <?php
-        foreach ($data as $key => $value) {
-          ++$i;
+<div class="l-center units">
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div>
+				<div class="clearfix l-unit__stat-col--left super-compact center">
+					<input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all');?>" onChange="checkedAll('objects');">
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide"><b><?=_('Package');?></b></div>
+				<div class="clearfix l-unit__stat-col--left wide-5"><b><?=_('Description');?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center wide"><b><?=_('Version');?></b></div>
+				<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Status');?></b></div>
+			</div>
+		</div>
+	</div>
+	
+	<!-- Begin update list item loop -->
+	<?php
+		foreach ($data as $key => $value) {
+			++$i;
 
-          if ($data[$key]['UPDATED'] == 'yes') {
-            $status = 'active';
-            $upd_status = 'updated';
-          } else {
-            $status = 'suspended';
-            $upd_status = 'outdated';
-          }
+			if ($data[$key]['UPDATED'] == 'yes') {
+				$status = 'active';
+				$upd_status = 'updated';
+			} else {
+				$status = 'suspended';
+				$upd_status = 'outdated';
+			}
+		?>
+		<div class="l-unit<?php if ($status == 'suspended') echo ' l-unit--outdated';?> animated fadeIn">
+			<div class="l-unit-toolbar clearfix">
+				<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+				</div>
+			</div>
 
-      ?>
-      <div class="l-unit<? if($status == 'suspended') echo ' l-unit--outdated';?> animated fadeIn">
-        <div class="l-unit-toolbar clearfix">
-          <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-          </div>
-        </div>
+			<div class="l-unit__col l-unit__col--right">
+				<div>
+					<div class="clearfix l-unit__stat-col--left super-compact center">
+						<input id="check<?=$i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select');?>" name="pkg[]" value="<?=$key?>">
+					</div>
+					<div class="clearfix l-unit__stat-col--left wide"><b><?=$key?></b></div>
+					<div class="clearfix l-unit__stat-col--left wide-5"><?=_($data[$key]['DESCR'])?></div>
+					<div class="clearfix l-unit__stat-col--left text-center wide"><?=$data[$key]['VERSION'] ?> (<?=$data[$key]['ARCH']?>)</div>
+					<div class="clearfix l-unit__stat-col--left text-center">
+						<?php if ($data[$key]['UPDATED'] == 'no') { echo '<i class="fas fa-exclamation-triangle" style="color: orange;"></i>'; } ?>
+						<?php if ($data[$key]['UPDATED'] == 'yes') { echo '<i class="fas fa-check-circle status-icon green"></i>'; } ?>
+					</div>
+				</div>
+			</div>
+		</div>
+	<?php } ?>
 
-        <div class="l-unit__col l-unit__col--right">
-            <div>
-                <div class="clearfix l-unit__stat-col--left super-compact center">
-                  <i class="fas fa-box-open status-icon dim"></i>
-                  <!-- <input id="check<?php echo $i ?>" class="ch-toggle" type="checkbox" title="<?=_('Select')?>" name="pkg[]" value="<?php echo $key ?>"> -->
-                </div>
-              <div class="clearfix l-unit__stat-col--left wide"><b><?=$key?></b></div>
-              <div class="clearfix l-unit__stat-col--left wide-5"><?=_($data[$key]['DESCR'])?></div>
-              <div class="clearfix l-unit__stat-col--left text-center wide"><?=$data[$key]['VERSION'] ?> (<?=$data[$key]['ARCH']?>)</div>
-              <div class="clearfix l-unit__stat-col--left text-center">
-                  <? if ($data[$key]['UPDATED'] == 'no') {
-                    echo '
-                    <i class="fas fa-exclamation-triangle" style="color: orange;"></i>
-                    ';
-                  }
-                  ?>
-                  <? if ($data[$key]['UPDATED'] == 'yes') {
-                    echo '
-                    <i class="fas fa-check-circle status-icon green"></i></i>
-                    ';
-                  }
-                  ?>
-            </div>
-          </div>
-        </div>
-      </div>
-     <?}?>
+</div>
 
-    </div>
-
-    <div id="vstobjects">
-        <div class="l-separator"></div>
-  </div>
+<div id="vstobjects">
+	<div class="l-separator"></div>
+</div>

+ 192 - 187
web/templates/pages/list_user.html

@@ -1,191 +1,196 @@
-    <div class="l-center">
-      <div class="l-sort clearfix noselect">
-        <div class="l-unit-toolbar__buttonstrip">
-          <a href="/add/user/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add User')?></a>
-          <a href="/list/package/" class="ui-button cancel" dir="ltr"><i class="fas fa-box-open status-icon orange"></i><?=_('Packages')?></a>
-      </div>
-        <ul class="context-menu sort-order animated fadeIn" style="display:none;">
-          <li entity="sort-bandwidth" sort_as_int="1"><span class="name"><?=_('Bandwidth')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-date" sort_as_int="1"><span class="name <? if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-disk" sort_as_int="1"><span class="name"><?=_('Disk')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-name"><span class="name <? if ($_SESSION['userSortOrder'] === 'name') { echo 'active'; } ?>"><?=_('Name')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-        </ul>
-        <div class="l-sort-toolbar clearfix">
-          <table>
-            <tr>
-              <td class="sort-by" title="<?=_('Sort items');?>">
-                <?=_('sort by');?>: <span>
-                  <b>
-                    <? if ($_SESSION['userSortOrder'] === 'name') { $label = 'Name'; } else { $label = 'Date'; } ?>
-                    <?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
-                  </b>
-                </span>
-              </td>
-              <td class="l-sort-toolbar__search-box">
-                  <form action="/search/" method="get">
-                    <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                    <input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search')?>" />
-                    <button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search')?>"><i class="fas fa-search"></i></button>
-                  </form>
-                </td>
-              <td>
-                <form action="/bulk/user/" method="post" id="objects">
-                  <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                  <div class="l-select">
-                    <select class="" name="action">
-                      <option value=""><?=_('apply to selected')?></option>
-                      <option value="rebuild"><?=_('rebuild')?></option>
-                      <option value="rebuild user"><?=_('rebuild user')?></option>
-                      <option value="rebuild web"><?=_('rebuild web')?></option>
-                      <option value="rebuild dns"><?=_('rebuild dns')?></option>
-                      <option value="rebuild mail"><?=_('rebuild mail')?></option>
-                      <option value="rebuild db"><?=_('rebuild db')?></option>
-                      <option value="rebuild cron"><?=_('rebuild cron')?></option>
-                      <option value="update counters"><?=_('update counters')?></option>
-                      <option value="suspend"><?= _('suspend')?></option>
-                      <option value="unsuspend"><?=_('unsuspend')?></option>
-                      <option value="delete"><?=_('delete')?></option>
-                    </select>
-                  </div>
-                  <button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected')?>"><i class="fas fa-arrow-right"></i></button>
-                </form>
-              </td>
-            </tr>
-          </table>
-        </div>
-      </div>
-    </div>
+<!-- Begin toolbar -->
+<div class="l-center">
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a href="/add/user/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add User');?></a>
+			<a href="/list/package/" class="ui-button cancel" dir="ltr"><i class="fas fa-box-open status-icon orange"></i><?=_('Packages');?></a>
+		</div>
+		<ul class="context-menu sort-order animated fadeIn" style="display:none;">
+			<li entity="sort-bandwidth" sort_as_int="1"><span class="name"><?=_('Bandwidth');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-date" sort_as_int="1"><span class="name <?php if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-disk" sort_as_int="1"><span class="name"><?=_('Disk');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-name"><span class="name <?php if ($_SESSION['userSortOrder'] === 'name') { echo 'active'; } ?>"><?=_('Name');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+		</ul>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td class="sort-by" title="<?=_('Sort items');?>">
+						<?=_('sort by');?>: <span>
+							<b>
+								<?php if ($_SESSION['userSortOrder'] === 'name') { $label = 'Name'; } else { $label = 'Date'; } ?>
+								<?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
+							</b>
+						</span>
+					</td>
+					<td class="l-sort-toolbar__search-box">
+						<form action="/search/" method="get">
+							<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+							<input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search');?>" />
+							<button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search');?>"><i class="fas fa-search"></i></button>
+						</form>
+					</td>
+					<td>
+						<form action="/bulk/user/" method="post" id="objects">
+							<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+							<div class="l-select">
+								<select class="" name="action">
+									<option value=""><?=_('apply to selected');?></option>
+									<option value="rebuild"><?=_('rebuild');?></option>
+									<option value="rebuild user"><?=_('rebuild user');?></option>
+									<option value="rebuild web"><?=_('rebuild web');?></option>
+									<option value="rebuild dns"><?=_('rebuild dns');?></option>
+									<option value="rebuild mail"><?=_('rebuild mail');?></option>
+									<option value="rebuild db"><?=_('rebuild db');?></option>
+									<option value="rebuild cron"><?=_('rebuild cron');?></option>
+									<option value="update counters"><?=_('update counters');?></option>
+									<option value="suspend"><?= _('suspend');?></option>
+									<option value="unsuspend"><?=_('unsuspend');?></option>
+									<option value="delete"><?=_('delete');?></option>
+								</select>
+							</div>
+							<button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected');?>"><i class="fas fa-arrow-right"></i></button>
+						</form>
+					</td>
+				</tr>
+			</table>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center units">
-        <div class="table-header"> 
-            <div class="l-unit__col l-unit__col--right">
-                  <div class="clearfix l-unit__stat-col--left super-compact">
-                    <input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all')?>" onChange="checkedAll('objects');">
-                  </div>
-                  <div class="clearfix l-unit__stat-col--left wide-3"><b><?php print _('Name');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left compact-3"><b>&nbsp;</b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Package');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><?php print _('IPs');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-hdd" title="<?php print _('Disk');?>"></i></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center compact"><b><i class="fas fa-exchange-alt" title="<?php print _('Bandwidth');?>"></i></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-globe-americas" title="<?php print _('Web Domains');?>"></i></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-atlas" title="<?php print _('DNS Domains');?>"></i></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-mail-bulk" title="<?php print _('Mail Domains');?>"></i></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-database" title="<?php print _('Databases');?>"></i></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-clock" title="<?php print _('Cron Jobs');?>"></i></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-file-archive" title="<?php print _('Backups');?>"></i></b></div>
-             </div>
-          </div>
+<div class="l-center units">
 
-      <?php
-        foreach ($data as $key => $value) {
-          ++$i;
-          if ($data[$key]['SUSPENDED'] == 'yes') {
-            $status = 'suspended';
-            $spnd_action = 'unsuspend';
-            $spnd_icon = 'fa-play';
-            $spnd_confirmation = _('UNSUSPEND_USER_CONFIRMATION');
-          } else {
-            $status = 'active';
-            $spnd_action = 'suspend';
-            $spnd_icon = 'fa-pause';
-            $spnd_confirmation = _('SUSPEND_USER_CONFIRMATION');
-          }
-      ?>
-      <div class="l-unit <? if($status == 'suspended') echo 'l-unit--suspended'; if($_SESSION['favourites']['USER'][$key] == 1) echo ' l-unit--starred';?> animated fadeIn" v_section="user"
-v_unit_id="<?=$key?>" sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>" sort-name="<?=strtolower($key)?>"
-sort-bandwidth="<?=$data[$key]['U_BANDWIDTH']?>" sort-disk="<?=$data[$key]['U_DISK']?>" sort-star="<? if($_SESSION['favourites']['USER'][$key] == 1) echo '1'; else echo '0'; ?>">
-        <div class="l-unit__col l-unit__col--right" style="<? if (($_SESSION['POLICY_SYSTEM_HIDE_ADMIN'] === 'yes') && ($_SESSION['user'] !== 'admin') && ($key === 'admin')) { echo 'display: none';} else {echo 'display: table-cell';}?>">
-          <div class="clearfix l-unit__stat-col--left super-compact">
-            <input id="check<?=$i?>" class="ch-toggle" type="checkbox" title="<?=_('Select')?>" name="user[]" value="<?=$key?>">
-          </div>
-               <div class="clearfix l-unit__stat-col--left wide-3 userlist-username">
-                  <? if ($key == $user) { ?>
-                    <b><a href="/edit/user/?user=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing User')?>"><?=$key?> <span style="font-weight: normal !important;">(<?php echo $data[$key]['NAME'];?>)</span></b></a>
-                  <? } else { ?>
-                    <b><a href="/login/?loginas=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('login as')?> <?=$key?>"><?=$key?> <span style="font-weight: normal !important;">(<?php echo $data[$key]['NAME'];?>)</span></b></a>
-                  <? } ?>
-                  <br />
-                <div class="userlist-email"><b><?=_('Email')?>:</b> <?=$data[$key]['CONTACT']?></div>
-              </div>
-              <!-- START QUICK ACTION TOOLBAR AREA -->
-              <div class="clearfix l-unit__stat-col--left text-right compact-3">
-                    <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-                        <div class="actions-panel clearfix">
-                            <? if ($key == $user) { ?>
-                              <i class="fas fa-user-check status-icon status-icon dim icon-large" title="<?=$key?> (<?=$data[$key]['NAME']?>)"></i>
-                            <? } else { ?>
-                              <a href="/login/?loginas=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('login as')?> <?=$key?>"><i class="fas fa-sign-in-alt status-icon green status-icon dim icon-large"></i></a>
-                            <? } ?>
-                            <? if (($_SESSION['userContext'] === 'admin') && ($key == 'admin') && ($_SESSION['user'] != 'admin')) { ?>
-                              <!-- Hide edit button from admin user when logged in with another admin user -->
-                              &nbsp;
-                            <? } else {?>
-                              <div class="actions-panel__col actions-panel__edit shortcut-enter" key-action="href"><a href="/edit/user/?user=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing User')?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
-                            <? } ?>
-                            <? if ($key == 'admin') { ?>
-                              <!-- Hide suspend and delete buttons in the user list for primary 'admin' account -->
-                            <? } else {?>
-                              <? if ($key == $user) { ?>
-                                <!-- Hide suspend and delete buttons in the user list for current user -->
-                                <? } else {?>
-                                  <div class="actions-panel__col actions-panel__suspend shortcut-s" key-action="js">
-                                    <a id="<?=$spnd_action ?>_link_<?=$i?>" class="data-controls do_<?=$spnd_action?>" title="<?=_($spnd_action)?>">
-                                      <i class="fas <?=$spnd_icon?> status-icon highlight status-icon dim do_<?=$spnd_action?>"></i>
-                                      <input type="hidden" name="<?=$spnd_action?>_url" value="/<?=$spnd_action?>/user/?user=<?=$key?>&token=<?=$_SESSION['token']?>" />
-                                      <div id="<?=$spnd_action?>_dialog_<?=$i?>" class="confirmation-text-suspention hidden" title="<?=_('Confirmation')?>">
-                                        <p class="confirmation"><?=sprintf($spnd_confirmation,$key)?></p>
-                                      </div>
-                                    </a>
-                                  </div>
-                                  <div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
-                                    <a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete')?>">
-                                      <i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
-                                      <input type="hidden" name="delete_url" value="/delete/user/?user=<?=$key?>&token=<?=$_SESSION['token']?>" />
-                                      <div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
-                                        <p class="confirmation"><?=sprintf(_('DELETE_USER_CONFIRMATION'),$key)?></p>
-                                      </div>
-                                    </a>
-                                  </div>
-                                <? } ?>
-                            <? } ?>
-                            </div>
-                      </div>
-              </div>
-              <!-- END QUICK ACTION TOOLBAR AREA -->
-              <div class="clearfix l-unit__stat-col--left text-center"><b>
-                <? if ($data[$key]['PACKAGE'] === 'default' ){?>
-                  <?=$data[$key]['PACKAGE']?>
-                <?} else {?>
-                  <a href="/edit/package/?package=<?=$data[$key]['PACKAGE']?>&token=<?=$_SESSION['token']?>" title="<?=_('Edit Package')?>"><?=$data[$key]['PACKAGE']?></a>
-                <?}?>
-                </b></div>
-              <div class="clearfix l-unit__stat-col--left text-center super-compact"><?=$data[$key]['IP_OWNED']?></div>
-              <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><?=humanize_usage_size($data[$key]['U_DISK'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['U_DISK'])?></span></div>
-              <div class="clearfix l-unit__stat-col--left text-center compact"><b><?=humanize_usage_size($data[$key]['U_BANDWIDTH'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['U_BANDWIDTH'])?></span></div>
-              <div class="clearfix l-unit__stat-col--left text-center super-compact" title="<?=$data[$key]['U_WEB_DOMAINS']?> <?php print _('Web Domains');?>"><span class="jump-top badge gray raised"><b><?=$data[$key]['U_WEB_DOMAINS']?></b></span></div>
-              <div class="clearfix l-unit__stat-col--left text-center super-compact" title="<?=$data[$key]['U_DNS_DOMAINS']?> <?php print _('DNS Domains');?>"><span class="jump-top badge gray raised"><b><?=$data[$key]['U_DNS_DOMAINS']?></b></span></div>
-              <div class="clearfix l-unit__stat-col--left text-center super-compact" title="<?=$data[$key]['U_MAIL_DOMAINS']?> <?php print _('Mail Domains');?>"><span class="jump-top badge gray raised"><b><?=$data[$key]['U_MAIL_DOMAINS']?></b></span></div>
-              <div class="clearfix l-unit__stat-col--left text-center super-compact" title="<?=$data[$key]['U_DATABASES']?> <?php print _('Databases');?>"><span class="jump-top badge gray raised"><b><?=$data[$key]['U_DATABASES']?></b></span></div>
-              <div class="clearfix l-unit__stat-col--left text-center super-compact" title="<?=$data[$key]['U_CRON_JOBS']?> <?php print _('Cron Jobs');?>"><span class="jump-top badge gray raised"><b><?=$data[$key]['U_CRON_JOBS']?></b></span></div>
-              <div class="clearfix l-unit__stat-col--left text-center super-compact" title="<?=$data[$key]['U_BACKUPS']?> <?php print _('Backups');?>"><span class="jump-top badge gray raised"><b><?=$data[$key]['U_BACKUPS']?></b></span></div>
-          </div>
-         </div>
-      <?}?>
-    </div>
+	<!-- Table header -->
+	<div class="table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left super-compact">
+				<input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all');?>" onChange="checkedAll('objects');">
+			</div>
+			<div class="clearfix l-unit__stat-col--left wide-3"><b><?=_('Name');?></b></div>
+			<div class="clearfix l-unit__stat-col--left compact-3"><b>&nbsp;</b></div>
+			<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Package');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center super-compact"><b><?=_('IPs');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-hdd" title="<?=_('Disk');?>"></i></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact"><b><i class="fas fa-exchange-alt" title="<?=_('Bandwidth');?>"></i></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-globe-americas" title="<?=_('Web Domains');?>"></i></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-atlas" title="<?=_('DNS Domains');?>"></i></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-mail-bulk" title="<?=_('Mail Domains');?>"></i></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-database" title="<?=_('Databases');?>"></i></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-clock" title="<?=_('Cron Jobs');?>"></i></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-file-archive" title="<?=_('Backups');?>"></i></b></div>
+		</div>
+	</div>
 
-    <div id="vstobjects">
-        <div class="l-separator visible"></div>
-    <div class="l-center">
-        <div class="l-unit-ft">
-          <table class='data'></table>
-          <div class="data-count l-unit__col l-unit__col--right clearfix">
-            <?php
-              printf(ngettext('%d user account', '%d user accounts', $i),$i);
-            ?>
-          </div>
-      </div>
-    </div>
-  </div>
+	<!-- Begin user list item loop -->
+	<?php
+		foreach ($data as $key => $value) {
+			++$i;
+			if ($data[$key]['SUSPENDED'] == 'yes') {
+				$status = 'suspended';
+				$spnd_action = 'unsuspend';
+				$spnd_icon = 'fa-play';
+				$spnd_confirmation = _('UNSUSPEND_USER_CONFIRMATION');
+			} else {
+				$status = 'active';
+				$spnd_action = 'suspend';
+				$spnd_icon = 'fa-pause';
+				$spnd_confirmation = _('SUSPEND_USER_CONFIRMATION');
+			}
+		?>
+		<div class="l-unit <?php if ($status == 'suspended') echo 'l-unit--suspended'; if($_SESSION['favourites']['USER'][$key] == 1) echo ' l-unit--starred';?> animated fadeIn" v_section="user"
+			v_unit_id="<?=$key?>" sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>" sort-name="<?=strtolower($key)?>"
+			sort-bandwidth="<?=$data[$key]['U_BANDWIDTH']?>" sort-disk="<?=$data[$key]['U_DISK']?>" sort-star="<?php if ($_SESSION['favourites']['USER'][$key] == 1) echo '1'; else echo '0'; ?>">
+			<div class="l-unit__col l-unit__col--right" style="<?php if (($_SESSION['POLICY_SYSTEM_HIDE_ADMIN'] === 'yes') && ($_SESSION['user'] !== 'admin') && ($key === 'admin')) { echo 'display: none';} else {echo 'display: table-cell';}?>">
+				<div class="clearfix l-unit__stat-col--left super-compact">
+					<input id="check<?=$i?>" class="ch-toggle" type="checkbox" title="<?=_('Select');?>" name="user[]" value="<?=$key?>">
+				</div>
+				<div class="clearfix l-unit__stat-col--left wide-3 userlist-username">
+					<?php if ($key == $user) { ?>
+						<b><a href="/edit/user/?user=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing User');?>"><?=$key?> <span style="font-weight: normal !important;">(<?=$data[$key]['NAME'];?>)</span></b></a>
+					<?php } else { ?>
+						<b><a href="/login/?loginas=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('login as');?> <?=$key?>"><?=$key?> <span style="font-weight: normal !important;">(<?=$data[$key]['NAME'];?>)</span></b></a>
+					<?php } ?>
+					<br />
+					<div class="userlist-email"><b><?=_('Email');?>:</b> <?=$data[$key]['CONTACT']?></div>
+				</div>
+				<!-- START QUICK ACTION TOOLBAR AREA -->
+				<div class="clearfix l-unit__stat-col--left text-right compact-3">
+					<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+						<div class="actions-panel clearfix">
+							<?php if ($key == $user) { ?>
+								<i class="fas fa-user-check status-icon status-icon dim icon-large" title="<?=$key?> (<?=$data[$key]['NAME']?>)"></i>
+							<?php } else { ?>
+								<a href="/login/?loginas=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('login as');?> <?=$key?>"><i class="fas fa-sign-in-alt status-icon green status-icon dim icon-large"></i></a>
+							<?php } ?>
+							<?php if (($_SESSION['userContext'] === 'admin') && ($key == 'admin') && ($_SESSION['user'] != 'admin')) { ?>
+								<!-- Hide edit button from admin user when logged in with another admin user -->
+								&nbsp;
+							<?php } else { ?>
+								<div class="actions-panel__col actions-panel__edit shortcut-enter" key-action="href"><a href="/edit/user/?user=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing User');?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
+							<?php } ?>
+							<?php if ($key == 'admin') { ?>
+								<!-- Hide suspend and delete buttons in the user list for primary 'admin' account -->
+							<?php } else { ?>
+								<?php if ($key == $user) { ?>
+									<!-- Hide suspend and delete buttons in the user list for current user -->
+								<?php } else { ?>
+								<div class="actions-panel__col actions-panel__suspend shortcut-s" key-action="js">
+									<a id="<?=$spnd_action ?>_link_<?=$i?>" class="data-controls do_<?=$spnd_action?>" title="<?=_($spnd_action)?>">
+										<i class="fas <?=$spnd_icon?> status-icon highlight status-icon dim do_<?=$spnd_action?>"></i>
+										<input type="hidden" name="<?=$spnd_action?>_url" value="/<?=$spnd_action?>/user/?user=<?=$key?>&token=<?=$_SESSION['token']?>" />
+										<div id="<?=$spnd_action?>_dialog_<?=$i?>" class="confirmation-text-suspention hidden" title="<?=_('Confirmation');?>">
+											<p class="confirmation"><?=sprintf($spnd_confirmation,$key)?></p>
+										</div>
+									</a>
+								</div>
+								<div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
+									<a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete');?>">
+										<i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
+										<input type="hidden" name="delete_url" value="/delete/user/?user=<?=$key?>&token=<?=$_SESSION['token']?>" />
+										<div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation');?>">
+											<p class="confirmation"><?=sprintf(_('DELETE_USER_CONFIRMATION'),$key)?></p>
+										</div>
+									</a>
+								</div>
+								<?php } ?>
+							<?php } ?>
+						</div>
+					</div>
+				</div>
+				<!-- END QUICK ACTION TOOLBAR AREA -->
+				<div class="clearfix l-unit__stat-col--left text-center">
+					<b>
+						<?php if ($data[$key]['PACKAGE'] === 'default' ){?>
+							<?=$data[$key]['PACKAGE']?>
+						<?php } else { ?>
+							<a href="/edit/package/?package=<?=$data[$key]['PACKAGE']?>&token=<?=$_SESSION['token']?>" title="<?=_('Edit Package');?>"><?=$data[$key]['PACKAGE']?></a>
+						<?php } ?>
+					</b>
+				</div>
+				<div class="clearfix l-unit__stat-col--left text-center super-compact"><?=$data[$key]['IP_OWNED']?></div>
+				<div class="clearfix l-unit__stat-col--left text-center super-compact"><b><?=humanize_usage_size($data[$key]['U_DISK'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['U_DISK'])?></span></div>
+				<div class="clearfix l-unit__stat-col--left text-center compact"><b><?=humanize_usage_size($data[$key]['U_BANDWIDTH'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['U_BANDWIDTH'])?></span></div>
+				<div class="clearfix l-unit__stat-col--left text-center super-compact" title="<?=$data[$key]['U_WEB_DOMAINS']?> <?=_('Web Domains');?>"><span class="jump-top badge gray raised"><b><?=$data[$key]['U_WEB_DOMAINS']?></b></span></div>
+				<div class="clearfix l-unit__stat-col--left text-center super-compact" title="<?=$data[$key]['U_DNS_DOMAINS']?> <?=_('DNS Domains');?>"><span class="jump-top badge gray raised"><b><?=$data[$key]['U_DNS_DOMAINS']?></b></span></div>
+				<div class="clearfix l-unit__stat-col--left text-center super-compact" title="<?=$data[$key]['U_MAIL_DOMAINS']?> <?=_('Mail Domains');?>"><span class="jump-top badge gray raised"><b><?=$data[$key]['U_MAIL_DOMAINS']?></b></span></div>
+				<div class="clearfix l-unit__stat-col--left text-center super-compact" title="<?=$data[$key]['U_DATABASES']?> <?=_('Databases');?>"><span class="jump-top badge gray raised"><b><?=$data[$key]['U_DATABASES']?></b></span></div>
+				<div class="clearfix l-unit__stat-col--left text-center super-compact" title="<?=$data[$key]['U_CRON_JOBS']?> <?=_('Cron Jobs');?>"><span class="jump-top badge gray raised"><b><?=$data[$key]['U_CRON_JOBS']?></b></span></div>
+				<div class="clearfix l-unit__stat-col--left text-center super-compact" title="<?=$data[$key]['U_BACKUPS']?> <?=_('Backups');?>"><span class="jump-top badge gray raised"><b><?=$data[$key]['U_BACKUPS']?></b></span></div>
+			</div>
+		</div>
+	<?php } ?>
+</div>
+
+<div id="vstobjects">
+	<div class="l-separator visible"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right clearfix">
+				<?php printf(ngettext('%d user account', '%d user accounts', $i),$i); ?>
+			</div>
+		</div>
+	</div>
+</div>

+ 239 - 240
web/templates/pages/list_web.html

@@ -1,250 +1,249 @@
-  <div class="l-center">
-      <div class="l-sort clearfix noselect">
-        <div class="l-unit-toolbar__buttonstrip">
-          <? if ($read_only === 'true') {?>
-            <!-- Hide item creation button when impersonating 'admin' account -->
-          <? } else {?>
-            <a href="/add/web/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add Web Domain')?></a>
-          <? } ?>
-        </div>
-        <ul class="context-menu sort-order animated fadeIn" style="display:none;">
-          <li entity="sort-bandwidth" sort_as_int="1"><span class="name"><?=_('Bandwidth')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-date" sort_as_int="1"><span class="name <? if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-disk" sort_as_int="1"><span class="name"><?=_('Disk')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-name"><span class="name <? if ($_SESSION['userSortOrder'] === 'name') { echo 'active'; } ?>"><?=_('Name')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-          <li entity="sort-ip" sort_as_int="1"><span class="name"><?=_('IP address')?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
-        </ul>
-        <div class="l-sort-toolbar clearfix">
-          <table>
-            <tr>
-              <td class="sort-by" title="<?=_('Sort items');?>">
-                <?=_('sort by');?>: <span>
-                  <b>
-                    <? if ($_SESSION['userSortOrder'] === 'name') { $label = 'Name'; } else { $label = 'Date'; } ?>
-                    <?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
-                  </b>
-                </span>
-              </td>
-              <td class="l-sort-toolbar__search-box">
-                <form action="/search/" method="get">
-                  <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                  <input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search')?>" />
-                  <button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search')?>"><i class="fas fa-search"></i></button>
-                </form>
-              </td>
-              <? if ($read_only === 'true') {?>
-                <!-- Hide bulk actions for domain items when impersonating 'admin' account-->
-              <? } else { ?>
-                <td>
-                  <form action="/bulk/web/" method="post" id="objects">
-                  <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-                  <div class="l-select">
-                    <select name="action">
-                      <option value=""><?=_('apply to selected')?></option>
-                      <? if ($_SESSION['userContext'] === 'admin') {?>
-                        <option value="rebuild"><?=_('rebuild')?></option>
-                      <? } ?>
-                      <option value="suspend"><?=_('suspend')?></option>
-                      <option value="unsuspend"><?=_('unsuspend')?></option>
-                      <option value="delete"><?=_('delete')?></option>
-                    </select>
-                  </div>
-                  <button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected')?>"><i class="fas fa-arrow-right"></i></button>
-                  </form>
-                </td>
-              <? } ?>
-            </tr>
-          </table>
-        </div>
-      </div>
-    </div>
+<!-- Begin toolbar -->
+<div class="l-center">
+	<div class="l-sort clearfix noselect">
+		<div class="l-unit-toolbar__buttonstrip">
+			<?php if ($read_only !== 'true') {?>
+				<a href="/add/web/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i><?=_('Add Web Domain');?></a>
+			<?php } ?>
+		</div>
+		<ul class="context-menu sort-order animated fadeIn" style="display:none;">
+			<li entity="sort-bandwidth" sort_as_int="1"><span class="name"><?=_('Bandwidth');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-date" sort_as_int="1"><span class="name <?php if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?=_('Date');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-disk" sort_as_int="1"><span class="name"><?=_('Disk');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-name"><span class="name <?php if ($_SESSION['userSortOrder'] === 'name') { echo 'active'; } ?>"><?=_('Name');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+			<li entity="sort-ip" sort_as_int="1"><span class="name"><?=_('IP address');?> <i class="fas fa-sort-alpha-down"></i></span><span class="up"><i class="fas fa-sort-alpha-up"></i></span></li>
+		</ul>
+		<div class="l-sort-toolbar clearfix">
+			<table>
+				<tr>
+					<td class="sort-by" title="<?=_('Sort items');?>">
+						<?=_('sort by');?>: <span>
+							<b>
+								<?php if ($_SESSION['userSortOrder'] === 'name') { $label = 'Name'; } else { $label = 'Date'; } ?>
+								<?=_($label)?> <i class="fas fa-sort-alpha-down"></i>
+							</b>
+						</span>
+					</td>
+					<td class="l-sort-toolbar__search-box">
+						<form action="/search/" method="get">
+							<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+							<input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?=_('Search');?>" />
+							<button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value="" title="<?=_('Search');?>"><i class="fas fa-search"></i></button>
+						</form>
+					</td>
+					<?php if ($read_only !== 'true') {?>
+						<td>
+							<form action="/bulk/web/" method="post" id="objects">
+								<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+								<div class="l-select">
+									<select name="action">
+										<option value=""><?=_('apply to selected');?></option>
+										<?php if ($_SESSION['userContext'] === 'admin') {?>
+											<option value="rebuild"><?=_('rebuild');?></option>
+										<?php } ?>
+										<option value="suspend"><?=_('suspend');?></option>
+										<option value="unsuspend"><?=_('unsuspend');?></option>
+										<option value="delete"><?=_('delete');?></option>
+									</select>
+								</div>
+								<button type="submit" class="l-sort-toolbar__filter-apply" value="" title="<?=_('apply to selected');?>"><i class="fas fa-arrow-right"></i></button>
+							</form>
+						</td>
+					<?php } ?>
+				</tr>
+			</table>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center units narrow">
-        <div class="header table-header">      
-            <div class="l-unit__col l-unit__col--right">
-                <div class="clearfix l-unit__stat-col--left super-compact">
-                  <input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all')?>" onChange="checkedAll('objects');" <?=$display_mode;?>>
-                </div>
-                <div class="clearfix l-unit__stat-col--left wide-4"><b><?php print _('Name');?></b></div>
-                <div class="clearfix l-unit__stat-col--left compact-4 text-right"><b>&nbsp;</b></div>
-                <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('IP address');?></b></div>
-                <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('Disk');?></b></div>
-                <div class="clearfix l-unit__stat-col--left text-center compact"><b><?php print _('Bandwidth');?></b></div>
-                <div class="clearfix l-unit__stat-col--left text-center"><b><?php print _('SSL');?></b></div>
-                <div class="clearfix l-unit__stat-col--left text-center compact"><b><?php print _('Statistics');?></b></div>
-             </div>
-         </div>
-                <?php
-                    foreach ($data as $key => $value) {
-                        ++$i;
-                        if ($data[$key]['SUSPENDED'] == 'yes') {
-                            $status = 'suspended';
-                            $spnd_action = 'unsuspend';
-                            $spnd_icon = 'fa-play';
-                            $spnd_confirmation = _('UNSUSPEND_DOMAIN_CONFIRMATION');
-                        } else {
-                            $status = 'active';
-                            $spnd_action = 'suspend';
-                            $spnd_icon = 'fa-pause';
-                            $spnd_confirmation = _('SUSPEND_DOMAIN_CONFIRMATION');
-                        }
-                        if (!empty($data[$key]['SSL_HOME'])) {
-                            if ($data[$key]['SSL_HOME'] == 'same') {
-                                $ssl_home = 'public_html';
-                            } else {
-                                $ssl_home = 'public_shtml';
-                            }
-                        } else {
-                            $ssl_home = '';
-                        }
-                        $web_stats='no';
-                        if (!empty($data[$key]['STATS'])) {
-                            $web_stats=$data[$key]['STATS'];
-                        }
-                        $ftp_user='no';
-                        if (!empty($data[$key]['FTP_USER'])) {
-                            $ftp_user=$data[$key]['FTP_USER'];
+<div class="l-center units narrow">
+	
+	<!-- Table header -->
+	<div class="header table-header">
+		<div class="l-unit__col l-unit__col--right">
+			<div class="clearfix l-unit__stat-col--left super-compact">
+				<input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" title="<?=_('Select all');?>" onChange="checkedAll('objects');" <?=$display_mode;?>>
+			</div>
+			<div class="clearfix l-unit__stat-col--left wide-4"><b><?=_('Name');?></b></div>
+			<div class="clearfix l-unit__stat-col--left compact-4 text-right"><b>&nbsp;</b></div>
+			<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('IP address');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('Disk');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact"><b><?=_('Bandwidth');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center"><b><?=_('SSL');?></b></div>
+			<div class="clearfix l-unit__stat-col--left text-center compact"><b><?=_('Statistics');?></b></div>
+		</div>
+	</div>
 
-                        }
-                        if (strlen($ftp_user) > 24 ) {
-                            $ftp_user = str_replace(':', ', ', $ftp_user);
-                            $ftp_user = substr($ftp_user, 0, 24);
-                            $ftp_user = trim($ftp_user, ":");
-                            $ftp_user = str_replace(':', ', ', $ftp_user);
-                            $ftp_user = $ftp_user.", ...";
-                        } else {
-                            $ftp_user = str_replace(':', ', ', $ftp_user);
-                        }
+	<!-- Begin web domain list item loop -->
+	<?php
+		foreach ($data as $key => $value) {
+				++$i;
+				if ($data[$key]['SUSPENDED'] == 'yes') {
+						$status = 'suspended';
+						$spnd_action = 'unsuspend';
+						$spnd_icon = 'fa-play';
+						$spnd_confirmation = _('UNSUSPEND_DOMAIN_CONFIRMATION');
+				} else {
+						$status = 'active';
+						$spnd_action = 'suspend';
+						$spnd_icon = 'fa-pause';
+						$spnd_confirmation = _('SUSPEND_DOMAIN_CONFIRMATION');
+				}
+				if (!empty($data[$key]['SSL_HOME'])) {
+						if ($data[$key]['SSL_HOME'] == 'same') {
+								$ssl_home = 'public_html';
+						} else {
+								$ssl_home = 'public_shtml';
+						}
+				} else {
+						$ssl_home = '';
+				}
+				$web_stats='no';
+				if (!empty($data[$key]['STATS'])) {
+						$web_stats=$data[$key]['STATS'];
+				}
+				$ftp_user='no';
+				if (!empty($data[$key]['FTP_USER'])) {
+						$ftp_user=$data[$key]['FTP_USER'];
 
-                        $backend_support='no';
-                        if (!empty($data[$key]['BACKEND'])) {
-                            $backend_support='yes';
-                        }
+				}
+				if (strlen($ftp_user) > 24 ) {
+						$ftp_user = str_replace(':', ', ', $ftp_user);
+						$ftp_user = substr($ftp_user, 0, 24);
+						$ftp_user = trim($ftp_user, ":");
+						$ftp_user = str_replace(':', ', ', $ftp_user);
+						$ftp_user = $ftp_user.", ...";
+				} else {
+						$ftp_user = str_replace(':', ', ', $ftp_user);
+				}
 
-                        $proxy_support='no';
-                        if (!empty($data[$key]['PROXY'])) {
-                            $proxy_support='yes';
-                        }
-                        if (strlen($data[$key]['PROXY_EXT']) > 24 ) {
-                            $proxy_ext_title = str_replace(',', ', ', $data[$key]['PROXY_EXT']);
-                            $proxy_ext = substr($data[$key]['PROXY_EXT'], 0, 24);
-                            $proxy_ext = trim($proxy_ext, ",");
-                            $proxy_ext = str_replace(',', ', ', $proxy_ext);
-                            $proxy_ext = $proxy_ext.", ...";
-                        } else {
-                            $proxy_ext_title = '';
-                            $proxy_ext = str_replace(',', ', ', $data[$key]['PROXY_EXT']);
-                        }
-                    ?>
+				$backend_support='no';
+				if (!empty($data[$key]['BACKEND'])) {
+						$backend_support='yes';
+				}
 
-      <div class="l-unit <? if($data[$key]['SUSPENDED'] == 'yes') echo 'l-unit--suspended'; if($_SESSION['favourites']['WEB'][$key] == 1) echo ' l-unit--starred'; ?> animated fadeIn" v_section="web" v_unit_id="<?=$key?>"
-id="web-unit-<?=$i?>"  sort-ip="<?=str_replace('.', '', $data[$key]['IP'])?>"
-sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>"
-sort-name="<?=$key?>"  sort-bandwidth="<?=$data[$key]['U_BANDWIDTH']?>" sort-disk="<?=$data[$key]['U_DISK']?>" sort-star="<? if($_SESSION['WEB'][$key] == 1) echo '1'; else echo '0';?>">
-      <div class="l-unit__col l-unit__col--right">
-          <div class="clearfix l-unit__stat-col--left super-compact">
-              <input id="check<?=$i?>" class="ch-toggle" type="checkbox" title="<?=_('Select')?>" name="domain[]" value="<?=$key?>" <?=$display_mode;?>>
-          </div>
-          <div class="clearfix l-unit__stat-col--left wide-4 truncate">
-            <? if ($read_only === 'true') {?>
-              <b><?=$key?></b>
-            <? } else { ?>
-              <b><a href="/edit/web/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Domain')?>: <?=$key?>"><?=$key?></a></b>
-            <? } ?>
-          </div>
-          <!-- START QUICK ACTION TOOLBAR AREA -->
-          <div class="clearfix l-unit__stat-col--left compact-4 text-right">
-            <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
-              <div class="actions-panel clearfix">
-                <? if (!empty($data[$key]['STATS'])) { ?>
-                  <div class="actions-panel__col actions-panel__logs shortcut-w" key-action="href"><a href="http://<?=$key?>/vstats/" rel="noopener" target="_blank" rel="noopener" title="<?=_('Statistics')?>"><i class="fas fa-chart-bar status-icon maroon status-icon dim"></i></a></div>
-                <? } ?>
-                <div class="actions-panel__col actions-panel__view" key-action="href"><a href="http://<?=$key?>/" rel="noopener" target="_blank"><i class="fas fa-external-link-square-alt status-icon lightblue status-icon dim"></i></a></div>
-                <? if ($read_only === 'true') {?>
-                  <!-- Restrict ability to edit, delete, or suspend web domains when impersonating the 'admin' account -->
-                  &nbsp;
-                <? } else { ?>
-                  <? if ($data[$key]['SUSPENDED'] == 'no') {?>
-                    <div class="actions-panel__col actions-panel__edit shortcut-enter" key-action="href"><a href="/edit/web/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Domain')?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
-                  <? } ?>
-                  <div class="actions-panel__col actions-panel__logs shortcut-l" key-action="href"><a href="/list/web-log/?domain=<?php echo $key ?>&type=access#" title="<?=_('AccessLog')?>"><i class="fas fa-binoculars status-icon purple status-icon dim"></i></a></div>
-                  <div class="actions-panel__col actions-panel__suspend shortcut-s" key-action="js">
-                    <a id="<?=$spnd_action ?>_link_<?=$i?>" class="data-controls do_<?=$spnd_action?>" title="<?=_($spnd_action)?>">
-                      <i class="fas <?=$spnd_icon?> status-icon highlight status-icon dim do_<?=$spnd_action?>"></i>
-                      <input type="hidden" name="<?=$spnd_action?>_url" value="/<?=$spnd_action?>/web/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" />
-                      <div id="<?=$spnd_action?>_dialog_<?=$i?>" class="confirmation-text-suspention hidden" title="<?=_('Confirmation')?>">
-                        <p class="confirmation"><?=sprintf($spnd_confirmation,$key)?></p>
-                      </div>
-                    </a>
-                  </div>
-                  <div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
-                    <a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete')?>">
-                      <i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
-                      <input type="hidden" name="delete_url" value="/delete/web/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" />
-                      <div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
-                        <p class="confirmation"><?=sprintf(_('DELETE_DOMAIN_CONFIRMATION'),$key)?></p>
-                      </div>
-                    </a>
-                  </div>
-                <? } ?> 
-              </div>
-            </div>
-          </div>
-          <!-- END QUICK ACTION TOOLBAR AREA -->
-          <div class="clearfix l-unit__stat-col--left text-center"><?=empty($ips[$data[$key]['IP']]['NAT']) ? $data[$key]['IP'] : "{$ips[$data[$key]['IP']]['NAT']}"; ?></div>
-          <div class="clearfix l-unit__stat-col--left text-center"><b><?=humanize_usage_size($data[$key]['U_DISK'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['U_DISK'])?></span></div>
-          <div class="clearfix l-unit__stat-col--left text-center compact"><b><?=humanize_usage_size($data[$key]['U_BANDWIDTH'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['U_BANDWIDTH'])?></span></div>
-          <div class="clearfix l-unit__stat-col--left text-center">
-                  <b>
-                    <? if($data[$key]['SUSPENDED'] == 'no'){ ?>
-                        <? if($data[$key]['SSL'] == 'no'){ ?>
-                          <i class="fas fa-times-circle status-icon red"></i>
-                        <? } else {?>
-                          <i class="fas fa-check-circle status-icon green"></i>
-                        <? } ?>
-                    <? } else {?>
-                        <? if($data[$key]['SSL'] == 'no'){ ?>
-                          <i class="fas fa-times-circle"></i>
-                        <? } else {?>
-                          <i class="fas fa-check-circle"></i>
-                        <? } ?>
-                    <? } ?>
-                  </b>
-          </div>
-          <div class="clearfix l-unit__stat-col--left text-center compact">
-                  <b>
-                    <? if($data[$key]['SUSPENDED'] == 'no'){ ?>
-                        <? if($web_stats == 'no'){ ?>
-                          <i class="fas fa-minus-circle"></i>
-                        <? } else {?>
-                          <i class="fas fa-check-circle status-icon green"></i>
-                        <? } ?>
-                    <? } else {?>
-                      <? if($web_stats == 'no'){ ?>
-                        <i class="fas fa-minus-circle"></i>
-                      <? } else {?>
-                        <i class="fas fa-check-circle"></i>
-                      <? } ?>
-                    <? } ?>
-                  </b>
-          </div>
-      </div>
-    </div>
-  <?}?>
+				$proxy_support='no';
+				if (!empty($data[$key]['PROXY'])) {
+						$proxy_support='yes';
+				}
+				if (strlen($data[$key]['PROXY_EXT']) > 24 ) {
+						$proxy_ext_title = str_replace(',', ', ', $data[$key]['PROXY_EXT']);
+						$proxy_ext = substr($data[$key]['PROXY_EXT'], 0, 24);
+						$proxy_ext = trim($proxy_ext, ",");
+						$proxy_ext = str_replace(',', ', ', $proxy_ext);
+						$proxy_ext = $proxy_ext.", ...";
+				} else {
+						$proxy_ext_title = '';
+						$proxy_ext = str_replace(',', ', ', $data[$key]['PROXY_EXT']);
+				}
+				if ($data[$key]['SUSPENDED'] === 'yes') {
+					if ($data[$key]['SSL'] == 'no') { 
+						$icon_ssl = 'fas fa-times-circle';
+					}
+					if ($data[$key]['SSL'] == 'yes') { 
+						$icon_ssl = 'fas fa-check-circle';
+					}
+					if ($web_stats == 'no') { 
+						$icon_webstats = 'fas fa-times-circle';
+					} else { 
+						$icon_webstats = 'fas fa-check-circle';
+					}
+				} else {
+					if ($data[$key]['SSL'] == 'no') { 
+						$icon_ssl = 'fas fa-times-circle status-icon red';
+					}
+					if ($data[$key]['SSL'] == 'yes') { 
+						$icon_ssl = 'fas fa-check-circle status-icon green';
+					}
+					if ($web_stats == 'no') { 
+						$icon_webstats = 'fas fa-times-circle status-icon red';
+					} else { 
+						$icon_webstats = 'fas fa-check-circle status-icon green';
+					}
+				}
+			?>
+			<div class="l-unit <?php if ($data[$key]['SUSPENDED'] == 'yes') echo 'l-unit--suspended'; if($_SESSION['favourites']['WEB'][$key] == 1) echo ' l-unit--starred'; ?> animated fadeIn" v_section="web" v_unit_id="<?=$key?>"
+				id="web-unit-<?=$i?>" sort-ip="<?=str_replace('.', '', $data[$key]['IP'])?>"
+				sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>"
+				sort-name="<?=$key?>" sort-bandwidth="<?=$data[$key]['U_BANDWIDTH']?>" sort-disk="<?=$data[$key]['U_DISK']?>" sort-star="<?php if ($_SESSION['WEB'][$key] == 1) echo '1'; else echo '0';?>">
+				<div class="l-unit__col l-unit__col--right">
+					<div class="clearfix l-unit__stat-col--left super-compact">
+						<input id="check<?=$i?>" class="ch-toggle" type="checkbox" title="<?=_('Select');?>" name="domain[]" value="<?=$key?>" <?=$display_mode;?>>
+					</div>
+					<div class="clearfix l-unit__stat-col--left wide-4 truncate">
+						<b>
+							<?php if ($read_only === 'true') {?>
+								<?=$key?>
+							<?php } else { ?>
+								<a href="/edit/web/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Domain');?>: <?=$key?>"><?=$key?></a>
+							<?php } ?>
+						</b>
+					</div>
+					<!-- START QUICK ACTION TOOLBAR AREA -->
+					<div class="clearfix l-unit__stat-col--left compact-4 text-right">
+						<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
+							<div class="actions-panel clearfix">
+								<?php if (!empty($data[$key]['STATS'])) { ?>
+									<div class="actions-panel__col actions-panel__logs shortcut-w" key-action="href"><a href="http://<?=$key?>/vstats/" rel="noopener" target="_blank" rel="noopener" title="<?=_('Statistics');?>"><i class="fas fa-chart-bar status-icon maroon status-icon dim"></i></a></div>
+								<?php } ?>
+									<div class="actions-panel__col actions-panel__view" key-action="href"><a href="http://<?=$key?>/" rel="noopener" target="_blank"><i class="fas fa-external-link-square-alt status-icon lightblue status-icon dim"></i></a></div>
+								<?php if ($read_only === 'true') {?>
+									<!-- Restrict ability to edit, delete, or suspend web domains when impersonating the 'admin' account -->
+									&nbsp;
+								<?php } else { ?>
+									<?php if ($data[$key]['SUSPENDED'] == 'no') {?>
+										<div class="actions-panel__col actions-panel__edit shortcut-enter" key-action="href"><a href="/edit/web/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Domain');?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
+									<?php } ?>
+									<div class="actions-panel__col actions-panel__logs shortcut-l" key-action="href"><a href="/list/web-log/?domain=<?=$key?>&type=access#" title="<?=_('AccessLog');?>"><i class="fas fa-binoculars status-icon purple status-icon dim"></i></a></div>
+									<div class="actions-panel__col actions-panel__suspend shortcut-s" key-action="js">
+										<a id="<?=$spnd_action ?>_link_<?=$i?>" class="data-controls do_<?=$spnd_action?>" title="<?=_($spnd_action)?>">
+											<i class="fas <?=$spnd_icon?> status-icon highlight status-icon dim do_<?=$spnd_action?>"></i>
+											<input type="hidden" name="<?=$spnd_action?>_url" value="/<?=$spnd_action?>/web/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" />
+											<div id="<?=$spnd_action?>_dialog_<?=$i?>" class="confirmation-text-suspention hidden" title="<?=_('Confirmation');?>">
+												<p class="confirmation"><?=sprintf($spnd_confirmation,$key)?></p>
+											</div>
+										</a>
+									</div>
+									<div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
+										<a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete');?>">
+											<i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
+											<input type="hidden" name="delete_url" value="/delete/web/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" />
+											<div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation');?>">
+												<p class="confirmation"><?=sprintf(_('DELETE_DOMAIN_CONFIRMATION'),$key)?></p>
+											</div>
+										</a>
+									</div>
+								<?php } ?>
+							</div>
+						</div>
+					</div>
+					<!-- END QUICK ACTION TOOLBAR AREA -->
+					<div class="clearfix l-unit__stat-col--left text-center"><?=empty($ips[$data[$key]['IP']]['NAT']) ? $data[$key]['IP'] : "{$ips[$data[$key]['IP']]['NAT']}"; ?></div>
+					<div class="clearfix l-unit__stat-col--left text-center"><b><?=humanize_usage_size($data[$key]['U_DISK'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['U_DISK'])?></span></div>
+					<div class="clearfix l-unit__stat-col--left text-center compact"><b><?=humanize_usage_size($data[$key]['U_BANDWIDTH'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['U_BANDWIDTH'])?></span></div>
+					<div class="clearfix l-unit__stat-col--left text-center">
+						<i class="fas <?=$icon_ssl;?>"></i>
+					</div>
+					<div class="clearfix l-unit__stat-col--left text-center compact">
+						<i class="fas <?=$icon_webstats;?>"></i>
+					</div>
+				</div>
+			</div>
+		<?php } ?>
+	</div>
 </div>
 
 <div id="vstobjects">
-    <div class="l-separator"></div>
-<div class="l-center">
-    <div class="l-unit-ft">
-      <table class='data'></table>
-      <div class="data-count l-unit__col l-unit__col--right clearfix">
-        <?php
-          printf(ngettext('%d web domain', '%d web domains', $i),$i);
-        ?>
-      </div>
-  </div>
-</div>
+	<div class="l-separator"></div>
+	<div class="l-center">
+		<div class="l-unit-ft">
+			<table class='data'></table>
+			<div class="data-count l-unit__col l-unit__col--right clearfix">
+				<?php printf(ngettext('%d web domain', '%d web domains', $i),$i); ?>
+			</div>
+		</div>
+	</div>
 </div>

+ 50 - 49
web/templates/pages/list_webapps.html

@@ -1,52 +1,53 @@
+<!-- Begin toolbar -->
 <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="/edit/web/?domain=<?=$v_domain?>"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-          </div>
-          <div class="l-unit-toolbar__buttonstrip float-right">
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/edit/web/?domain=<?=$v_domain?>"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+		</div>
+		<div class="l-unit-toolbar__buttonstrip float-right">
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn" style="padding-top:240px;">
-        <?php
-            $back = $_SESSION['back'];
-            if (empty($back)) {
-            $back = "location.href='/list/web/'";
-            } else {
-            $back = "location.href='".$back."'";
-            }
-        ?>       
-        <div style="margin-left:68px; margin-top: 20px">
-          <div class="page-title">
-              <span><?=_('Quick Install App')?></span><br>
-          </div>
-          <div>
-              <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>
-          </div>
-        </div>
-        <div class="app-list cards">
-            <?php foreach($v_web_apps as $webapp):?>
-                <div class="card <?=($webapp['enabled']?'':'disable')?>" >
-                    <span class="card-thumb"><img src="/src/app/WebApp/Installers/<?=$webapp['name'];?>/<?=$webapp['thumbnail'];?>"></span>
-                    <div class="card-details">
-                        <p class="card-title"><?=$webapp['name'];?></p>
-                        <p><?=_('version')?>: <?=$webapp['version'];?></p>
-                        <a href="/add/webapp/?app=<?=$webapp['name'];?>&domain=<?=$v_domain?>" class="ui-button cancel" dir="ltr"><?=_('Setup')?></a>
-                    </div>
-                </div>
-            <?php endforeach; ?>
-        </div>
-    </div>
+<div class="l-center animated fadeIn" style="padding-top:240px;">
+
+	<div style="margin-left:68px; margin-top: 20px">
+		<div class="page-title">
+			<span><?=_('Quick Install App');?></span><br>
+		</div>
+		<div>
+			<span>
+				<?php
+					if (!empty($_SESSION['error_msg'])) {
+						$msg_icon = 'fa-exclamation-circle status-icon red';
+						$msg_text = htmlentities($_SESSION['error_msg']);
+						$msg_id = 'vst-error';
+					} else {
+						if (!empty($_SESSION['ok_msg'])) {
+							$msg_icon = 'fa-check-circle status-icon green';
+							$msg_text = $_SESSION['ok_msg'];
+							$msg_id = 'vst-ok';
+						}
+					}
+				?>
+				<span class="<?=$msg_id;?>"> <i class="fas <?=$msg_icon;?>"></i> <?=$msg_text;?></span>
+			</span>
+		</div>
+	</div>
+	<div class="app-list cards">
+		<!-- List available web apps -->
+		<?php foreach($v_web_apps as $webapp):?>
+			<div class="card <?=($webapp['enabled']?'':'disable');?>">
+				<span class="card-thumb"><img src="/src/app/WebApp/Installers/<?=$webapp['name'];?>/<?=$webapp['thumbnail'];?>"></span>
+				<div class="card-details">
+					<p class="card-title"><?=$webapp['name'];?></p>
+					<p><?=_('version');?>: <?=$webapp['version'];?></p>
+					<a href="/add/webapp/?app=<?=$webapp['name'];?>&domain=<?=$v_domain?>" class="ui-button cancel" dir="ltr"><?=_('Setup');?></a>
+				</div>
+			</div>
+		<?php endforeach; ?>
+	</div>
+</div>

+ 31 - 29
web/templates/pages/list_weblog.html

@@ -1,35 +1,37 @@
 <!doctype html>
 <html lang="en">
+
 <head>
-  <!-- Load necessary CSS and JavaScript from source -->
-  <?php require ''.$_SERVER['HESTIA'].'/web/templates/includes/title.html'; ?>
-  <?php require ''.$_SERVER['HESTIA'].'/web/templates/includes/css.html'; ?>
-  <?php require ''.$_SERVER['HESTIA'].'/web/templates/includes/top_js.html'; ?>
-  
-  <script type="text/javascript" src="/js/jquery/jquery-1.7.2.min.js"></script>
-  <script type="text/javascript" src="/js/jquery/jquery.cookie.js"></script>
-  <script type="text/javascript" src="/js/jquery/jquery-ui-1.8.20.custom.min.js"></script>
-  <script type="text/javascript" src="/js/events.js"></script>
+	<!-- Load necessary CSS and JavaScript from source -->
+	<?php require ''.$_SERVER['HESTIA'].'/web/templates/includes/title.html'; ?>
+	<?php require ''.$_SERVER['HESTIA'].'/web/templates/includes/css.html'; ?>
+	<?php require ''.$_SERVER['HESTIA'].'/web/templates/includes/top_js.html'; ?>
+
+	<script type="text/javascript" src="/js/jquery/jquery-1.7.2.min.js"></script>
+	<script type="text/javascript" src="/js/jquery/jquery.cookie.js"></script>
+	<script type="text/javascript" src="/js/jquery/jquery-ui-1.8.20.custom.min.js"></script>
+	<script type="text/javascript" src="/js/events.js"></script>
 </head>
+
 <body>
-  <a href="#" class="to-top" title="<?=_('Top')?>">
-    <i class="fas fa-arrow-up"></i>
-  </a>
-  <div class="l-header">
-    <div class="l-center">
-      <a href="/" class="l-logo"></a>
-      <div class="l-menu clearfix">
-        <div class="l-menu__item"><a href="/list/web/"><i class="fas fa-arrow-alt-circle-left"></i>&nbsp;&nbsp;&nbsp;<?=_('Back')?></a></div>
-        <div class="l-menu__item <?php if($_GET['type'] == 'access') echo 'l-menu__item--active' ?>"><a href="/list/web-log/?domain=<?=htmlentities($_GET['domain'])?>&type=access"><i class="fas fa-eye"></i>&nbsp;&nbsp;&nbsp;<?=_('Access Log')?></a><a href="/download/web-log/?domain=<?=htmlentities($_GET['domain'])?>&type=access" title="<?=_('Download')?>"><i class="fas fa-download"></i></a></div>
-        <div class="l-menu__item <?php if($_GET['type'] == 'error') echo 'l-menu__item--active' ?>"><a href="/list/web-log/?domain=<?=htmlentities($_GET['domain'])?>&type=error"><i class="fas fa-exclamation-circle"></i>&nbsp;&nbsp;&nbsp;<?=_('Error Log')?></a><a href="/download/web-log/?domain=<?=htmlentities($_GET['domain'])?>&type=error" title="<?=_('Download')?>"><i class="fas fa-download"></i></a></div>
-      </div>
-      <div class="l-profile">
-        <div class="l-menu__item"><a href="javascript:location.reload();" title="<?=_('Refresh')?>"><i class="fas fa-redo"></i></a></div>
-        <div class="l-menu__item"><a href="/edit/user/?user=<?php echo $user; ?>" title="<?=$user?>" class="l-profile__username"><i class="fas fa-user-circle"></i></a></div>
-			  <div class="l-menu__item"><a href="/logout/" title="<?=_('Log out')?>" class="l-profile__logout"><i class="fas fa-sign-out-alt"></i></a></div>
-      </div>
-    </div>
-  </div>
+	<a href="#" class="to-top" title="<?=_('Top');?>">
+		<i class="fas fa-arrow-up"></i>
+	</a>
+	<div class="l-header">
+		<div class="l-center">
+			<a href="/" class="l-logo"></a>
+			<div class="l-menu clearfix">
+				<div class="l-menu__item"><a href="/list/web/"><i class="fas fa-arrow-alt-circle-left"></i>&nbsp;&nbsp;&nbsp;<?=_('Back');?></a></div>
+				<div class="l-menu__item <?php if($_GET['type'] == 'access') echo 'l-menu__item--active' ?>"><a href="/list/web-log/?domain=<?=htmlentities($_GET['domain'])?>&type=access"><i class="fas fa-eye"></i>&nbsp;&nbsp;&nbsp;<?=_('Access Log');?></a><a href="/download/web-log/?domain=<?=htmlentities($_GET['domain'])?>&type=access" title="<?=_('Download');?>"><i class="fas fa-download"></i></a></div>
+				<div class="l-menu__item <?php if($_GET['type'] == 'error') echo 'l-menu__item--active' ?>"><a href="/list/web-log/?domain=<?=htmlentities($_GET['domain'])?>&type=error"><i class="fas fa-exclamation-circle"></i>&nbsp;&nbsp;&nbsp;<?=_('Error Log');?></a><a href="/download/web-log/?domain=<?=htmlentities($_GET['domain'])?>&type=error" title="<?=_('Download');?>"><i class="fas fa-download"></i></a></div>
+			</div>
+			<div class="l-profile">
+				<div class="l-menu__item"><a href="javascript:location.reload();" title="<?=_('Refresh');?>"><i class="fas fa-redo"></i></a></div>
+				<div class="l-menu__item"><a href="/edit/user/?user=<?=$user; ?>" title="<?=$user?>" class="l-profile__username"><i class="fas fa-user-circle"></i></a></div>
+				<div class="l-menu__item"><a href="/logout/" title="<?=_('Log out');?>" class="l-profile__logout"><i class="fas fa-sign-out-alt"></i></a></div>
+			</div>
+		</div>
+	</div>
 
-  <div style="margin-left: auto; margin-right: auto; padding-top: 80px; width: 1020px;"><?php echo _('Last 70 lines of %s.%s.log',htmlentities($_GET['domain']),htmlentities($_GET['type'])) ;?></div>
-  <pre style="width: 1020px; margin-left: auto; margin-right: auto;" class="console-output">
+	<div style="margin-left: auto; margin-right: auto; padding-top: 80px; width: 1020px;"><?=_('Last 70 lines of %s.%s.log',htmlentities($_GET['domain']),htmlentities($_GET['type'])) ;?></div>
+	<pre style="width: 1020px; margin-left: auto; margin-right: auto;" class="console-output">

+ 57 - 56
web/templates/pages/login/login.html

@@ -1,56 +1,57 @@
-        <center>
-            <table class="login animated zoomIn">
-                <tr>
-                    <td>
-                        <table>
-                            <tr>
-                                <td style="padding: 22px 30px 0 42px; height: 280px; width: 170px;">
-                                    <a href="/"><img border=0 src="/images/logo.svg" title="<?=_('Hestia Control Panel');?>" style="margin-top: 70px;" /></a>
-                                </td>
-                                <td style="padding: 40px 60px 0 0;">
-                                    <form method="post" action="/login/" id="form_login">
-                                    <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
-                                    <input type="hidden" name="murmur" value="" id="murmur">
-                                    <table class="login-box">
-                                        <tr>
-                                            <td style="padding: 12px 0 0 2px;" class="login-welcome">
-                                                <?php print _('Welcome to Hestia Control Panel');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td style="padding: 12px 0 5px 2px;">
-                                                <?php print _('Username');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input tabindex="1" type="text" size="20px" style="width:240px;" name="user" class="vst-input" autofocus />
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td height="10px">
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td style="padding: 0 0 5px 0;">
-                                                <button tabindex="3" type="submit" class="button"><?php print _('Next');?>&nbsp;&nbsp;&nbsp;<i class="fas fa-sign-in-alt"></i></button>
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </form>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td colspan=2>
-                                <div class="login-bottom">
-                                    <div style="height:20px"><?php if (isset($error)) echo $error ?></div>
-                                </div>
-                            </td>
-                        </tr>
-                    </table>
-                </tr>
-            </table>
-        </center>
-        <script src="/inc/jquery/jquery-3.5.1.min.js"></script>
-    </body>
-</html>
+<center>
+	<table class="login animated zoomIn">
+		<tr>
+			<td>
+				<table>
+					<tr>
+						<td style="padding: 22px 30px 0 42px; height: 280px; width: 170px;">
+							<a href="/"><img border=0 src="/images/logo.svg" title="<?=_('Hestia Control Panel');?>" style="margin-top: 70px;" /></a>
+						</td>
+						<td style="padding: 40px 60px 0 0;">
+							<form method="post" action="/login/" id="form_login">
+								<input type="hidden" name="token" value="<?=$_SESSION['token']; ?>">
+								<input type="hidden" name="murmur" value="" id="murmur">
+								<table class="login-box">
+									<tr>
+										<td style="padding: 12px 0 0 2px;" class="login-welcome">
+											<?=_('Welcome to Hestia Control Panel');?>
+										</td>
+									</tr>
+									<tr>
+										<td style="padding: 12px 0 5px 2px;">
+											<?=_('Username');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input tabindex="1" type="text" size="20px" style="width:240px;" name="user" class="vst-input" autofocus />
+										</td>
+									</tr>
+									<tr>
+										<td height="10px">
+										</td>
+									</tr>
+									<tr>
+										<td style="padding: 0 0 5px 0;">
+											<button tabindex="3" type="submit" class="button"><?=_('Next');?>&nbsp;&nbsp;&nbsp;<i class="fas fa-sign-in-alt"></i></button>
+										</td>
+									</tr>
+								</table>
+							</form>
+						</td>
+					</tr>
+					<tr>
+						<td colspan=2>
+							<div class="login-bottom">
+								<div style="height:20px"><?php if (isset($error)) echo $error ?></div>
+							</div>
+						</td>
+					</tr>
+				</table>
+		</tr>
+	</table>
+</center>
+<script src="/inc/jquery/jquery-3.5.1.min.js"></script>
+</body>
+
+</html>

+ 66 - 65
web/templates/pages/login/login_1.html

@@ -1,65 +1,66 @@
-        <center>
-            <table class="login">
-                <tr>
-                    <td>
-                        <table>
-                            <tr>
-                                <td style="padding: 22px 30px 0 42px; height: 280px; width: 170px;">
-                                    <a href="/"><img border=0 src="/images/logo.svg" title="<?=_('Hestia Control Panel');?>" style="margin-top: 70px;" /></a>
-                                </td>
-                                <td style="padding: 40px 60px 0 0;" class="animated fadeIn">
-                                    <form method="post" action="/login/" id="form_login">
-                                    <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
-                                    <input type="hidden" name="user" value="<?php echo $_POST['user']; ?>">
-                                    <input type="hidden" name="murmur" value="<?php echo $_SESSION['token']; ?>" id="murmur">    
-                                    <table class="login-box">
-                                        <tr>
-                                            <td style="padding: 12px 0 0 2px;" class="login-welcome">
-                                                <?php print _('Welcome');?> <?php echo $_POST['user']; ?>!
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                           <td style="padding: 12px 0 0 2px;">
-                                                <?php print _('Password');?>
-                                                <? if ($_SESSION['POLICY_SYSTEM_PASSWORD_RESET'] !== 'no' ) {?>
-                                                <div style="padding:0 6px 0px 14px; float:right;">
-                                                    <a tabindex="5" class="vst-advanced" href="/reset/">
-                                                        <?php print _('forgot password');?>
-                                                    </a>
-                                                </div>
-                                                <?}?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input tabindex="2" type="password" size="20px"  style="width:240px;" name="password" class="vst-input" autofocus />
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td height="10px">
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td style="padding: 0 0 5px 0;">
-                                                <button tabindex="3" type="submit" class="button"><?php print _('Login');?>&nbsp;&nbsp;&nbsp;<i class="fas fa-sign-in-alt"></i></button>&nbsp;&nbsp;
-                                                <input type="button" class="button cancel" value="<?php print _('Back');?>" onclick="location.href='/login/'">
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </form>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td colspan=2>
-                                <div class="login-bottom">
-                                    <div style="height:20px"><?php if (isset($ERROR)) echo $ERROR ?></div>
-                                </div>
-                            </td>
-                        </tr>
-                    </table>
-                </tr>
-            </table>
-        </center>
-        <script src="/inc/jquery/jquery-3.5.1.min.js"></script>
-    </body>
-</html>
+<center>
+	<table class="login">
+		<tr>
+			<td>
+				<table>
+					<tr>
+						<td style="padding: 22px 30px 0 42px; height: 280px; width: 170px;">
+							<a href="/"><img border=0 src="/images/logo.svg" title="<?=_('Hestia Control Panel');?>" style="margin-top: 70px;" /></a>
+						</td>
+						<td style="padding: 40px 60px 0 0;" class="animated fadeIn">
+							<form method="post" action="/login/" id="form_login">
+								<input type="hidden" name="token" value="<?=$_SESSION['token']; ?>">
+								<input type="hidden" name="user" value="<?=$_POST['user']; ?>">
+								<input type="hidden" name="murmur" value="<?=$_SESSION['token']; ?>" id="murmur">
+								<table class="login-box">
+									<tr>
+										<td style="padding: 12px 0 0 2px;" class="login-welcome">
+											<?=_('Welcome');?> <?=$_POST['user']; ?>!
+										</td>
+									</tr>
+									<tr>
+										<td style="padding: 12px 0 0 2px;">
+											<?=_('Password');?>
+											<?php if ($_SESSION['POLICY_SYSTEM_PASSWORD_RESET'] !== 'no' ) {?>
+												<div style="padding:0 6px 0px 14px; float:right;">
+													<a tabindex="5" class="vst-advanced" href="/reset/">
+														<?=_('forgot password');?>
+													</a>
+												</div>
+											<?php } ?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input tabindex="2" type="password" size="20px" style="width:240px;" name="password" class="vst-input" autofocus />
+										</td>
+									</tr>
+									<tr>
+										<td height="10px">
+										</td>
+									</tr>
+									<tr>
+										<td style="padding: 0 0 5px 0;">
+											<button tabindex="3" type="submit" class="button"><?=_('Login');?>&nbsp;&nbsp;&nbsp;<i class="fas fa-sign-in-alt"></i></button>&nbsp;&nbsp;
+											<input type="button" class="button cancel" value="<?=_('Back');?>" onclick="location.href='/login/'">
+										</td>
+									</tr>
+								</table>
+							</form>
+						</td>
+					</tr>
+					<tr>
+						<td colspan=2>
+							<div class="login-bottom">
+								<div style="height:20px"><?php if (isset($ERROR)) echo $ERROR ?></div>
+							</div>
+						</td>
+					</tr>
+				</table>
+		</tr>
+	</table>
+</center>
+<script src="/inc/jquery/jquery-3.5.1.min.js"></script>
+</body>
+
+</html>

+ 62 - 61
web/templates/pages/login/login_2.html

@@ -1,61 +1,62 @@
-        <center>
-            <table class="login">
-                <tr>
-                    <td>
-                        <table>
-                            <tr>
-                                <td style="padding: 22px 30px 0 42px; height: 280px; width: 170px;">
-                                    <a href="/"><img border=0 src="/images/logo.svg" title="<?=_('Hestia Control Panel');?>" style="margin-top: 70px;" /></a>
-                                </td>
-                                <td style="padding: 40px 60px 0 0;" class="animated fadeIn">
-                                    <form method="post" action="/login/" id="form_login">
-                                    <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
-                                    <input type="hidden" name="murmur" value="" id="murmur">
-                                    <table class="login-box">
-                                        <tr>
-                                            <td style="padding: 12px 0 0 2px;" class="login-welcome">
-                                                <?php print _('2 Factor Authentication');?>
-                                            </td>
-                                        </tr>
-                                        <tr class="twofa">
-                                            <td style="padding-top: 12px; padding-left:2px;">
-                                                <?php print _('2FA Token');?>
-                                                <div style="padding:0 6px 0px 14px; float:right;">
-                                                    <a tabindex="5" class="vst-advanced" href="/reset2fa/">
-                                                        <?php print _('Forgot token');?>
-                                                    </a>
-                                                </div>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input tabindex="2" type="" size="20px"  style="width:240px;" name="twofa" class="vst-input" autofocus />
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td height="10px">
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td style="padding: 0 0 5px 0;">
-                                                <button tabindex="3" type="submit" class="button"><?php print _('Login');?>&nbsp;&nbsp;&nbsp;<i class="fas fa-sign-in-alt"></i></button>
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </form>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td colspan=2>
-                                <div class="login-bottom">
-                                    <div style="height:20px"><?php if (isset($ERROR)) echo $ERROR ?></div>
-                                </div>
-                            </td>
-                        </tr>
-                    </table>
-                </tr>
-            </table>
-        </center>
-        <script src="/inc/jquery/jquery-3.5.1.min.js"></script>
-    </body>
-</html>
+<center>
+	<table class="login">
+		<tr>
+			<td>
+				<table>
+					<tr>
+						<td style="padding: 22px 30px 0 42px; height: 280px; width: 170px;">
+							<a href="/"><img border=0 src="/images/logo.svg" title="<?=_('Hestia Control Panel');?>" style="margin-top: 70px;" /></a>
+						</td>
+						<td style="padding: 40px 60px 0 0;" class="animated fadeIn">
+							<form method="post" action="/login/" id="form_login">
+								<input type="hidden" name="token" value="<?=$_SESSION['token']; ?>">
+								<input type="hidden" name="murmur" value="" id="murmur">
+								<table class="login-box">
+									<tr>
+										<td style="padding: 12px 0 0 2px;" class="login-welcome">
+											<?=_('2 Factor Authentication');?>
+										</td>
+									</tr>
+									<tr class="twofa">
+										<td style="padding-top: 12px; padding-left:2px;">
+											<?=_('2FA Token');?>
+											<div style="padding:0 6px 0px 14px; float:right;">
+												<a tabindex="5" class="vst-advanced" href="/reset2fa/">
+													<?=_('Forgot token');?>
+												</a>
+											</div>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input tabindex="2" type="" size="20px" style="width:240px;" name="twofa" class="vst-input" autofocus />
+										</td>
+									</tr>
+									<tr>
+										<td height="10px">
+										</td>
+									</tr>
+									<tr>
+										<td style="padding: 0 0 5px 0;">
+											<button tabindex="3" type="submit" class="button"><?=_('Login');?>&nbsp;&nbsp;&nbsp;<i class="fas fa-sign-in-alt"></i></button>
+										</td>
+									</tr>
+								</table>
+							</form>
+						</td>
+					</tr>
+					<tr>
+						<td colspan=2>
+							<div class="login-bottom">
+								<div style="height:20px"><?php if (isset($ERROR)) echo $ERROR ?></div>
+							</div>
+						</td>
+					</tr>
+				</table>
+		</tr>
+	</table>
+</center>
+<script src="/inc/jquery/jquery-3.5.1.min.js"></script>
+</body>
+
+</html>

+ 67 - 66
web/templates/pages/login/login_a.html

@@ -1,66 +1,67 @@
-        <center>
-            <table class="login animated zoomIn">
-                <tr>
-                    <td>
-                        <table>
-                            <tr>
-                                <td style="padding: 22px 30px 0 42px; height: 280px; width: 170px;">
-                                    <a href="/"><img border=0 src="/images/logo.svg" title="<?=_('Hestia Control Panel');?>" style="margin-top: 70px;" /></a>
-                                </td>
-                                <td style="padding: 40px 60px 0 0;">
-                                    <form method="post" action="/login/" id="form_login">
-                                    <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
-                                    <input type="hidden" name="murmur" value="" id="murmur">
-                                    <table class="login-box">
-                                        <tr>
-                                            <td style="padding: 12px 0 0 2px;" class="login-welcome">
-                                                <?php print _('Welcome to Hestia Control Panel');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td style="padding: 12px 0 5px 2px;">
-                                                <?php print _('Username');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input tabindex="1" type="text" size="20px" style="width:240px;" name="user" class="vst-input" autofocus />
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td style="padding: 12px 0 5px 2px;">
-                                                <?php print _('Password');?>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td>
-                                                <input tabindex="2" type="password" size="20px"  style="width:240px;" name="password" class="vst-input" />
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td height="10px">
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td style="padding: 0 0 5px 0;">
-                                                <button tabindex="3" type="submit" class="button"><?php print _('Next');?>&nbsp;&nbsp;&nbsp;<i class="fas fa-sign-in-alt"></i></button>
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </form>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td colspan=2>
-                                <div class="login-bottom">
-                                    <div style="height:20px"><?php if (isset($error)) echo $error ?></div>
-                                </div>
-                            </td>
-                        </tr>
-                    </table>
-                </tr>
-            </table>
-        </center>
-        <script src="/inc/jquery/jquery-3.5.1.min.js"></script>
-    </body>
-</html>
+<center>
+	<table class="login animated zoomIn">
+		<tr>
+			<td>
+				<table>
+					<tr>
+						<td style="padding: 22px 30px 0 42px; height: 280px; width: 170px;">
+							<a href="/"><img border=0 src="/images/logo.svg" title="<?=_('Hestia Control Panel');?>" style="margin-top: 70px;" /></a>
+						</td>
+						<td style="padding: 40px 60px 0 0;">
+							<form method="post" action="/login/" id="form_login">
+								<input type="hidden" name="token" value="<?=$_SESSION['token']; ?>">
+								<input type="hidden" name="murmur" value="" id="murmur">
+								<table class="login-box">
+									<tr>
+										<td style="padding: 12px 0 0 2px;" class="login-welcome">
+											<?=_('Welcome to Hestia Control Panel');?>
+										</td>
+									</tr>
+									<tr>
+										<td style="padding: 12px 0 5px 2px;">
+											<?=_('Username');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input tabindex="1" type="text" size="20px" style="width:240px;" name="user" class="vst-input" autofocus />
+										</td>
+									</tr>
+									<tr>
+										<td style="padding: 12px 0 5px 2px;">
+											<?=_('Password');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input tabindex="2" type="password" size="20px" style="width:240px;" name="password" class="vst-input" />
+										</td>
+									</tr>
+									<tr>
+										<td height="10px">
+										</td>
+									</tr>
+									<tr>
+										<td style="padding: 0 0 5px 0;">
+											<button tabindex="3" type="submit" class="button"><?=_('Next');?>&nbsp;&nbsp;&nbsp;<i class="fas fa-sign-in-alt"></i></button>
+										</td>
+									</tr>
+								</table>
+							</form>
+						</td>
+					</tr>
+					<tr>
+						<td colspan=2>
+							<div class="login-bottom">
+								<div style="height:20px"><?php if (isset($error)) echo $error ?></div>
+							</div>
+						</td>
+					</tr>
+				</table>
+		</tr>
+	</table>
+</center>
+<script src="/inc/jquery/jquery-3.5.1.min.js"></script>
+</body>
+
+</html>

+ 77 - 76
web/templates/pages/login/reset2fa.html

@@ -1,76 +1,77 @@
-        <center>
-            <table class="login">
-                <tr>
-                    <td>
-                        <table>
-                            <tr>
-                                <td style="padding: 22px 30px 0 42px; height: 280px; width: 170px;">
-                                    <a href="/"><img border=0 src="/images/logo.svg" title="<?=_('Hestia Control Panel');?>" style="margin-top: 70px;" /></a>
-                                </td>
-                                <td style="padding: 40px 60px 0 0;" class="animated fadeIn">
-                                    <?php if($success){?>
-                                        <table class="login-box">
-                                            <tr>
-                                            <td style="padding: 12px 0 0 2px;">
-                                            <?php print _('2FA Reset successfully'); ?>
-                                            </td>
-                                            </tr>
-                                            <tr>
-                                                <td style="padding: 20px 0 12px 0;">
-                                                    <input type="button" class="button" value="<?php print _('Log in');?>" onclick="location.href='/login/'">
-                                                </td>
-                                            </tr>
-                                        </table>
-                                        <?php }else{ ?>
-                                        <form method="post" action="/reset2fa/">
-                                        <table class="login-box">
-                                            <tr>
-                                                <td style="padding: 12px 0 0 2px;" class="login-welcome">
-                                                    <?php print _('Reset 2FA');?>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td style="padding: 12px 0 0 2px;">
-                                                    <?php print _('Username');?>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td>
-                                                    <input tabindex="1" type="text" size="20px" style="width:240px" name="user" class="vst-input">
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td style="padding: 12px 0 0 2px;">
-                                                    <?php print _('2FA Reset Code');?>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td>
-                                                    <input tabindex="1" type="text" size="20px" style="width:240px" name="twofa" class="vst-input">
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td style="padding: 20px 0 12px 0;">
-                                                    <input tabindex="2" type="submit" value="<?php print _('Submit');?>" class="button">&nbsp;&nbsp;
-                                                    <input type="button" class="button cancel" value="<?php print _('Back');?>" onclick="location.href='/login/'">
-                                                </td>
-                                            </tr>
-                                        </table>
-                                    </form>
-                                    <?php } ?>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td colspan=2>
-                                    <div class="login-bottom">
-                                        <div style="height:20px"><?php if (isset($ERROR)) echo $ERROR ?></div>
-                                    </div>
-                                </td>
-                            </tr>
-                        </table>
-                    </td>
-                </tr>
-            </table>
-        </center>
-    </body>
-</html>
+<center>
+	<table class="login">
+		<tr>
+			<td>
+				<table>
+					<tr>
+						<td style="padding: 22px 30px 0 42px; height: 280px; width: 170px;">
+							<a href="/"><img border=0 src="/images/logo.svg" title="<?=_('Hestia Control Panel');?>" style="margin-top: 70px;" /></a>
+						</td>
+						<td style="padding: 40px 60px 0 0;" class="animated fadeIn">
+							<?php if ($success) {?>
+								<table class="login-box">
+									<tr>
+										<td style="padding: 12px 0 0 2px;">
+											<?=_('2FA Reset successfully'); ?>
+										</td>
+									</tr>
+									<tr>
+										<td style="padding: 20px 0 12px 0;">
+											<input type="button" class="button" value="<?=_('Log in');?>" onclick="location.href='/login/'">
+										</td>
+									</tr>
+								</table>
+							<?php } else { ?>
+								<form method="post" action="/reset2fa/">
+									<table class="login-box">
+										<tr>
+											<td style="padding: 12px 0 0 2px;" class="login-welcome">
+												<?=_('Reset 2FA');?>
+											</td>
+										</tr>
+										<tr>
+											<td style="padding: 12px 0 0 2px;">
+												<?=_('Username');?>
+											</td>
+										</tr>
+										<tr>
+											<td>
+												<input tabindex="1" type="text" size="20px" style="width:240px" name="user" class="vst-input">
+											</td>
+										</tr>
+										<tr>
+											<td style="padding: 12px 0 0 2px;">
+												<?=_('2FA Reset Code');?>
+											</td>
+										</tr>
+										<tr>
+											<td>
+												<input tabindex="1" type="text" size="20px" style="width:240px" name="twofa" class="vst-input">
+											</td>
+										</tr>
+										<tr>
+											<td style="padding: 20px 0 12px 0;">
+												<input tabindex="2" type="submit" value="<?=_('Submit');?>" class="button">&nbsp;&nbsp;
+												<input type="button" class="button cancel" value="<?=_('Back');?>" onclick="location.href='/login/'">
+											</td>
+										</tr>
+									</table>
+								</form>
+							<?php } ?>
+						</td>
+					</tr>
+					<tr>
+						<td colspan=2>
+							<div class="login-bottom">
+								<div style="height:20px"><?php if (isset($ERROR)) echo $ERROR ?></div>
+							</div>
+						</td>
+					</tr>
+				</table>
+			</td>
+		</tr>
+	</table>
+</center>
+</body>
+
+</html>

+ 62 - 61
web/templates/pages/login/reset_1.html

@@ -1,61 +1,62 @@
-        <center>
-            <table class="login">
-                <tr>
-                    <td>
-                        <table>
-                            <tr>
-                                <td style="padding: 22px 30px 0 42px; height: 280px; width: 170px;">
-                                    <a href="/"><img border=0 src="/images/logo.svg" title="<?=_('Hestia Control Panel');?>" style="margin-top: 70px;" /></a>
-                                </td>
-                                <td style="padding: 40px 60px 0 0;" class="animated fadeIn">
-                                    <form method="post" action="/reset/">
-                                        <table class="login-box">
-                                            <tr>
-                                                <td style="padding: 12px 0 0 2px;" class="login-welcome">
-                                                    <?php print _('Forgot Password');?>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td style="padding: 12px 0 0 2px;">
-                                                    <?php print _('Username');?>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td>
-                                                    <input tabindex="1" type="text" size="20px" style="width:240px" name="user" class="vst-input">
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td style="padding: 12px 0 0 2px;">
-                                                    <?php print _('Email');?>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td>
-                                                    <input tabindex="1" type="text" size="20px" style="width:240px" name="email" class="vst-input">
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td style="padding: 20px 0 12px 0;">
-                                                    <input tabindex="2" type="submit" value="<?php print _('Submit');?>" class="button">&nbsp;&nbsp;
-                                                    <input type="button" class="button cancel" value="<?php print _('Back');?>" onclick="location.href='/login/'">
-                                                </td>
-                                            </tr>
-                                        </table>
-                                    </form>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td colspan=2>
-                                    <div class="login-bottom">
-                                        <div style="height:20px"><?php if (isset($ERROR)) echo $ERROR ?></div>
-                                    </div>
-                                </td>
-                            </tr>
-                        </table>
-                    </td>
-                </tr>
-            </table>
-        </center>
-    </body>
-</html>
+<center>
+	<table class="login">
+		<tr>
+			<td>
+				<table>
+					<tr>
+						<td style="padding: 22px 30px 0 42px; height: 280px; width: 170px;">
+							<a href="/"><img border=0 src="/images/logo.svg" title="<?=_('Hestia Control Panel');?>" style="margin-top: 70px;" /></a>
+						</td>
+						<td style="padding: 40px 60px 0 0;" class="animated fadeIn">
+							<form method="post" action="/reset/">
+								<table class="login-box">
+									<tr>
+										<td style="padding: 12px 0 0 2px;" class="login-welcome">
+											<?=_('Forgot Password');?>
+										</td>
+									</tr>
+									<tr>
+										<td style="padding: 12px 0 0 2px;">
+											<?=_('Username');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input tabindex="1" type="text" size="20px" style="width:240px" name="user" class="vst-input">
+										</td>
+									</tr>
+									<tr>
+										<td style="padding: 12px 0 0 2px;">
+											<?=_('Email');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input tabindex="1" type="text" size="20px" style="width:240px" name="email" class="vst-input">
+										</td>
+									</tr>
+									<tr>
+										<td style="padding: 20px 0 12px 0;">
+											<input tabindex="2" type="submit" value="<?=_('Submit');?>" class="button">&nbsp;&nbsp;
+											<input type="button" class="button cancel" value="<?=_('Back');?>" onclick="location.href='/login/'">
+										</td>
+									</tr>
+								</table>
+							</form>
+						</td>
+					</tr>
+					<tr>
+						<td colspan=2>
+							<div class="login-bottom">
+								<div style="height:20px"><?php if (isset($ERROR)) echo $ERROR ?></div>
+							</div>
+						</td>
+					</tr>
+				</table>
+			</td>
+		</tr>
+	</table>
+</center>
+</body>
+
+</html>

+ 57 - 56
web/templates/pages/login/reset_2.html

@@ -1,56 +1,57 @@
-        <center>
-            <table class="login">
-                <tr>
-                    <td>
-                        <table>
-                            <tr>
-                                <td style="padding: 22px 30px 0 42px; height: 280px; width: 170px;">
-                                    <a href="/"><img border=0 src="/images/logo.svg" title="<?=_('Hestia Control Panel');?>" style="margin-top: 70px;" /></a>
-                                </td>
-                                <td style="padding: 40px 60px 0 0;" class="animated fadeIn">
-                                    <form method="get" action="/reset/" >
-                                        <table class="login-box">
-                                            <tr>
-                                                <td style="padding: 12px 0 0 2px;" class="login-welcome">
-                                                    <?php print _('Forgot Password');?>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td style="padding: 12px 0 0 2px;">
-                                                    <?php print _('RESET_CODE_SENT');?>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td style="padding: 12px 0 0 2px;" colspan=2><?php print _('Reset Code');?></td>
-                                            </tr>
-                                            <tr>
-                                                <td>
-                                                    <input type="hidden" name="action" value="confirm">
-                                                    <input type="hidden" name="user" value="<?=htmlentities($_GET['user'], ENT_QUOTES|ENT_HTML5)?>">
-                                                    <input tabindex="1" type="text" size="20px" style="width:240px" name="code" class="vst-input">
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td style="padding: 20px 0 12px 0;">
-                                                    <input tabindex="2" type="submit" value="<?php print _('Confirm');?>" class="button">&nbsp;&nbsp;
-                                                    <input type="button" class="button cancel" value="<?php print _('Back');?>" onclick="location.href='/reset/'">
-                                                </td>
-                                            </tr>
-                                        </table>
-                                    </form>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td colspan=2>
-                                    <div class="login-bottom">
-                                        <div style="height:20px"><?php if (isset($ERROR)) echo $ERROR ?></div>
-                                    </div>
-                                </td>
-                            </tr>
-                        </table>
-                    </td>
-                </tr>
-            </table>
-        </center>
-    </body>
-</html>
+<center>
+	<table class="login">
+		<tr>
+			<td>
+				<table>
+					<tr>
+						<td style="padding: 22px 30px 0 42px; height: 280px; width: 170px;">
+							<a href="/"><img border=0 src="/images/logo.svg" title="<?=_('Hestia Control Panel');?>" style="margin-top: 70px;" /></a>
+						</td>
+						<td style="padding: 40px 60px 0 0;" class="animated fadeIn">
+							<form method="get" action="/reset/">
+								<table class="login-box">
+									<tr>
+										<td style="padding: 12px 0 0 2px;" class="login-welcome">
+											<?=_('Forgot Password');?>
+										</td>
+									</tr>
+									<tr>
+										<td style="padding: 12px 0 0 2px;">
+											<?=_('RESET_CODE_SENT');?>
+										</td>
+									</tr>
+									<tr>
+										<td style="padding: 12px 0 0 2px;" colspan=2><?=_('Reset Code');?></td>
+									</tr>
+									<tr>
+										<td>
+											<input type="hidden" name="action" value="confirm">
+											<input type="hidden" name="user" value="<?=htmlentities($_GET['user'], ENT_QUOTES|ENT_HTML5)?>">
+											<input tabindex="1" type="text" size="20px" style="width:240px" name="code" class="vst-input">
+										</td>
+									</tr>
+									<tr>
+										<td style="padding: 20px 0 12px 0;">
+											<input tabindex="2" type="submit" value="<?=_('Confirm');?>" class="button">&nbsp;&nbsp;
+											<input type="button" class="button cancel" value="<?=_('Back');?>" onclick="location.href='/reset/'">
+										</td>
+									</tr>
+								</table>
+							</form>
+						</td>
+					</tr>
+					<tr>
+						<td colspan=2>
+							<div class="login-bottom">
+								<div style="height:20px"><?php if (isset($ERROR)) echo $ERROR ?></div>
+							</div>
+						</td>
+					</tr>
+				</table>
+			</td>
+		</tr>
+	</table>
+</center>
+</body>
+
+</html>

+ 65 - 64
web/templates/pages/login/reset_3.html

@@ -1,64 +1,65 @@
-        <center>
-            <table class="login">
-                <tr>
-                    <td>
-                        <table>
-                            <tr>
-                                <td style="padding: 22px 30px 0 42px; height: 280px; width: 170px;">
-                                    <a href="/"><img border=0 src="/images/logo.svg" title="<?=_('Hestia Control Panel');?>" style="margin-top: 70px;" /></a>
-                                </td>
-                                <td style="padding: 40px 60px 0 0;" class="animated fadeIn">
-                                    <form method="post">
-                                        <table class="login-box">
-                                            <tr>
-                                                <td style="padding: 12px 0 0 2px;" class="login-welcome">
-                                                    <?php print _('Forgot Password');?>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td style="padding: 12px 0 0 2px;">
-                                                    <input type="hidden" name="action" value="confirm" >
-                                                    <input type="hidden" name="user" value="<?=htmlentities($_GET['user'], ENT_QUOTES|ENT_HTML5)?>" >
-                                                    <input type="hidden" name="code" value="<?=htmlentities($_GET['code'], ENT_QUOTES|ENT_HTML5)?>" >
-                                                    <?php print _('New Password');?>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td>
-                                                    <input tabindex="1" type="password" size="20px" style="width:200px;" name="password" class="vst-input">
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td style="padding: 12px 0 0 2px;">
-                                                    <?php print _('Confirm Password');?>
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td>
-                                                    <input tabindex="2" type="password" size="20px"  style="width:200px;" name="password_confirm" class="vst-input">
-                                                </td>
-                                            </tr>
-                                            <tr>
-                                                <td style="padding: 20px 0 12px 0;">
-                                                    <input tabindex="3" type="submit" value="<?php print _('Reset');?>" class="button">&nbsp;&nbsp;
-                                                    <input type="button" class="button cancel" value="<?php print _('Back');?>" onclick="location.href='/login/'">
-                                                </td>
-                                            </tr>
-                                        </table>
-                                    </form>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td colspan=2>
-                                    <div class="login-bottom">
-                                        <div style="height:20px"><?php if (isset($ERROR)) echo $ERROR ?></div>
-                                    </div>
-                                </td>
-                            </tr>
-                        </table>
-                    </td>
-                </tr>
-            </table>
-        </center>
-    </body>
-</html>
+<center>
+	<table class="login">
+		<tr>
+			<td>
+				<table>
+					<tr>
+						<td style="padding: 22px 30px 0 42px; height: 280px; width: 170px;">
+							<a href="/"><img border=0 src="/images/logo.svg" title="<?=_('Hestia Control Panel');?>" style="margin-top: 70px;" /></a>
+						</td>
+						<td style="padding: 40px 60px 0 0;" class="animated fadeIn">
+							<form method="post">
+								<table class="login-box">
+									<tr>
+										<td style="padding: 12px 0 0 2px;" class="login-welcome">
+											<?=_('Forgot Password');?>
+										</td>
+									</tr>
+									<tr>
+										<td style="padding: 12px 0 0 2px;">
+											<input type="hidden" name="action" value="confirm">
+											<input type="hidden" name="user" value="<?=htmlentities($_GET['user'], ENT_QUOTES|ENT_HTML5)?>">
+											<input type="hidden" name="code" value="<?=htmlentities($_GET['code'], ENT_QUOTES|ENT_HTML5)?>">
+											<?=_('New Password');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input tabindex="1" type="password" size="20px" style="width:200px;" name="password" class="vst-input">
+										</td>
+									</tr>
+									<tr>
+										<td style="padding: 12px 0 0 2px;">
+											<?=_('Confirm Password');?>
+										</td>
+									</tr>
+									<tr>
+										<td>
+											<input tabindex="2" type="password" size="20px" style="width:200px;" name="password_confirm" class="vst-input">
+										</td>
+									</tr>
+									<tr>
+										<td style="padding: 20px 0 12px 0;">
+											<input tabindex="3" type="submit" value="<?=_('Reset');?>" class="button">&nbsp;&nbsp;
+											<input type="button" class="button cancel" value="<?=_('Back');?>" onclick="location.href='/login/'">
+										</td>
+									</tr>
+								</table>
+							</form>
+						</td>
+					</tr>
+					<tr>
+						<td colspan=2>
+							<div class="login-bottom">
+								<div style="height:20px"><?php if (isset($ERROR)) echo $ERROR ?></div>
+							</div>
+						</td>
+					</tr>
+				</table>
+			</td>
+		</tr>
+	</table>
+</center>
+</body>
+
+</html>

+ 79 - 91
web/templates/pages/setup_webapp.html

@@ -1,97 +1,85 @@
+<!-- Begin toolbar -->
 <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="/add/webapp/?domain=<?=$v_domain?>"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
-          </div>
-          <div class="l-unit-toolbar__buttonstrip float-right">
-              <?php
-              if (!empty($_SESSION['error_msg'])) {
-                echo "<span class=\"vst-error\"> → ".htmlentities($_SESSION['error_msg'])."</span>";
-              } else {
-                if (!empty($_SESSION['ok_msg'])) {
-                  echo "<span class=\"vst-ok\"> → ".$_SESSION['ok_msg']."</span>";
-                }
-              }
-            ?>
-            <a href="#" class="ui-button" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i> <?=_('Install')?></a>
-          </div>
-        </div>
-      </div>
+	<div class="l-sort clearfix">
+		<div class="l-unit-toolbar__buttonstrip">
+			<a class="ui-button cancel" dir="ltr" id="btn-back" href="/add/webapp/?domain=<?=$v_domain?>"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
+		</div>
+		<div class="l-unit-toolbar__buttonstrip float-right">
+			<?php
+				if (!empty($_SESSION['error_msg'])) {
+					echo "<span class=\"vst-error\"> → ".htmlentities($_SESSION['error_msg'])."</span>";
+				} else {
+					if (!empty($_SESSION['ok_msg'])) {
+						echo "<span class=\"vst-ok\"> → ".$_SESSION['ok_msg']."</span>";
+					}
+				}
+			?>
+			<a href="#" class="ui-button" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i> <?=_('Install');?></a>
+		</div>
+	</div>
+</div>
+<!-- End toolbar -->
 
-    <div class="l-separator"></div>
+<div class="l-separator"></div>
 
-    <div class="l-center animated fadeIn" style="padding-top:240px;">
-        <?php
-            $back = $_SESSION['back'];
-            if (empty($back)) {
-            $back = "location.href='/list/web/'";
-            } else {
-            $back = "location.href='".$back."'";
-            }
-        ?>
+<div class="l-center animated fadeIn" style="padding-top:240px;">
 
-        <?php if( !empty($WebappInstaller->getOptions())): ?>
+	<?php if( !empty($WebappInstaller->getOptions())): ?>
+		<form id="vstobjects" method="POST" name="v_setup_webapp" style="padding-top:0px;">
+			<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
+			<input type="hidden" name="ok" value="true" />
 
-        <form id="vstobjects" method="POST" name="v_setup_webapp" style="padding-top:0px;" >
-            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
-            <input type="hidden" name="ok" value="true" />
+			<div class="app-form">
+				<?php if( !$WebappInstaller->isDomainRootClean()): ?>
+					<span class="alert alert-info alert-with-icon">
+						<i class="fas fa-info"></i>
+						<?=_('Data loss warning!<br>Your web domain already has files uploaded, the installer will overwrite your files and/or the installation might fail.<br/><br/> Please use the installer only for empty web domains');?>
+					</span>
+					<br />
+				<?php endif; ?>
+				<?php foreach ($WebappInstaller->getOptions() as $form_name => $form_control):?>
+					<?php
+						$f_name = $WebappInstaller->formNs() . '_' . $form_name;
+						$f_type = $form_control;
+						$f_value = '';
+						$f_label = ucwords(str_replace(['.','_'], ' ', $form_name));
+						$f_placeholder = '';
+						if (is_array($form_control)) {
+								$f_type = (!empty($form_control['type']))?$form_control['type']:'text';
+								$f_value = (!empty($form_control['value']))?$form_control['value']:'';
+								$f_placeholder = (!empty($form_control['placeholder']))?$form_control['placeholder']:'';
+						}
 
-            <div class="app-form" >
-                <?php if( !$WebappInstaller->isDomainRootClean()): ?>
-                  <span class="alert alert-info alert-with-icon">
-                      <i class="fas fa-info"></i>
-                      <?=_('Data loss warning!<br>Your web domain already has files uploaded, the installer will overwrite your files and/or the installation might fail.<br/><br/> Please use the installer only for empty web domains')?>
-                  </span>
-                  <br/>
-                <?php endif ?>
-                <?php foreach ($WebappInstaller->getOptions() as $form_name => $form_control):?>
-                    <?php
-                        $f_name = $WebappInstaller->formNs() . '_' . $form_name;
-                        $f_type = $form_control;
-                        $f_value = '';
-                        $f_label = ucwords(str_replace(['.','_'], ' ', $form_name));
-                        $f_placeholder = '';
-                        if (is_array($form_control)) {
-                            $f_type = (!empty($form_control['type']))?$form_control['type']:'text';
-                            $f_value = (!empty($form_control['value']))?$form_control['value']:'';
-                            $f_placeholder = (!empty($form_control['placeholder']))?$form_control['placeholder']:'';
-                        }
-
-                        $f_value = htmlentities($f_value);
-                        $f_label = htmlentities($f_label);
-                        $f_placeholder = htmlentities($f_placeholder);
-                    ?>
-                    <div class="form-group">
-                        <label style="padding-bottom: 2px;" for="<?=$f_name?>"><?=$f_label?>
-                        <?php if ($f_type === 'password'):?>
-                            / <a href="javascript:randomString('<?=$f_name?>');" class="generate" ><?php print _('generate')?></a>
-                        <?php endif?>
-                        </label>
-                        
-                        <?php if (in_array($f_type, ['select']) && count($form_control['options']) ):?>
-                          <p style="margin-top:0;"></p>
-                            <select class="vst-list" name="<?=$f_name?>">
-                                <?foreach ($form_control['options'] as $option):?>
-                                    <?php $selected = (!empty($form_control['value']) && $option === $form_control['value'])?'selected':''?>
-                                    <option value="<?=$option?>" <?=$selected?>  ><?=htmlentities($option)?></option>
-                                <?endforeach?>
-                            </select>
-                          </p>
-                        <?php elseif (in_array($f_type, ['boolean'])):?>
-                        <p>
-                            <?php $checked = (!empty($f_value))?'checked':''?>
-                            <input style="width:auto;" type="checkbox" class="vst-input" name="<?=$f_name?>" id="<?=$f_name?>" <?=$checked?> value="true">
-                        </p>
-                        <?php else:?>
-                          <p style="margin-top:0;"></p>
-                            <input type="text" size="20" class="vst-input" name="<?=$f_name?>" id="<?=$f_name?>" placeholder="<?=$f_placeholder?>" value="<?=$f_value?>">
-                          </p>
-                        <?php endif?>
-                    </div>
-                <?php endforeach; ?>
-
-            </div>
-        </form>
-
-        <?php endif ?>
-    </div>
+						$f_value = htmlentities($f_value);
+						$f_label = htmlentities($f_label);
+						$f_placeholder = htmlentities($f_placeholder);
+					?>
+					<div class="form-group">
+						<label style="padding-bottom: 2px;" for="<?=$f_name?>"><?=$f_label?>
+							<?php if ($f_type === 'password'):?> / <a href="javascript:randomString('<?=$f_name?>');" class="generate"><?=_('generate');?></a> <?php endif?>
+						</label>
+						<?php if (in_array($f_type, ['select']) && count($form_control['options']) ):?>
+							<p style="margin-top:0;"></p>
+							<select class="vst-list" name="<?=$f_name?>">
+								<?php foreach ($form_control['options'] as $option):?>
+									<?php $selected = (!empty($form_control['value']) && $option === $form_control['value'])?'selected':''?>
+									<option value="<?=$option?>" <?=$selected?>><?=htmlentities($option)?></option>
+								<?php endforeach; ?>
+							</select>
+							</p>
+						<?php elseif (in_array($f_type, ['boolean'])):?>
+							<p>
+								<?php $checked = (!empty($f_value))?'checked':''?>
+								<input style="width:auto;" type="checkbox" class="vst-input" name="<?=$f_name?>" id="<?=$f_name?>" <?=$checked?> value="true">
+							</p>
+						<?php else:?>
+							<p style="margin-top:0;"></p>
+							<input type="text" size="20" class="vst-input" name="<?=$f_name?>" id="<?=$f_name?>" placeholder="<?=$f_placeholder?>" value="<?=$f_value?>">
+							</p>
+						<?php endif; ?>
+					</div>
+				<?php endforeach; ?>
+			</div>
+		</form>
+	<?php endif ?>
+</div>