Avatar image fix
This commit is contained in:
@@ -8,6 +8,7 @@ class Login extends Web_Controller {
|
||||
// echo rand(1000, 9999);
|
||||
// print_r($this->input->get());
|
||||
$data = array();
|
||||
$data['username'] = $data['pass'] = $data['error_message']='';
|
||||
|
||||
if ($_POST) {
|
||||
|
||||
@@ -15,9 +16,19 @@ class Login extends Web_Controller {
|
||||
$data['pass'] = htmlspecialchars($this->input->post('pass'));
|
||||
//$this->load->view('provider/dash');
|
||||
$outData = array();
|
||||
$loginResult = $this->loginUser($data, $outData);
|
||||
if (true == $loginResult) {
|
||||
$this->renderProviderSecurePage('dash', $data);
|
||||
//print_r($data);
|
||||
$loginResult = $this->verifyLoginInput($data); // initial test
|
||||
if ($loginResult == true) {
|
||||
|
||||
$loginResult = false; // reset again for real login
|
||||
$loginResult = $this->loginUser($data, $outData);
|
||||
if (true == $loginResult) {
|
||||
$this->renderProviderSecurePage('dash', $data);
|
||||
}
|
||||
}// if valid input was supplied
|
||||
|
||||
if (false == $loginResult) {
|
||||
$this->renderExternalPage('welcome_message', $data); // get here if login galis
|
||||
}
|
||||
} else {
|
||||
//$this->load->view('welcome_message');
|
||||
@@ -29,6 +40,21 @@ class Login extends Web_Controller {
|
||||
//$this->load->view('welcome_message');
|
||||
}
|
||||
|
||||
private function verifyLoginInput(&$data) {
|
||||
|
||||
$ret = false;
|
||||
if ($data['username'] == '' or $data['pass'] == '') {
|
||||
$data['error_message']="Username and password required";
|
||||
}
|
||||
|
||||
|
||||
if (trim($data['username']) != '' or trim($data['pass']) != '') {
|
||||
$ret = true;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function logout() {
|
||||
$data = array();
|
||||
$this->destroySession();
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<h1 class="mb-2">Merms Providers</h1>
|
||||
<p>Welcome back, please login to your account.</p>
|
||||
<form id='loginForm' action="/login" method='POST' class="mt-3 mt-sm-5">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group">
|
||||
@@ -50,6 +51,9 @@
|
||||
</div>
|
||||
<a href="javascript:void(0);" class="ml-auto">Forgot Password ?</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 mt-3">
|
||||
<?=isset($error_message)? "<span class='mr-2 mb-2 mr-sm-0 mb-sm-0 badge badge-danger-inverse'>".$error_message."</span>":'';?>
|
||||
</div>
|
||||
<div class="col-12 mt-3">
|
||||
<button type="submit" class="btn btn-primary">Sign In</button>
|
||||
|
||||
Reference in New Issue
Block a user