Correct the validate username method

This commit is contained in:
Alex Tselegidis 2022-11-30 11:53:45 +01:00
parent bc0de8ec53
commit 30c55a4666
3 changed files with 21 additions and 3 deletions

View file

@ -178,7 +178,13 @@ class Admins_model extends EA_Model {
$this->db->where('id_users !=', $admin_id);
}
return $this->db->get_where('user_settings', ['username' => $username, 'delete_datetime' => NULL])->num_rows() === 0;
return $this
->db
->from('users')
->join('user_settings', 'user_settings.id_users = users.id', 'inner')
->where(['username' => $username, 'delete_datetime' => NULL])
->get()
->num_rows() === 0;
}
/**

View file

@ -193,7 +193,13 @@ class Providers_model extends EA_Model {
$this->db->where('id_users !=', $provider_id);
}
return $this->db->get_where('user_settings', ['username' => $username, 'delete_datetime' => NULL])->num_rows() === 0;
return $this
->db
->from('users')
->join('user_settings', 'user_settings.id_users = users.id', 'inner')
->where(['username' => $username, 'delete_datetime' => NULL])
->get()
->num_rows() === 0;
}
/**

View file

@ -191,7 +191,13 @@ class Secretaries_model extends EA_Model {
$this->db->where('id_users !=', $secretary_id);
}
return $this->db->get_where('user_settings', ['username' => $username, 'delete_datetime' => NULL])->num_rows() === 0;
return $this
->db
->from('users')
->join('user_settings', 'user_settings.id_users = users.id', 'inner')
->where(['username' => $username, 'delete_datetime' => NULL])
->get()
->num_rows() === 0;
}
/**