Commit 540a4ff 1 parent 9c1798b commit 540a4ff Copy full SHA for 540a4ff
File tree 3 files changed +10
-1
lines changed
3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -194,20 +194,25 @@ public function onSignin()
194
194
*/
195
195
$ data = post ();
196
196
$ rules = [];
197
+ $ messages = [];
197
198
198
199
$ rules ['login ' ] = $ this ->loginAttribute () == UserSettings::LOGIN_USERNAME
199
200
? 'required|between:2,255 '
200
201
: 'required|email|between:6,255 ' ;
201
202
202
203
$ rules ['password ' ] = 'required|between: ' . UserModel::getMinPasswordLength () . ',255 ' ;
203
204
205
+ $ messages ['login ' ] = $ this ->loginAttribute () == UserSettings::LOGIN_USERNAME
206
+ ? trans ('winter.user::lang.account.invalid_username ' )
207
+ : trans ('winter.user::lang.account.invalid_email ' );
208
+
204
209
if (!array_key_exists ('login ' , $ data )) {
205
210
$ data ['login ' ] = post ('username ' , post ('email ' ));
206
211
}
207
212
208
213
$ data ['login ' ] = trim ($ data ['login ' ]);
209
214
210
- $ validation = Validator::make ($ data , $ rules );
215
+ $ validation = Validator::make ($ data , $ rules, $ messages );
211
216
if ($ validation ->fails ()) {
212
217
throw new ValidationException ($ validation );
213
218
}
Original file line number Diff line number Diff line change 182
182
'force_secure_desc ' => 'Verwende für Weiterleitungen immer das HTTPS-Protokoll. ' ,
183
183
'invalid_activation_code ' => 'Ungültiger Aktivierungscode übermittelt ' ,
184
184
'invalid_deactivation_pass ' => 'Das eingegebene Passwort war ungültig. ' ,
185
+ 'invalid_username ' => 'Der eingegebene Nutzername ist ungültig. ' ,
186
+ 'invalid_email ' => 'Die eingegebene E-Mail ist ungültig. ' ,
185
187
'success_activation ' => 'Benutzerkonto erfolgreich aktiviert. ' ,
186
188
'success_deactivation ' => 'Konto erfolgreich deaktiviert. Schade, dass du gehst! ' ,
187
189
'success_saved ' => 'Einstellungen erfolgreich gespeichert! ' ,
Original file line number Diff line number Diff line change 178
178
'invalid_activation_code ' => 'Invalid activation code supplied. ' ,
179
179
'invalid_deactivation_pass ' => 'The password you entered was invalid. ' ,
180
180
'invalid_current_pass ' => 'The current password you entered was invalid. ' ,
181
+ 'invalid_username ' => 'The username you have entered is invalid. ' ,
182
+ 'invalid_email ' => 'The email address you have entered is invalid. ' ,
181
183
'success_activation ' => 'Successfully activated your account. ' ,
182
184
'success_deactivation ' => 'Successfully deactivated your account. Sorry to see you go! ' ,
183
185
'success_saved ' => 'Settings successfully saved! ' ,
You can’t perform that action at this time.
0 commit comments