fix text
This commit is contained in:
@@ -23,22 +23,18 @@ class Login extends BaseController {
|
||||
// Get input from form
|
||||
$username = $this->request->getVar('username');
|
||||
$password = $this->request->getVar('mermspassword');
|
||||
|
||||
if ($username == 'ameye@chiefsoft.com' && $password=='Awori.Awori'){
|
||||
|
||||
//$this->load->model('auth_model');
|
||||
$out = $this->auth_model->userLogin();
|
||||
log_message('critical', "***** ***** WrenchAuth::userLogin USER_SESSION = ".$username );
|
||||
if ($username != '' && $password !=''){
|
||||
log_message('critical', "***** ***** WrenchAuth::userLogin USER_SESSION = ".$username );
|
||||
$out = $this->auth_model->userLogin($username, $password);
|
||||
// var_dump($out);
|
||||
// exit;
|
||||
if ($this->createUserSession($out)){ // session was built
|
||||
return redirect()->to('providers');
|
||||
}
|
||||
// var_dump($out);
|
||||
// exit();
|
||||
}
|
||||
|
||||
|
||||
$data = array();
|
||||
return $this->renderExternalPage('welcome_message', $data);
|
||||
|
||||
} // end of index Login
|
||||
|
||||
public function RegisterAccount(){
|
||||
|
||||
@@ -6,8 +6,13 @@ use CodeIgniter\Model;
|
||||
|
||||
class Auth_model extends Model
|
||||
{
|
||||
public function userLogin() {
|
||||
$mysql = "SELECT id AS member_id, * FROM members WHERE id = 1";
|
||||
public function userLogin($username, $password) {
|
||||
$mysql = "SELECT id AS member_id, * FROM members
|
||||
WHERE username = '".$username."'
|
||||
AND password = md5('$password') ";
|
||||
// echo $mysql;
|
||||
// log_message('critical', "***** ***** QUERY = ".$mysql );
|
||||
// exit;
|
||||
$db = db_connect();
|
||||
$query = $db->query($mysql);
|
||||
|
||||
@@ -15,9 +20,6 @@ class Auth_model extends Model
|
||||
if (isset($row)) {
|
||||
$sqlDel = "DELETE FROM members_session WHERE member_id = ". $row["member_id"];
|
||||
$db->query($sqlDel);
|
||||
|
||||
// $sql = 'INSERT INTO members_session (member_id, session_id) VALUES (?, ?, ?)';
|
||||
|
||||
$pQuery = $db->prepare(static function ($db) {
|
||||
return $db->table('members_session')->insert([
|
||||
'member_id' => '0',
|
||||
@@ -33,7 +35,6 @@ class Auth_model extends Model
|
||||
$db = db_connect();
|
||||
$query = $db->query($mysql);
|
||||
$row_session = $query->getRowArray();
|
||||
|
||||
return ["member"=> $row,"session"=> $row_session];
|
||||
}
|
||||
return [];
|
||||
|
||||
Reference in New Issue
Block a user