Skip to content

Commit a7fa087

Browse files
author
Kristan Kenney
committed
Reorganize HTML template files
Remove unnecessary user-specific set Organize files in more logical path layout
1 parent 681fbdc commit a7fa087

File tree

104 files changed

+102
-3205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+102
-3205
lines changed

web/css/src/themes/default.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4202,7 +4202,8 @@ form#vstobjects.suspended {
42024202
box-shadow: 0px 2px 4px rgb(0 0 0 / 25%);
42034203
}
42044204

4205-
.body-login .debug-panel-header, .debug-panel-contents {
4205+
.body-login .debug-panel-header, .body-login .debug-panel-contents,
4206+
.body-reset .debug-panel-header, .body-reset .debug-panel-contents {
42064207
display: none;
42074208
}
42084209

web/css/themes/default.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/edit/user/index.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@
171171
$v_sort_order = escapeshellarg($_POST['v_sort_order']);
172172
exec (HESTIA_CMD."v-change-user-sort-order ".escapeshellarg($v_username)." ".$v_sort_order, $output, $return_var);
173173
check_return_code($return_var,$output);
174+
unset($_SESSION['userSortOrder']);
175+
$_SESSION['userSortOrder'] = $v_sort_order;
174176
unset($output);
175177
}
176178

web/inc/main.php

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,10 @@ function render_page($user, $TAB, $page) {
129129
extract($GLOBALS, EXTR_SKIP);
130130

131131
// Body
132-
if (($_SESSION['userContext'] != 'admin') && (@include($__template_dir . "user/$page.html"))) {
133-
// User page loaded
134-
} else {
135-
// Not admin or user page doesn't exist
136-
// Load admin page
137-
@include($__template_dir . "admin/$page.html");
138-
}
132+
include($__template_dir . "pages/$page.html");
139133

140134
// Including common js files
141-
@include_once(dirname(__DIR__) . '/templates/scripts.html');
135+
@include_once(dirname(__DIR__) . '/templates/includes/end_js.html');
142136
// Including page specific js file
143137
if(file_exists($__pages_js_dir.$page.'.js'))
144138
echo '<script type="text/javascript" src="/js/pages/'.$page.'.js?'.JS_LATEST_UPDATE.'"></script>';
@@ -167,6 +161,9 @@ function top_panel($user, $TAB) {
167161
if ($_SESSION['POLICY_USER_CHANGE_THEME'] === 'no') {
168162
unset($_SESSION['userTheme']);
169163
}
164+
165+
// Set preferred sort order
166+
$_SESSION['userSortOrder'] = $panel[$user]['PREF_UI_SORT'];
170167

171168
// Set home location URLs
172169
if (($_SESSION['userContext'] === 'admin') && (!isset($_SESSION['look']))) {
@@ -189,11 +186,7 @@ function top_panel($user, $TAB) {
189186
}
190187
}
191188

192-
if (($_SESSION['userContext'] === 'admin')) {
193-
include(dirname(__FILE__).'/../templates/admin/panel.html');
194-
} else {
195-
include(dirname(__FILE__).'/../templates/user/panel.html');
196-
}
189+
include(dirname(__FILE__).'/../templates/includes/panel.html');
197190

198191
}
199192

web/js/templates.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ App.Templates.html = {
1313
</li>'
1414
],
1515
notification_empty: [
16-
'<li class="empty"><span><i class="fas fa-bell-slash status-icon" style="font-size: 4rem;"></i><br><br>\
16+
'<li class="empty"><span><i class="fas fa-bell-slash status-icon dim" style="font-size: 4rem;"></i><br><br>\
1717
'+App.Constants.NOTIFICATIONS_EMPTY+'\</span></li>'
1818
]
1919
},

web/list/log/index.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
// Main include
1010
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
1111

12+
// Redirect non-administrators if they request another user's log
13+
if (($_SESSION['userContext'] !== 'admin') && (!empty($_GET['user']))) {
14+
header('location: /login/');
15+
exit();
16+
}
17+
1218
// Data
1319
if (($_SESSION['userContext'] === "admin") && (!empty($_GET['user']))) {
1420
// Check token

web/login/index.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@ function authenticate_user($user, $password, $twofa = ''){
189189

190190
// Set active user theme on login
191191
$_SESSION['userTheme'] = $data[$user]['THEME'];
192+
if (!empty($data[$user]['PREF_UI_SORT'])) {
193+
$_SESSION['userSortOrder'] = $data[$user]['PREF_UI_SORT'];
194+
} else {
195+
$_SESSION['userSortOrder'] = 'name';
196+
}
192197

193198
// Define language
194199
$output = '';
@@ -275,20 +280,20 @@ function authenticate_user($user, $password, $twofa = ''){
275280

276281
require_once('../templates/header.html');
277282
if(!empty($_SESSION['login'])){
278-
require_once('../templates/login_2.html');
283+
require_once('..templates/pages/login/login_2.html');
279284
}else if (empty($_POST['user'])) {
280285
if($_SESSION['LOGIN_STYLE'] == 'old'){
281-
require_once('../templates/login_a.html');
286+
require_once('../templates/pages/login/login_a.html');
282287
}else{
283-
require_once('../templates/login.html');
288+
require_once('../templates/pages/login/login.html');
284289
}
285290
}else if (empty($_POST['password'])) {
286-
require_once('../templates/login_1.html');
291+
require_once('../templates/pages/login/login_1.html');
287292
}else{
288293
if($_SESSION['LOGIN_STYLE'] == 'old'){
289-
require_once('../templates/login_a.html');
294+
require_once('../templates/pages/login/login_a.html');
290295
}else{
291-
require_once('../templates/login.html');
296+
require_once('../templates/pages/login/login.html');
292297
}
293298
}
294299
?>

web/reset/index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@
100100

101101
if (empty($_GET['action'])) {
102102
require_once '../templates/header.html';
103-
require_once '../templates/reset_1.html';
103+
require_once '../templates/pages/login/reset_1.html';
104104
} else {
105105
require_once '../templates/header.html';
106106
if ($_GET['action'] == 'code' ) {
107-
require_once '../templates/reset_2.html';
107+
require_once '../templates/pages/login/reset_2.html';
108108
}
109109
if (($_GET['action'] == 'confirm' ) && (!empty($_GET['code']))) {
110-
require_once '../templates/reset_3.html';
110+
require_once '../templates/pages/login/reset_3.html';
111111
}
112112
}
113113

web/reset2fa/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@
3434
}
3535

3636
require_once '../templates/header.html';
37-
require_once '../templates/reset2fa.html';
37+
require_once '../templates/pages/login/reset2fa.html';
3838

3939
?>

web/templates/header.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<?php require ''.$_SERVER['HESTIA'].'/web/templates/includes/title.html'; ?>
66
<?php require ''.$_SERVER['HESTIA'].'/web/templates/includes/css.html'; ?>
7-
<?php require ''.$_SERVER['HESTIA'].'/web/templates/includes/js.html'; ?>
7+
<?php require ''.$_SERVER['HESTIA'].'/web/templates/includes/top_js.html'; ?>
88
<script>
99
//
1010
// GLOBAL SETTINGS
@@ -19,5 +19,5 @@
1919

2020
<body class="body-<?=strtolower($TAB)?> lang-<?=$_SESSION['language']?>">
2121
<?php if (($_SESSION['DEBUG_MODE']) == "true" ) {?>
22-
<?php require ''.$_SERVER['HESTIA'].'/web/templates/debug.html'; ?>
22+
<?php require ''.$_SERVER['HESTIA'].'/web/templates/pages/debug_panel.html'; ?>
2323
<?php } ?>

0 commit comments

Comments
 (0)