mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-10 01:51:02 -04:00
CI4 updates
- Fixed bug in appconfig->get_value() that never returns a value - Trying to fix logout - Turned on session->regenerateDestroy
This commit is contained in:
committed by
Steve Ireland
parent
e508ab86cd
commit
dcf1bbb3b2
@@ -89,7 +89,7 @@ class Session extends BaseConfig
|
||||
* when auto-regenerating the session ID. When set to FALSE, the data
|
||||
* will be later deleted by the garbage collector.
|
||||
*/
|
||||
public bool $regenerateDestroy = false;
|
||||
public bool $regenerateDestroy = true;
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
|
||||
@@ -32,7 +32,7 @@ class Appconfig extends Model
|
||||
public function get_value(string $key, string $default = ''): string
|
||||
{
|
||||
$builder = $this->db->table('app_config');
|
||||
$query = $builder->getWhere(['key' => $key], 1, 1);
|
||||
$query = $builder->getWhere(['key' => $key], 1);
|
||||
|
||||
if($query->getNumRows() == 1) //TODO: ===
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Database\ResultInterface;
|
||||
use CodeIgniter\HTTP\RedirectResponse;
|
||||
use CodeIgniter\Session\Session;
|
||||
|
||||
/**
|
||||
@@ -394,11 +395,11 @@ class Employee extends Person
|
||||
/**
|
||||
* Logs out a user by destroying all session data and redirect to log in
|
||||
*/
|
||||
public function logout(): void
|
||||
public function logout(): RedirectResponse
|
||||
{
|
||||
$this->session->destroy();
|
||||
session()->destroy();
|
||||
|
||||
redirect()->to('login');
|
||||
return redirect()->to('login');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user