Пример #1
0
 function authenticateuser_registation($email, $password)
 {
     $users_model = new Users_model();
     $users_service = new Users_service();
     $users_model->setEmail($this->input->post($email, TRUE));
     $users_model->setPassword($this->input->post($password, TRUE));
     $users = $users_service->authenticateUser($users_model);
     //echo $users;        die();
     if (count($users) == 1) {
         $userdata = array('user_name' => $users->name, 'user_id' => $users->id, 'user_email' => $users->email, 'logged_in' => TRUE);
         //   session_start();
         $this->session->set_userdata($userdata);
         $this->load->helper('url');
         $this->load->model('Mod_images');
         $this->load->model('Mod_items');
         $user_name = $this->session->userdata('user_name');
         $data['user_name'] = $user_name;
         $data['images'] = $this->Mod_images->content();
         $data['items'] = $this->Mod_items->content();
         $data['topic'] = $this->Mod_items->gettopic();
         $this->load->view('header', $data);
         $this->load->view('home', $data);
         $this->load->view('footer');
         echo 1;
     } else {
         echo 0;
     }
 }
Пример #2
0
 function authenticateuser()
 {
     $users_model = new Users_model();
     $users_service = new Users_service();
     $users_model->setEmail($this->input->post('username', TRUE));
     $users_model->setPassword($this->input->post('password', TRUE));
     $users = $users_service->authenticateUser($users_model);
     //newly added sithira
     $this->load->library('session');
     //Load Models - for this function
     $this->load->model('users_model1');
     $this->load->model('auth_model');
     //Load Form Helper
     $this->load->helper('form');
     //end
     //echo $users;        die();
     if (count($users) == 1) {
         $userdata = array('user_name' => $users->name, 'user_id' => $users->id, 'user_email' => $users->email, 'logged_in' => TRUE);
         $name = $users->name;
         $id = $users->id;
         $users = $users_service->update_users($users->id, 1);
         //   session_start();
         $this->session->set_userdata($userdata);
         $this->chat_login($name, $id);
         echo 1;
     } else {
         echo 0;
     }
 }
Пример #3
0
 function authenticateuser()
 {
     $users_model = new Users_model();
     $users_service = new Users_service();
     $users_model->setEmail($this->input->post('username', TRUE));
     $users_model->setPassword($this->input->post('password', TRUE));
     $users = $users_service->authenticateUser($users_model);
     //newly added sithira
     $this->load->library('session');
     //Load Models - for this function
     $this->load->model('users_model1');
     $this->load->model('auth_model');
     //Load Form Helper
     $this->load->helper('form');
     $loggedInUser = $this->users_model1->getLoggedInUser();
     $this->outputData['loggedInUser'] = $loggedInUser;
     $conditions = array('user_email' => $this->input->post('username'), 'user_password' => $this->input->post('password'), 'ci_users.status' => '1');
     $query = $this->users_model1->getUsers($conditions);
     if ($query->num_rows() > 0) {
         $row = $query->row();
         // update the last activity in the users table
         $updateData = array();
         //date("Y-m-d H:i:s")
         $updateData['online'] = "1";
         // update process for users table
         $this->users_model1->updateUser(array('user_id' => $row->user_id), $updateData);
         //Set Session For User
         $this->auth_model->setUserSession($row);
         $this->session->userdata('user_id', $row->user_id);
         $this->session->userdata('user_name', $row->user_name);
         //Notification message
         //   $this->session->set_flashdata('flash_message', $this->users_model->flash_message('success','Logged In Successfull'));
         //   redirect('Con_dashBord');
     } else {
         //Notification message
         //  $this->session->set_flashdata('flash_message', $this->users_model->flash_message('error','Login failed! Incorrect username or password  '.$this->input->post('username').""));
         //   redirect('users');
     }
     //If username exists
     //}//If End - Check For Validation
     //end
     //echo $users;        die();
     if (count($users) == 1) {
         $userdata = array('user_name' => $users->name, 'user_id' => $users->id, 'user_email' => $users->email, 'logged_in' => TRUE);
         //   session_start();
         $this->session->set_userdata($userdata);
         echo 1;
     } else {
         echo 0;
     }
 }
Пример #4
0
 function authenticateuser()
 {
     $users_model = new Users_model();
     $users_service = new Users_service();
     $users_model->setEmail($this->input->post('username', TRUE));
     $users_model->setPassword($this->input->post('password', TRUE));
     $users = $users_service->authenticateUser($users_model);
     //echo $users;        die();
     if (count($users) == 1) {
         $userdata = array('user_name' => $users->name, 'user_id' => $users->id, 'user_email' => $users->email, 'logged_in' => TRUE);
         //   session_start();
         $this->session->set_userdata($userdata);
         echo 1;
     } else {
         echo 0;
     }
 }