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