From 13aabeea8e8cc77dd91dddd02d142ae0829114c6 Mon Sep 17 00:00:00 2001
From: Focuslinkstech <45756999+Focuslinkstech@users.noreply.github.com>
Date: Mon, 9 Sep 2024 20:45:13 +0100
Subject: [PATCH 1/5] add styles to some tables
---
ui/ui/hotspot.tpl | 107 ++++++++++++++++++++++++----------------------
ui/ui/plan.tpl | 92 ++++++++++++++++++++-------------------
ui/ui/pppoe.tpl | 99 +++++++++++++++++++++---------------------
ui/ui/voucher.tpl | 84 +++++++++++++++++++-----------------
4 files changed, 197 insertions(+), 185 deletions(-)
diff --git a/ui/ui/hotspot.tpl b/ui/ui/hotspot.tpl
index d083d0b8..3df4710d 100644
--- a/ui/ui/hotspot.tpl
+++ b/ui/ui/hotspot.tpl
@@ -35,8 +35,8 @@
@@ -44,9 +44,9 @@
@@ -54,8 +54,8 @@
@@ -63,8 +63,8 @@
@@ -72,7 +72,7 @@
@@ -81,7 +81,7 @@
@@ -104,38 +104,40 @@
{if in_array($_admin['user_type'],['SuperAdmin','Admin'])}
-
- {*
*}
+
+ {*
*}
{/if}
-{Lang::T('Active Customers')}
+ {Lang::T('Active Customers')}
@@ -70,33 +70,34 @@
{Lang::T('Payment Gateway')}: {str_replace(',',', ',$_c['payment_gateway'])}
diff --git a/ui/ui/sections/header.tpl b/ui/ui/sections/header.tpl
index bba3dbce..34b7f1e9 100644
--- a/ui/ui/sections/header.tpl
+++ b/ui/ui/sections/header.tpl
@@ -148,12 +148,26 @@
color: inherit;
background-color: transparent;
border-color: transparent;
+ border-bottom-right-radius: 21px;
+ border-bottom-left-radius: 21px;
}
- .panel-primary>.panel-heading {
- color: inherit;
- background-color: transparent;
- border-color: transparent;
+ .panel-success>.panel-heading {
+ border-bottom-right-radius: 21px;
+ border-bottom-left-radius: 21px;
+ }
+
+ .panel-warning>.panel-heading {
+ border-bottom-right-radius: 21px;
+ border-bottom-left-radius: 21px;
+ }
+
+ .panel-danger>.panel-heading {
+ color: #a94442;
+ background-color: #f2dede;
+ border-color: #ebccd1;
+ border-bottom-right-radius: 21px;
+ border-bottom-left-radius: 21px;
}
.panel-heading {
@@ -656,6 +670,9 @@
}
.toggle-container {
+ position: absolute;
+ top: 17px;
+ right: 15px;
cursor: pointer;
}
@@ -666,6 +683,11 @@
}
@media (max-width: 600px) {
+ .toggle-container {
+ top: 15px;
+ right: 60px;
+ }
+
.toggle-container .toggle-icon {
font-size: 20px;
color: rgb(100 116 139);
From 05b681df47fb12f84725091f3831b0199a96a545 Mon Sep 17 00:00:00 2001
From: Focuslinkstech <45756999+Focuslinkstech@users.noreply.github.com>
Date: Wed, 11 Sep 2024 14:38:54 +0100
Subject: [PATCH 3/5] change current_time to current_date
---
ui/ui/dashboard.tpl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/ui/dashboard.tpl b/ui/ui/dashboard.tpl
index 7a998ba8..78955672 100644
--- a/ui/ui/dashboard.tpl
+++ b/ui/ui/dashboard.tpl
@@ -195,7 +195,7 @@
{/if}
{if $run_date}
- {if $current_time - $run_time > 3600}
+ {if $current_date - $run_time > 3600}
{Lang::T('Cron has not run for over 1 hour. Please
check your setup.')}
From fe532a62386a5b588d65cb8fdd1b5d9097153fac Mon Sep 17 00:00:00 2001
From: Focuslinkstech <45756999+Focuslinkstech@users.noreply.github.com>
Date: Wed, 11 Sep 2024 16:52:34 +0100
Subject: [PATCH 4/5] change the time calculation logic
---
ui/ui/dashboard.tpl | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/ui/ui/dashboard.tpl b/ui/ui/dashboard.tpl
index 78955672..f0432982 100644
--- a/ui/ui/dashboard.tpl
+++ b/ui/ui/dashboard.tpl
@@ -195,7 +195,9 @@
{/if}
{if $run_date}
- {if $current_date - $run_time > 3600}
+ {assign var="current_time" value=$smarty.now}
+ {assign var="run_time" value=strtotime($run_date)}
+ {if $current_time - $run_time > 3600}
{Lang::T('Cron has not run for over 1 hour. Please
check your setup.')}
From 68de3a71b930f55c0713197c745263e088601b0b Mon Sep 17 00:00:00 2001
From: Focuslinkstech <45756999+Focuslinkstech@users.noreply.github.com>
Date: Thu, 12 Sep 2024 11:39:45 +0100
Subject: [PATCH 5/5] if admin session time error, it logout admin out whether
admin are online or not, once time reach it logout you out
---
system/autoload/Admin.php | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/system/autoload/Admin.php b/system/autoload/Admin.php
index 66052cda..18d016c6 100644
--- a/system/autoload/Admin.php
+++ b/system/autoload/Admin.php
@@ -13,25 +13,27 @@ class Admin
{
global $db_pass, $config;
$enable_session_timeout = $config['enable_session_timeout'];
- if ($enable_session_timeout) {
- $timeout = 60;
- if ($config['session_timeout_duration']) {
- $timeout = intval($config['session_timeout_duration']);
+ $session_timeout_duration = $config['session_timeout_duration'] ? intval($config['session_timeout_duration'] * 60) : intval(60 * 60); // Convert minutes to seconds
+
+ // Check if the session is active and valid
+ if (isset($_SESSION['aid']) && isset($_SESSION['aid_expiration'])) {
+ if ($_SESSION['aid_expiration'] > time()) {
+ if ($enable_session_timeout) {
+ $_SESSION['aid_expiration'] = time() + $session_timeout_duration;
+ }
+ return $_SESSION['aid'];
+ }
+ // Session expired, log out the user
+ elseif ($enable_session_timeout && $_SESSION['aid_expiration'] <= time()) {
+ self::removeCookie();
+ session_destroy();
+ _alert(Lang::T('Session has expired. Please log in again.'), 'danger', "admin");
+ return 0;
}
- $session_timeout_duration = $timeout * 60; // Convert minutes to seconds
}
- if (isset($_SESSION['aid']) && isset($_SESSION['aid_expiration']) && $_SESSION['aid_expiration'] > time()) {
- return $_SESSION['aid'];
- } elseif ($enable_session_timeout && isset($_SESSION['aid']) && isset($_SESSION['aid_expiration']) && $_SESSION['aid_expiration'] <= time()) {
- self::removeCookie();
- session_destroy();
- _alert(Lang::T('Session has expired. Please log in again.'), 'danger', "admin");
- return 0;
- }
- // Check if cookie is set and valid
+ // Check if the cookie is set and valid
elseif (isset($_COOKIE['aid'])) {
- // id.time.sha1
$tmp = explode('.', $_COOKIE['aid']);
if (sha1($tmp[0] . '.' . $tmp[1] . '.' . $db_pass) == $tmp[2]) {
if (time() - $tmp[1] < 86400 * 7) {