cannot deactivate postpaid

This commit is contained in:
iBNu Maksum 2024-10-25 14:05:57 +07:00
parent a04c3dd82b
commit 7f72b0c34a
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
3 changed files with 10 additions and 7 deletions

View File

@ -40,7 +40,7 @@ class Admin
$isValid = self::validateToken($_SESSION['aid'], $_COOKIE['aid']);
if (!$isValid) {
self::removeCookie();
_alert(Lang::T('Token has expired. Please log in again.'), 'danger', "admin");
_alert(Lang::T('Token has expired. Please log in again.') . '.'.$_SESSION['aid'], 'danger', "admin");
return 0;
}
return $_SESSION['aid'];
@ -57,7 +57,7 @@ class Admin
}
if (!empty($_COOKIE['aid']) && !$isValid) {
self::removeCookie();
_alert(Lang::T('Token has expired. Please log in again.'), 'danger', "admin");
_alert(Lang::T('Token has expired. Please log in again.') . '..', 'danger', "admin");
return 0;
} else {
if (time() - $tmp[1] < 86400 * 7) {
@ -124,7 +124,9 @@ class Admin
'samesite' => 'Lax',
]);
session_destroy();
unset($_COOKIE['aid']);
session_unset();
session_start();
unset($_COOKIE['aid'], $_SESSION['aid']);
}
}
@ -151,10 +153,10 @@ class Admin
{
global $config;
$query = ORM::for_table('tbl_users')->select('login_token')->findOne($aid);
if($config['single_session'] != 'yes'){
if ($config['single_session'] != 'yes') {
return true; // For multi-session, any token is valid
}
if(empty($query)){
if (empty($query)) {
return true;
}
return $query->login_token === sha1($cookieToken);

View File

@ -874,5 +874,6 @@
"Welcome_Message": "Welcome Message",
"will_be_replaced_with_Customer_password": "will be replaced with Customer password",
"will_be_replaced_with_Customer_Portal_URL": "will be replaced with Customer Portal URL",
"will_be_replaced_with_Company_Name": "will be replaced with Company Name"
"will_be_replaced_with_Company_Name": "will be replaced with Company Name",
"Token_has_expired__Please_log_in_again_": "Token has expired. Please log in again."
}

View File

@ -280,7 +280,7 @@
{/if}
<tr>
<td class="small text-primary text-uppercase text-normal">
{if $_bill['status'] == 'on' && $_bill['prepaid'] != 'yes'}
{if $_bill['status'] == 'on' && $_bill['prepaid'] != 'YES'}
<a href="{$_url}home&deactivate={$_bill['id']}"
onclick="return confirm('{Lang::T('Deactivate')}?')" class="btn btn-danger btn-xs"><i
class="glyphicon glyphicon-trash"></i></a>