Login functionality

- temporarily removed return type from index while troubleshooting.
- load form helper in view
This commit is contained in:
objecttothis
2023-01-30 17:48:36 +04:00
committed by Steve Ireland
parent 80cabb5f71
commit fa1f4af420
2 changed files with 5 additions and 4 deletions

View File

@@ -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;
}

View File

@@ -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() ?>