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();
|
||||
|
||||
Reference in New Issue
Block a user