diff --git a/src/react/src/components/CronJob/Edit/EditCronJob.jsx b/src/react/src/components/CronJob/Edit/EditCronJob.jsx index 376832fd7..4c081c26a 100644 --- a/src/react/src/components/CronJob/Edit/EditCronJob.jsx +++ b/src/react/src/components/CronJob/Edit/EditCronJob.jsx @@ -13,7 +13,6 @@ import QS from 'qs'; import './EditCronJob.scss'; import { Helmet } from 'react-helmet'; -import { checkAuthHandler } from 'src/actions/Session/sessionActions'; import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions'; import HtmlParser from 'react-html-parser'; diff --git a/src/react/src/components/DNSRecord/Edit/EditDNSRecord.jsx b/src/react/src/components/DNSRecord/Edit/EditDNSRecord.jsx index 46647a7d0..114ba65d7 100644 --- a/src/react/src/components/DNSRecord/Edit/EditDNSRecord.jsx +++ b/src/react/src/components/DNSRecord/Edit/EditDNSRecord.jsx @@ -11,7 +11,6 @@ import { useHistory } from 'react-router-dom'; import { useDispatch, useSelector } from 'react-redux'; import QS from 'qs'; import { Helmet } from 'react-helmet'; -import { checkAuthHandler } from 'src/actions/Session/sessionActions'; import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions'; import HtmlParser from 'react-html-parser'; diff --git a/src/react/src/components/DomainNameSystem/Edit/EditDomainNameSystem.jsx b/src/react/src/components/DomainNameSystem/Edit/EditDomainNameSystem.jsx index 98916e6d0..3a957a84c 100644 --- a/src/react/src/components/DomainNameSystem/Edit/EditDomainNameSystem.jsx +++ b/src/react/src/components/DomainNameSystem/Edit/EditDomainNameSystem.jsx @@ -13,7 +13,7 @@ import QS from 'qs'; import './EditDomainNameSystem.scss'; import { Helmet } from 'react-helmet'; -import { checkAuthHandler } from 'src/actions/Session/sessionActions'; +import { andler } from 'src/actions/Session/sessionActions'; import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions'; import HtmlParser from 'react-html-parser'; diff --git a/src/react/src/components/InternetProtocol/Edit/EditInternetProtocol.jsx b/src/react/src/components/InternetProtocol/Edit/EditInternetProtocol.jsx index 7c3fd217e..d65557cc7 100644 --- a/src/react/src/components/InternetProtocol/Edit/EditInternetProtocol.jsx +++ b/src/react/src/components/InternetProtocol/Edit/EditInternetProtocol.jsx @@ -15,7 +15,6 @@ import QS from 'qs'; import './EditInternetProtocol.scss'; import { Helmet } from 'react-helmet'; -import { checkAuthHandler } from 'src/actions/Session/sessionActions'; import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions'; import HtmlParser from 'react-html-parser'; diff --git a/src/react/src/components/Mail/Add/AddMail.jsx b/src/react/src/components/Mail/Add/AddMail.jsx index f0740f804..92378a714 100644 --- a/src/react/src/components/Mail/Add/AddMail.jsx +++ b/src/react/src/components/Mail/Add/AddMail.jsx @@ -11,7 +11,6 @@ import { useDispatch, useSelector } from 'react-redux'; import './AddMail.scss' import { Helmet } from 'react-helmet'; -import { checkAuthHandler } from 'src/actions/Session/sessionActions'; import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions'; import HtmlParser from 'react-html-parser'; diff --git a/src/react/src/components/Mail/Edit/EditMail.jsx b/src/react/src/components/Mail/Edit/EditMail.jsx index 6f6f1333b..9a3181cdd 100644 --- a/src/react/src/components/Mail/Edit/EditMail.jsx +++ b/src/react/src/components/Mail/Edit/EditMail.jsx @@ -13,7 +13,6 @@ import QS from 'qs'; import './EditMail.scss'; import { Helmet } from 'react-helmet'; -import { checkAuthHandler } from 'src/actions/Session/sessionActions'; import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions'; import HtmlParser from 'react-html-parser'; diff --git a/src/react/src/components/MailAccount/Edit/EditMailAccount.jsx b/src/react/src/components/MailAccount/Edit/EditMailAccount.jsx index 49c0f9e89..8ba0e35c4 100644 --- a/src/react/src/components/MailAccount/Edit/EditMailAccount.jsx +++ b/src/react/src/components/MailAccount/Edit/EditMailAccount.jsx @@ -15,7 +15,6 @@ import { useHistory } from 'react-router-dom'; import Spinner from '../../Spinner/Spinner'; import { useDispatch, useSelector } from 'react-redux'; import { Helmet } from 'react-helmet'; -import { checkAuthHandler } from 'src/actions/Session/sessionActions'; import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions'; import HtmlParser from 'react-html-parser'; diff --git a/src/react/src/components/Package/Edit/EditPackage.jsx b/src/react/src/components/Package/Edit/EditPackage.jsx index 2780ba9b1..4f2eb4f33 100644 --- a/src/react/src/components/Package/Edit/EditPackage.jsx +++ b/src/react/src/components/Package/Edit/EditPackage.jsx @@ -16,7 +16,6 @@ import QS from 'qs'; import './EditPackage.scss'; import { Helmet } from 'react-helmet'; -import { checkAuthHandler } from 'src/actions/Session/sessionActions'; import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions'; import HtmlParser from 'react-html-parser'; diff --git a/src/react/src/components/User/Add/AddUser.jsx b/src/react/src/components/User/Add/AddUser.jsx index f438f1f74..dea878f92 100644 --- a/src/react/src/components/User/Add/AddUser.jsx +++ b/src/react/src/components/User/Add/AddUser.jsx @@ -13,7 +13,6 @@ import { useDispatch, useSelector } from 'react-redux'; import './AddUser.scss'; import { Helmet } from 'react-helmet'; -import { checkAuthHandler } from 'src/actions/Session/sessionActions'; import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions'; import HtmlParser from 'react-html-parser'; diff --git a/src/react/src/components/User/Edit/EditUser.jsx b/src/react/src/components/User/Edit/EditUser.jsx index b021f4b7b..4f41fe7c8 100644 --- a/src/react/src/components/User/Edit/EditUser.jsx +++ b/src/react/src/components/User/Edit/EditUser.jsx @@ -15,7 +15,6 @@ import QS from 'qs'; import './EditUser.scss'; import { Helmet } from 'react-helmet'; -import { checkAuthHandler } from 'src/actions/Session/sessionActions'; import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions'; import HtmlParser from 'react-html-parser'; diff --git a/src/react/src/components/WebDomain/Edit/EditWeb.jsx b/src/react/src/components/WebDomain/Edit/EditWeb.jsx index fb947efd5..113d60077 100644 --- a/src/react/src/components/WebDomain/Edit/EditWeb.jsx +++ b/src/react/src/components/WebDomain/Edit/EditWeb.jsx @@ -18,7 +18,6 @@ import QS from 'qs'; import './EditWeb.scss'; import TextArea from '../../ControlPanel/AddItemLayout/Form/TextArea/TextArea'; import { Helmet } from 'react-helmet'; -import { checkAuthHandler } from 'src/actions/Session/sessionActions'; import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions'; import HtmlParser from 'react-html-parser'; diff --git a/src/react/src/containers/App/App.js b/src/react/src/containers/App/App.js index c5e00d48d..3be606931 100755 --- a/src/react/src/containers/App/App.js +++ b/src/react/src/containers/App/App.js @@ -11,7 +11,6 @@ import ControlPanelContent from '../ControlPanelContent/ControlPanelContent'; import WebLogs from '../WebLogs/WebLogs'; import LoginForm from 'src/components/Login/LoginForm'; import { useDispatch, useSelector } from 'react-redux'; -import { setAuthToken } from 'src/utils/token'; import { checkAuthHandler } from 'src/actions/Session/sessionActions'; import ServiceInfo from 'src/containers/ServiceInfo'; import ForgotPassword from 'src/components/ForgotPassword'; @@ -70,9 +69,13 @@ const App = () => { useEffect(() => { if (!Object.entries(session.i18n).length) { - dispatch(checkAuthHandler()).then(token => { - setLoading(false); - }); + dispatch(checkAuthHandler()) + .then(token => { + setLoading(false); + }, (error) => { + console.error(error); + return history.push('/login'); + }); } }, [dispatch, history, session]); diff --git a/src/react/src/containers/MailAccounts/MailAccounts.jsx b/src/react/src/containers/MailAccounts/MailAccounts.jsx index a1b6f3ba4..aa279be85 100644 --- a/src/react/src/containers/MailAccounts/MailAccounts.jsx +++ b/src/react/src/containers/MailAccounts/MailAccounts.jsx @@ -17,7 +17,6 @@ import { Link } from 'react-router-dom'; import './MailAccounts.scss'; import { Helmet } from 'react-helmet'; -import { checkAuthHandler } from 'src/actions/Session/sessionActions'; import { refreshCounters } from 'src/actions/MenuCounters/menuCounterActions'; export default function MailAccounts(props) { diff --git a/web/api/v1/add/dns/index.php b/web/api/v1/add/dns/index.php index bb39939bc..b924c484f 100644 --- a/web/api/v1/add/dns/index.php +++ b/web/api/v1/add/dns/index.php @@ -165,13 +165,8 @@ if (empty($_GET['domain'])) { $v_ns8 = str_replace("'", "", $nameservers[7]); unset($output); } - - // render_page($user, $TAB, 'add_dns'); } else { - // Display body for dns record - $v_domain = $_GET['domain']; - // render_page($user, $TAB, 'add_dns_rec'); } $result = array( diff --git a/web/api/v1/add/firewall/index.php b/web/api/v1/add/firewall/index.php index 0f6e69e27..d2537e5ea 100644 --- a/web/api/v1/add/firewall/index.php +++ b/web/api/v1/add/firewall/index.php @@ -63,8 +63,6 @@ if (!empty($_POST['ok'])) { } } -// Render -// render_page($user, $TAB, 'add_firewall'); $result = array( 'ok_msg' => $_SESSION['ok_msg'], 'error_msg' => $_SESSION['error_msg'] diff --git a/web/api/v1/add/mail/index.php b/web/api/v1/add/mail/index.php index 8f5899587..4c830fb7a 100644 --- a/web/api/v1/add/mail/index.php +++ b/web/api/v1/add/mail/index.php @@ -195,18 +195,6 @@ if (!empty($_POST['ok_acc'])) { } } -// Render page -if (empty($_GET['domain'])) { - // Display body for mail domain - - // render_page($user, $TAB, 'add_mail'); -} else { - // Display body for mail account - - $v_domain = $_GET['domain']; - // render_page($user, $TAB, 'add_mail_acc'); -} - $result = array( 'error_msg' => $_SESSION['error_msg'], 'ok_msg' => $_SESSION['ok_msg'] diff --git a/web/api/v1/add/package/index.php b/web/api/v1/add/package/index.php index 055d0e9c1..fc8da1dec 100644 --- a/web/api/v1/add/package/index.php +++ b/web/api/v1/add/package/index.php @@ -200,9 +200,6 @@ if (empty($v_bandwidth)) $v_bandwidth = "'1000'"; if (empty($v_ns1)) $v_ns1 = 'ns1.example.ltd'; if (empty($v_ns2)) $v_ns2 = 'ns2.example.ltd'; -// Render page -// render_page($user, $TAB, 'add_package'); - $result = array( 'web_system' => $_SESSION['WEB_SYSTEM'], 'web_templates' => $web_templates, diff --git a/web/api/v1/edit/backup/exclusions/index.php b/web/api/v1/edit/backup/exclusions/index.php index 13bd32c97..6723490c9 100644 --- a/web/api/v1/edit/backup/exclusions/index.php +++ b/web/api/v1/edit/backup/exclusions/index.php @@ -122,10 +122,6 @@ if (!empty($_POST['save'])) { } } - -// Render page -// render_page($user, $TAB, 'edit_backup_exclusions'); - $result = array( 'web' => $v_web, 'dns' => $v_dns, diff --git a/web/api/v1/edit/cron/index.php b/web/api/v1/edit/cron/index.php index 697c04922..ec800f1c2 100644 --- a/web/api/v1/edit/cron/index.php +++ b/web/api/v1/edit/cron/index.php @@ -75,9 +75,6 @@ if (!empty($_POST['save'])) { } } -// Render page -// render_page($user, $TAB, 'edit_cron'); - $result = array( 'username' => $user, 'job' => $_GET['job'], diff --git a/web/api/v1/edit/db/index.php b/web/api/v1/edit/db/index.php index 7aaced147..a4f62e5fd 100644 --- a/web/api/v1/edit/db/index.php +++ b/web/api/v1/edit/db/index.php @@ -83,9 +83,6 @@ if (!empty($_POST['save'])) { } } -// Render page -// render_page($user, $TAB, 'edit_db'); - $result = array( 'username' => $user, 'database' => $_GET['database'], diff --git a/web/api/v1/edit/server/index.php b/web/api/v1/edit/server/index.php index d52595256..c63dba793 100644 --- a/web/api/v1/edit/server/index.php +++ b/web/api/v1/edit/server/index.php @@ -607,10 +607,6 @@ foreach ($sys_arr as $key => $value) { $_SESSION[$key] = $value; } - -// Render page -// render_page($user, $TAB, 'edit_server'); - $result = array( 'hostname' => $v_hostname, 'timezones' => $v_timezones, diff --git a/web/api/v1/list/backup/exclusions/index.php b/web/api/v1/list/backup/exclusions/index.php index f1f350f01..96fe901c9 100644 --- a/web/api/v1/list/backup/exclusions/index.php +++ b/web/api/v1/list/backup/exclusions/index.php @@ -12,9 +12,6 @@ exec (VESTA_CMD."v-list-user-backup-exclusions $user json", $output, $return_var $data = json_decode(implode('', $output), true); unset($output); -// Render page -// render_page($user, $TAB, 'list_backup_exclusions'); - // Back uri $_SESSION['back'] = $_SERVER['REQUEST_URI']; diff --git a/web/api/v1/list/backup/index.php b/web/api/v1/list/backup/index.php index 54e515202..9c82d7fe2 100644 --- a/web/api/v1/list/backup/index.php +++ b/web/api/v1/list/backup/index.php @@ -13,15 +13,11 @@ if (empty($_GET['backup'])){ $data = json_decode(implode('', $output), true); $data = array_reverse($data,true); unset($output); - - // render_page($user, $TAB, 'list_backup'); } else { exec (VESTA_CMD."v-list-user-backup $user ".escapeshellarg($_GET['backup'])." json", $output, $return_var); $data = json_decode(implode('', $output), true); $data = array_reverse($data,true); unset($output); - - // render_page($user, $TAB, 'list_backup_detail'); } $backup = $_GET['backup']; diff --git a/web/api/v1/list/cron/index.php b/web/api/v1/list/cron/index.php index 8502aaff4..283e9c970 100644 --- a/web/api/v1/list/cron/index.php +++ b/web/api/v1/list/cron/index.php @@ -14,9 +14,6 @@ $data = json_decode(implode('', $output), true); $data = array_reverse($data,true); unset($output); -// Render page -// render_page($user, $TAB, 'list_cron'); - if($panel[$user]['CRON_REPORTS'] == 'yes') { $cron_reports = __('turn off notifications'); } else { diff --git a/web/api/v1/list/db/index.php b/web/api/v1/list/db/index.php index f9e327a2c..3f2604fb1 100644 --- a/web/api/v1/list/db/index.php +++ b/web/api/v1/list/db/index.php @@ -15,9 +15,6 @@ unset($output); top_panel(empty($_SESSION['look']) ? $_SESSION['user'] : $_SESSION['look'], $TAB); -// Render page -// render_page($user, $TAB, 'list_db'); - // Back uri $_SESSION['back'] = $_SERVER['REQUEST_URI']; diff --git a/web/api/v1/list/dns/index.php b/web/api/v1/list/dns/index.php index 766258aab..07c70d79b 100644 --- a/web/api/v1/list/dns/index.php +++ b/web/api/v1/list/dns/index.php @@ -13,15 +13,11 @@ if (empty($_GET['domain'])){ $data = json_decode(implode('', $output), true); $data = array_reverse($data, true); unset($output); - - // render_page($user, $TAB, 'list_dns'); } else { exec (VESTA_CMD."v-list-dns-records ".$user." ".escapeshellarg($_GET['domain'])." json", $output, $return_var); $data = json_decode(implode('', $output), true); $data = array_reverse($data, true); unset($output); - - // render_page($user, $TAB, 'list_dns_rec'); } foreach ($data as $key => $value) { diff --git a/web/api/v1/list/firewall/index.php b/web/api/v1/list/firewall/index.php index 35d6ecbdf..f3681002f 100644 --- a/web/api/v1/list/firewall/index.php +++ b/web/api/v1/list/firewall/index.php @@ -41,9 +41,6 @@ foreach ($data as $key => $value) { } } -// Render page -// render_page($user, $TAB, 'list_firewall'); - // Back uri $_SESSION['back'] = $_SERVER['REQUEST_URI']; diff --git a/web/api/v1/list/ip/index.php b/web/api/v1/list/ip/index.php index 899e57e5b..63269aa4e 100644 --- a/web/api/v1/list/ip/index.php +++ b/web/api/v1/list/ip/index.php @@ -31,9 +31,6 @@ foreach ($data as $key => $value) { $data[$key]['delete_conf'] = __('DELETE_IP_CONFIRMATION', $key); } -// Render page -// render_page($user, $TAB, 'list_ip'); - // Back uri $_SESSION['back'] = $_SERVER['REQUEST_URI']; diff --git a/web/api/v1/list/log/index.php b/web/api/v1/list/log/index.php index 4eb96b0fd..11d562c0d 100644 --- a/web/api/v1/list/log/index.php +++ b/web/api/v1/list/log/index.php @@ -24,9 +24,6 @@ foreach ($data as $key => $value) { } } -// Render page -// render_page($user, $TAB, 'list_log'); - $object = (object)[]; $object->data = $data; $object->user = $user; diff --git a/web/api/v1/list/mail/index.php b/web/api/v1/list/mail/index.php index 8d6c59126..f37e689ff 100644 --- a/web/api/v1/list/mail/index.php +++ b/web/api/v1/list/mail/index.php @@ -14,8 +14,6 @@ if (empty($_GET['domain'])){ unset($output); $favorites = $_SESSION['favourites']['MAIL']; - - // render_page($user, $TAB, 'list_mail'); } else { exec (VESTA_CMD."v-list-mail-accounts ".$user." ".escapeshellarg($_GET['domain'])." json", $output, $return_var); $data = json_decode(implode('', $output), true); @@ -23,8 +21,6 @@ if (empty($_GET['domain'])){ unset($output); $favorites = $_SESSION['favourites']['MAIL_ACC']; - - // render_page($user, $TAB, 'list_mail_acc'); } $uname_arr=posix_uname(); diff --git a/web/api/v1/list/package/index.php b/web/api/v1/list/package/index.php index 2fe581232..51a521d68 100644 --- a/web/api/v1/list/package/index.php +++ b/web/api/v1/list/package/index.php @@ -29,9 +29,6 @@ foreach ($data as $key => $value) { $data[$key]['delete_conf'] = __('DELETE_PACKAGE_CONFIRMATION', $key); } -// Render page -// render_page($user, $TAB, 'list_packages'); - // Back uri $_SESSION['back'] = $_SERVER['REQUEST_URI']; diff --git a/web/api/v1/list/rrd/index.php b/web/api/v1/list/rrd/index.php index 2ba6b4dc5..79af2e447 100644 --- a/web/api/v1/list/rrd/index.php +++ b/web/api/v1/list/rrd/index.php @@ -18,9 +18,6 @@ exec (VESTA_CMD."v-list-sys-rrd json", $output, $return_var); $data = json_decode(implode('', $output), true); unset($output); -// Render page -// render_page($user, $TAB, 'list_rrd'); - // Back uri $_SESSION['back'] = $_SERVER['REQUEST_URI']; diff --git a/web/api/v1/list/server/index.php b/web/api/v1/list/server/index.php index 47363fcae..f6159b018 100644 --- a/web/api/v1/list/server/index.php +++ b/web/api/v1/list/server/index.php @@ -97,9 +97,6 @@ foreach ($sys as $key => $value) { $sys[$key]['UPTIME'] = humanize_time($sys[$key]['UPTIME']); } -// Render page -// render_page($user, $TAB, 'list_services'); - // Back uri $_SESSION['back'] = $_SERVER['REQUEST_URI']; diff --git a/web/api/v1/list/stats/index.php b/web/api/v1/list/stats/index.php index 9053d9227..03e69fa96 100644 --- a/web/api/v1/list/stats/index.php +++ b/web/api/v1/list/stats/index.php @@ -42,9 +42,6 @@ foreach ($data as $key => $value) { } } -// Render page -// render_page($user, $TAB, 'list_stats'); - // Back uri $_SESSION['back'] = $_SERVER['REQUEST_URI']; diff --git a/web/api/v1/list/updates/index.php b/web/api/v1/list/updates/index.php index 7a4c7bdc3..379abf6c6 100644 --- a/web/api/v1/list/updates/index.php +++ b/web/api/v1/list/updates/index.php @@ -21,9 +21,6 @@ exec (VESTA_CMD."v-list-sys-vesta-autoupdate plain", $output, $return_var); $autoupdate = $output[0]; unset($output); -// Render page -// render_page($user, $TAB, 'list_updates'); - // Back uri $_SESSION['back'] = $_SERVER['REQUEST_URI']; diff --git a/web/api/v1/list/user/index.php b/web/api/v1/list/user/index.php index eb202cd80..17199a502 100644 --- a/web/api/v1/list/user/index.php +++ b/web/api/v1/list/user/index.php @@ -14,9 +14,7 @@ if ($user == 'admin') { } $data = json_decode(implode('', $output), true); $data = array_reverse($data,true); -// Render page top_panel(empty($_SESSION['look']) ? $_SESSION['user'] : $_SESSION['look'], $TAB); -// render_page($user, $TAB, 'list_user'); $_SESSION['back'] = $_SERVER['REQUEST_URI']; diff --git a/web/api/v1/list/web/index.php b/web/api/v1/list/web/index.php index 834b79fed..abc5b1aa1 100644 --- a/web/api/v1/list/web/index.php +++ b/web/api/v1/list/web/index.php @@ -13,9 +13,7 @@ $data = json_decode(implode('', $output), true); $data = array_reverse($data,true); $ips = json_decode(shell_exec(VESTA_CMD.'v-list-sys-ips json'), true); -// Render page top_panel(empty($_SESSION['look']) ? $_SESSION['user'] : $_SESSION['look'], $TAB); -// render_page($user, $TAB, 'list_web'); // Back uri $_SESSION['back'] = $_SERVER['REQUEST_URI']; diff --git a/web/api/v1/search/index.php b/web/api/v1/search/index.php index e13e12ee4..d268ec1b1 100644 --- a/web/api/v1/search/index.php +++ b/web/api/v1/search/index.php @@ -30,10 +30,6 @@ $command = $_SESSION['user'] == 'admin' exec (VESTA_CMD . $command, $output, $return_var); $data = json_decode(implode('', $output), true); - -// Render page -// render_page($user, $TAB, 'list_search'); - foreach ($data as $key => $value) { ++$i; diff --git a/web/inc/main.php b/web/inc/main.php index e6ae4b915..036702d72 100644 --- a/web/inc/main.php +++ b/web/inc/main.php @@ -132,44 +132,6 @@ function check_return_code($return_var,$output) { } } -function render_page($user, $TAB, $page) { - $__template_dir = dirname(__DIR__) . '/templates/'; - $__pages_js_dir = dirname(__DIR__) . '/js/pages/'; - - // Header - include($__template_dir . 'header.html'); - - // Panel - top_panel(empty($_SESSION['look']) ? $_SESSION['user'] : $_SESSION['look'], $TAB); - - // Extarct global variables - // I think those variables should be passed via arguments - //* - extract($GLOBALS, EXTR_SKIP); - /*/ - $variables = array_filter($GLOBALS, function($key){return preg_match('/^(v_|[a-z])[a-z\d]+$/', $key);}, ARRAY_FILTER_USE_KEY); - extract($variables, EXTR_OVERWRITE); - //*/ - - // Body - if (($_SESSION['user'] !== 'admin') && (@include($__template_dir . "user/$page.html"))) { - // User page loaded - } else { - // Not admin or user page doesn't exist - // Load admin page - @include($__template_dir . "admin/$page.html"); - } - - // Including common js files - @include_once(dirname(__DIR__) . '/templates/scripts.html'); - // Including page specific js file - if(file_exists($__pages_js_dir.$page.'.js')) - echo ''; - - // Footer - include($__template_dir . 'footer.html'); -} - function top_panel($user, $TAB) { global $panel; $command = VESTA_CMD."v-list-user '".$user."' 'json'"; @@ -193,13 +155,6 @@ function top_panel($user, $TAB) { } } unset($output); - - - if ( $user == 'admin' ) { - include(dirname(__FILE__).'/../templates/admin/panel.html'); - } else { - include(dirname(__FILE__).'/../templates/user/panel.html'); - } } function translate_date($date){