mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-07-13 16:32:49 -04:00
Login functionality
- temporarily removed return type from index while troubleshooting. - load form helper in view
This commit is contained in:
committed by
Steve Ireland
parent
80cabb5f71
commit
fa1f4af420
@@ -15,7 +15,7 @@ class Login extends BaseController
|
||||
{
|
||||
protected $helpers = ['form'];
|
||||
|
||||
public function index(): RedirectResponse
|
||||
public function index()
|
||||
{
|
||||
$this->employee = model('Employee');
|
||||
|
||||
@@ -40,7 +40,7 @@ class Login extends BaseController
|
||||
// }
|
||||
}
|
||||
|
||||
return redirect()->to('home');
|
||||
//return redirect()->to('home');
|
||||
}
|
||||
|
||||
public function login_check(string $username): bool
|
||||
@@ -56,7 +56,7 @@ class Login extends BaseController
|
||||
|
||||
if(!$this->employee->login($username, $password))
|
||||
{
|
||||
$this->validator->set_message('login_check', $this->lang->line('login_invalid_username_and_password'));
|
||||
$this->validator->setMessage('login_check', $this->lang->line('login_invalid_username_and_password'));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/**
|
||||
* @var object $validation
|
||||
*/
|
||||
helper('form');
|
||||
?>
|
||||
|
||||
<!doctype html>
|
||||
@@ -37,7 +38,7 @@
|
||||
</div>
|
||||
<section class="box-login d-flex flex-column justify-content-center align-items-center p-md-4">
|
||||
<?php echo form_open('login') ?>
|
||||
<h3 class="text-center m-0"><?php echo lang('Login.welcome', ['install_name' => lang('Common.software_short')]) ?></h3>
|
||||
<h3 class="text-center m-0"><?php echo lang('Login.welcome', ['install_name' => lang('Common.software_short')]) ?></h3>
|
||||
<?php if (!empty($validation->getErrors())): ?>
|
||||
<div class="alert alert-danger mt-3">
|
||||
<?php echo $validation->listErrors() ?>
|
||||
|
||||
Reference in New Issue
Block a user