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:
objecttothis
2023-02-12 02:02:39 +04:00
committed by Steve Ireland
parent e508ab86cd
commit dcf1bbb3b2
3 changed files with 6 additions and 5 deletions

View File

@@ -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;
/**
* --------------------------------------------------------------------------

View File

@@ -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: ===
{

View File

@@ -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');
}
/**