Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions application/controllers/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ public function verify() {
);
$this->db->where('id', $exist['id']);
$this->db->update('users', $data);
$this->session->set_flashdata('validate', array('message' => 'Your account successfully verified', 'type' => 'success'));
$this->session->set_flashdata('validate',
array('message' => 'Your account successfully verified', 'type' => 'success'));

//Send email to admin about new user signup
$this->load->library('email');
Expand All @@ -328,13 +329,18 @@ public function verify() {
$sess_array = array();

if ($exist['is_deleted'] == 1) {
$this->session->set_flashdata('validate', array('message' => 'Your account has been deleted by admin.', 'type' => 'warning'));
$this->session->set_flashdata('validate',
array('message' => 'Your account has been deleted by admin.',
'type' => 'warning'));
redirect(base_url());
} else {
$this->session->set_flashdata('validate', array('message' => 'Your account successfully verified and logged in.', 'type' => 'success'));
$this->session->set_flashdata('validate',
array('message' => 'Your account successfully verified and logged in.',
'type' => 'success'));
}

$query_department = $this->db->get_where('department', array('id' => $exist['department_id']));
$query_department = $this->db->get_where('department',
array('id' => $exist['department_id']));
$department_rec = $query_department->row_array();

$sess_array = array(
Expand All @@ -359,7 +365,8 @@ public function verify() {


} else {
$this->session->set_flashdata('validate', array('message' => 'Your email already verified', 'type' => 'warning'));
$this->session->set_flashdata('validate',
array('message' => 'Your email already verified', 'type' => 'warning'));
}
redirect(base_url() . 'guest');
}
Expand All @@ -372,15 +379,17 @@ public function autologin($slug) {
$this->session->unset_userdata('view_session');
//session_destroy();

$query = $this->db->get_where('users', array('id' => $slug, 'is_deleted' => '0'));
$query = $this->db->get_where('users',
array('id' => $slug, 'is_deleted' => '0'));
$exist = $query->row_array();
$logary=array('action'=>'logout','description'=>'logout and auto login');
addlog($logary);

if ($exist) {
$sess_array = array();

$query_department = $this->db->get_where('department', array('id' => $exist['department_id']));
$query_department = $this->db->get_where('department',
array('id' => $exist['department_id']));
$department_rec = $query_department->row_array();

$sess_array = array(
Expand All @@ -407,7 +416,8 @@ public function autologin($slug) {

function department_name_exists($key) {
if ($this->department_model->department_already_exist($key)) {
$this->form_validation->set_message('department_name_exists', 'The %s already exists');
$this->form_validation->set_message('department_name_exists',
'The %s already exists');
return false;
} else {
return true;
Expand All @@ -416,7 +426,8 @@ function department_name_exists($key) {

function username_not_available($key) {
if ($this->users_model->username_already_exist($key)) {
$this->form_validation->set_message('username_not_available', '%s not available');
$this->form_validation->set_message('username_not_available',
'%s not available');
return false;
} else {
return true;
Expand Down