Skip to content

Commit

Permalink
Added checking for unverified account on login, display appropriate e…
Browse files Browse the repository at this point in the history
…rror message.
  • Loading branch information
jacobtomlinson committed Jun 3, 2014
1 parent 8f69f7d commit 36cd525
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions application/config/aauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
'wrong' => 'E-mail or Password is wrong.',
'exceeded' => 'Login try limit exceeded.',
'no_user' => 'User not Exist',
'not_verified' => 'Please verify your account.',
'group_exist' => 'Group already exists',
'self_pm' => 'It is not reasonable to send pm to yourself :)',
'no_pm' => 'Pm not found',
Expand Down
13 changes: 12 additions & 1 deletion application/libraries/Aauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ public function login($email, $pass, $remember = FALSE) {
}
}

$query = null;
$query = $this->CI->db->where('email', $email);
$query = $this->CI->db->where('banned', 1);
$query = $this->CI->db->where('verification_code !=', '');
$query = $this->CI->db->get($this->config_vars['users']);

if ($query->num_rows() > 0) {
$this->error($this->config_vars['not_verified']);
return false;
}

$query = null;
$query = $this->CI->db->where('email', $email);

Expand Down Expand Up @@ -1084,4 +1095,4 @@ public function get_infos($divider = '<br />'){
* tamam ama engelleme ve limit olayı koymadım. // pm için okundu ve göster, sil, engelle? die fonksiyonlar eklencek , gönderilen pmler, alınan pmler, arasındaki pmler,
* tamm// already existedleri info yap onlar error değil hacım
*
*/
*/

0 comments on commit 36cd525

Please sign in to comment.