mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-07-12 07:56:34 -04:00
Validation for login
This commit is contained in:
committed by
Steve Ireland
parent
91d8d68cc0
commit
99bd8f7acc
@@ -4,6 +4,7 @@ namespace App\Controllers;
|
||||
|
||||
use App\Libraries\MY_Migration;
|
||||
use App\Models\Employee;
|
||||
use Config\Migrations;
|
||||
use Config\Services;
|
||||
|
||||
/**
|
||||
@@ -17,16 +18,13 @@ class Login extends BaseController
|
||||
{
|
||||
$this->employee = model('Employee');
|
||||
|
||||
if($this->employee->is_logged_in())
|
||||
if(!$this->employee->is_logged_in())
|
||||
{
|
||||
redirect('home');
|
||||
}
|
||||
else
|
||||
{
|
||||
$migration = new MY_Migration();
|
||||
$migration = new MY_Migration(config('Migrations'));
|
||||
$data = [
|
||||
'validation' => Services::validation(),
|
||||
'latest_version' => $migration->is_latest()];
|
||||
'latest_version' => $migration->is_latest()
|
||||
];
|
||||
|
||||
if(strtolower($this->request->getMethod()) !== 'post')
|
||||
{
|
||||
@@ -37,11 +35,9 @@ class Login extends BaseController
|
||||
{
|
||||
echo view('login', ['validation' => $this->validator->getErrors()]);
|
||||
}
|
||||
else
|
||||
{
|
||||
redirect('home');
|
||||
}
|
||||
}
|
||||
|
||||
redirect('home');
|
||||
}
|
||||
|
||||
/* public function login_check(string $username): bool
|
||||
|
||||
@@ -4,7 +4,8 @@ namespace App\Libraries;
|
||||
|
||||
use CodeIgniter\Database\MigrationRunner;
|
||||
|
||||
class MY_Migration extends MigrationRunner {
|
||||
class MY_Migration extends MigrationRunner
|
||||
{
|
||||
|
||||
public function get_last_migration(): string
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user