From 1096ff924641d754106b616c75afa5ce59e7dc06 Mon Sep 17 00:00:00 2001 From: ManeBit Date: Wed, 10 Jun 2015 20:59:24 -0700 Subject: [PATCH 1/3] function remind_password: return TRUE/FALSE. This allows for the function to return true if the email sent. And false if the email doesn't exist in the DB. --- application/libraries/Aauth.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/libraries/Aauth.php b/application/libraries/Aauth.php index 4e47312..da58d56 100644 --- a/application/libraries/Aauth.php +++ b/application/libraries/Aauth.php @@ -436,6 +436,7 @@ class Aauth { * Remind password * Emails user with link to reset password * @param string $email Email for account to remind + * @return bool Remind fails/succeeds */ public function remind_password($email){ @@ -457,7 +458,10 @@ class Aauth { $this->CI->email->subject($this->CI->lang->line('aauth_email_reset_subject')); $this->CI->email->message($this->CI->lang->line('aauth_email_reset_text') . site_url() . $this->config_vars['reset_password_link'] . $row->id . '/' . $ver_code ); $this->CI->email->send(); + + return TRUE; } + return FALSE; } /** From ab64f6118f66115e58632e583ff2736004c486c2 Mon Sep 17 00:00:00 2001 From: ManeBit Date: Thu, 11 Jun 2015 23:21:44 -0700 Subject: [PATCH 2/3] URGENT: variable scope undefined fix! FTFY: Variable scope issue with $valid in function update_user() --- application/libraries/Aauth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/libraries/Aauth.php b/application/libraries/Aauth.php index da58d56..bbefb05 100644 --- a/application/libraries/Aauth.php +++ b/application/libraries/Aauth.php @@ -682,6 +682,7 @@ class Aauth { public function update_user($user_id, $email = FALSE, $pass = FALSE, $name = FALSE) { $data = array(); + $valid = TRUE; if ($email != FALSE) { if ($this->user_exsist_by_email($email)) { From 12d01e609f5a9c93ce6ed5ce605752aa8da3f064 Mon Sep 17 00:00:00 2001 From: ManeBit Date: Sat, 20 Jun 2015 17:43:36 -0700 Subject: [PATCH 3/3] Fixing typos in functions user_exist_by_email user_exist_by_name --- application/libraries/Aauth.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/application/libraries/Aauth.php b/application/libraries/Aauth.php index bbefb05..22b12eb 100644 --- a/application/libraries/Aauth.php +++ b/application/libraries/Aauth.php @@ -607,11 +607,11 @@ class Aauth { $valid = FALSE; } } - if ($this->user_exsist_by_name($name)) { + if ($this->user_exist_by_name($name)) { $this->error($this->CI->lang->line('aauth_error_username_exists')); $valid = FALSE; } - if ($this->user_exsist_by_email($email)) { + if ($this->user_exist_by_email($email)) { $this->error($this->CI->lang->line('aauth_error_email_exists')); $valid = FALSE; } @@ -685,7 +685,7 @@ class Aauth { $valid = TRUE; if ($email != FALSE) { - if ($this->user_exsist_by_email($email)) { + if ($this->user_exist_by_email($email)) { $this->error($this->CI->lang->line('aauth_error_update_email_exists')); $valid = FALSE; } @@ -705,7 +705,7 @@ class Aauth { } if ($name != FALSE) { - if ($this->user_exsist_by_name($name)) { + if ($this->user_exist_by_name($name)) { $this->error($this->CI->lang->line('aauth_error_update_username_exists')); $valid = FALSE; } @@ -934,13 +934,13 @@ class Aauth { } /** - * user_exsist_by_name + * user_exist_by_name * Check if user exist by name * @param $user_id * * @return bool */ - public function user_exsist_by_name( $name ) { + public function user_exist_by_name( $name ) { $query = $this->aauth_db->where('name', $name); $query = $this->aauth_db->get($this->config_vars['users']); @@ -952,13 +952,13 @@ class Aauth { } /** - * user_exsist_by_email - * Check if user exsist by user email + * user_exist_by_email + * Check if user exist by user email * @param $user_email * * @return bool */ - public function user_exsist_by_email( $user_email ) { + public function user_exist_by_email( $user_email ) { $query = $this->aauth_db->where('email', $user_email); $query = $this->aauth_db->get($this->config_vars['users']);