Skip to content

Commit 531bdae

Browse files
author
Kristan Kenney
committed
Merge branch 'feature/onecore' into feature/user-roles
2 parents 559a982 + a7fa087 commit 531bdae

File tree

106 files changed

+124
-3222
lines changed

Some content is hidden

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

106 files changed

+124
-3222
lines changed

web/css/src/themes/default.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4192,15 +4192,18 @@ form#vstobjects.suspended {
41924192
.debug-panel-contents {
41934193
font-size:12px !important;
41944194
padding:18px;
4195-
position:sticky;
4195+
position: absolute;
41964196
top:0;
41974197
z-index:3000;
41984198
height:250px;
41994199
overflow-x: hidden;
42004200
overflow-y: scroll;
4201+
border-bottom: 1px solid rgba(255,255,255,0.65);
4202+
box-shadow: 0px 2px 4px rgb(0 0 0 / 25%);
42014203
}
42024204

4203-
.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 {
42044207
display: none;
42054208
}
42064209

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: 7 additions & 14 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>';
@@ -152,7 +146,7 @@ function top_panel($user, $TAB) {
152146
$command = HESTIA_CMD."v-list-user ".escapeshellarg($user)." 'json'";
153147
exec ($command, $output, $return_var);
154148
if ( $return_var > 0 ) {
155-
header("Location: /error/");
149+
header("Location: /logout/");
156150
exit;
157151
}
158152
$panel = json_decode(implode('', $output), true);
@@ -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: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
<!doctype html>
22
<html lang="<?php echo $_SESSION['LANGUAGE'];?>">
3+
34
<head>
4-
<!-- Load necessary CSS and JavaScript from init.html source -->
5-
<?php require ''.$_SERVER['HESTIA'].'/web/templates/init.html'; ?>
5+
<?php require ''.$_SERVER['HESTIA'].'/web/templates/includes/title.html'; ?>
6+
<?php require ''.$_SERVER['HESTIA'].'/web/templates/includes/css.html'; ?>
7+
<?php require ''.$_SERVER['HESTIA'].'/web/templates/includes/top_js.html'; ?>
68
<script>
79
//
810
// GLOBAL SETTINGS
911
//
1012
var GLOBAL = {};
11-
GLOBAL.FTP_USER_PREFIX = 'admin_';
12-
GLOBAL.DB_USER_PREFIX = 'admin_';
13+
GLOBAL.FTP_USER_PREFIX = 'admin_';
14+
GLOBAL.DB_USER_PREFIX = 'admin_';
1315
GLOBAL.DB_DBNAME_PREFIX = 'admin_';
1416
GLOBAL.AJAX_URL = '';
15-
1617
</script>
1718
</head>
19+
1820
<body class="body-<?=strtolower($TAB)?> lang-<?=$_SESSION['language']?>">
1921
<?php if (($_SESSION['DEBUG_MODE']) == "true" ) {?>
20-
<?php require ''.$_SERVER['HESTIA'].'/web/templates/debug.html'; ?>
21-
<?php } ?>
22-
22+
<?php require ''.$_SERVER['HESTIA'].'/web/templates/pages/debug_panel.html'; ?>
23+
<?php } ?>

0 commit comments

Comments
 (0)