Skip to content

Commit c2f59be

Browse files
committed
Merge pull request benedmunds#480 from thomasruns/2
Update 2 issues with forgot password process
2 parents e9006cf + bde0f56 commit c2f59be

File tree

36 files changed

+45
-38
lines changed

36 files changed

+45
-38
lines changed

controllers/auth.php

+6
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,12 @@ function forgot_password()
211211
$config_tables = $this->config->item('tables', 'ion_auth');
212212
$identity = $this->db->where('email', $this->input->post('email'))->limit('1')->get($config_tables['users'])->row();
213213

214+
if(empty($identity)) {
215+
$this->ion_auth->set_message('forgot_password_email_not_found');
216+
$this->session->set_flashdata('message', $this->ion_auth->messages());
217+
redirect("auth/forgot_password", 'refresh');
218+
}
219+
214220
//run the forgotten password method to email an activation code to the user
215221
$forgotten = $this->ion_auth->forgotten_password($identity->{$this->config->item('identity', 'ion_auth')});
216222

language/arabic/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/bulgarian/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/catalan/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/croatian/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
$lang['forgot_password_validation_email_label'] = 'Email';
139139
$lang['forgot_password_username_identity_label'] = 'Korisničko ime';
140140
$lang['forgot_password_email_identity_label'] = 'Email';
141-
141+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
142142

143143
// Reset Password
144144
$lang['reset_password_heading'] = 'Promjena lozinke';

language/czech/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/danish/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
$lang['forgot_password_validation_email_label'] = 'Email-adresse';
145145
$lang['forgot_password_username_identity_label'] = 'Brugernavn';
146146
$lang['forgot_password_email_identity_label'] = 'Email';
147-
147+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
148148

149149
// Reset Password
150150
$lang['reset_password_heading'] = 'Skift Kodeord';

language/dutch/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/english/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/english/ion_auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@
5858
// Email Subjects
5959
$lang['email_forgotten_password_subject'] = 'Forgotten Password Verification';
6060
$lang['email_new_password_subject'] = 'New Password';
61-
$lang['email_activation_subject'] = 'Account Activation';
61+
$lang['email_activation_subject'] = 'Account Activation';

language/estonian/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/finnish/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/french/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/german/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/greek/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/indonesian/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/italian/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/japanese/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'メールアドレス';
136136
$lang['forgot_password_username_identity_label'] = 'ユーザー名';
137137
$lang['forgot_password_email_identity_label'] = 'メールアドレス';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'パスワードの変更';

language/korean/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
$lang['forgot_password_validation_email_label'] = '이메일 주소';
133133
$lang['forgot_password_username_identity_label'] = '계정명';
134134
$lang['forgot_password_email_identity_label'] = '이메일';
135-
135+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
136136

137137
// Reset Password
138138
$lang['reset_password_heading'] = '비밀번호 바꾸기';

language/lithuanian/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/norwegian/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/persian/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/pirate/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/polish/auth_lang.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,11 @@
9494
$lang['change_password_submit_btn'] = 'Change';
9595

9696
// Forgot Password
97-
$lang['forgot_password_heading'] = 'Forgot Password';
98-
$lang['forgot_password_subheading'] = 'Please enter your %s so we can send you an email to reset your password.';
99-
$lang['forgot_password_email_label'] = '%s:';
100-
$lang['forgot_password_submit_btn'] = 'Submit';
97+
$lang['forgot_password_heading'] = 'Forgot Password';
98+
$lang['forgot_password_subheading'] = 'Please enter your %s so we can send you an email to reset your password.';
99+
$lang['forgot_password_email_label'] = '%s:';
100+
$lang['forgot_password_submit_btn'] = 'Submit';
101+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
101102

102103
// Reset Password
103104
$lang['reset_password_heading'] = 'Change Password';

language/portuguese/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/romanian/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/russian/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/slovak/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/slovenian/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
$lang['forgot_password_validation_email_label'] = 'Elektronski naslov';
134134
$lang['forgot_password_username_identity_label'] = 'Uporabniško ime';
135135
$lang['forgot_password_email_identity_label'] = 'E-naslov';
136-
136+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
137137

138138
// Ponastavi geslo
139139
$lang['reset_password_heading'] = 'Spremeni geslo';

language/spanish/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
$lang['forgot_password_validation_email_label'] = 'Correo Electronico';
139139
$lang['forgot_password_username_identity_label'] = 'Usuario';
140140
$lang['forgot_password_email_identity_label'] = 'Email';
141-
141+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
142142

143143
// Reset Password
144144
$lang['reset_password_heading'] = 'Cambiar Contraseña';

language/swedish/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/turkish/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/ukrainian/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/zh_cn/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

language/zh_tw/auth_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$lang['forgot_password_validation_email_label'] = 'Email Address';
136136
$lang['forgot_password_username_identity_label'] = 'Username';
137137
$lang['forgot_password_email_identity_label'] = 'Email';
138-
138+
$lang['forgot_password_email_not_found'] = 'No record of that email address.';
139139

140140
// Reset Password
141141
$lang['reset_password_heading'] = 'Change Password';

libraries/Ion_auth.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function forgotten_password($identity) //changed $email to $identity
140140
if ( $this->ion_auth_model->forgotten_password($identity) ) //changed
141141
{
142142
// Get user information
143-
$user = $this->where($this->config->item('identity', 'ion_auth'), $identity)->users()->row(); //changed to get_user_by_identity from email
143+
$user = $this->where($this->config->item('identity', 'ion_auth'), $identity)->where('active', 1)->users()->row(); //changed to get_user_by_identity from email
144144

145145
if ($user)
146146
{

0 commit comments

Comments
 (0)