More code for #456

This commit is contained in:
James Cole 2016-12-12 15:27:56 +01:00
parent 3e3c48314f
commit ffca4b0543
2 changed files with 11 additions and 1 deletions

View File

@ -92,9 +92,18 @@ class RegisterController extends Controller
// is user email domain blocked?
if ($this->isBlockedDomain($data['email'])) {
$validator->getMessageBag()->add('email', (string)trans('validation.invalid_domain'));
$this->reportBlockedDomainRegistrationAttempt($data['email'], $request->ip());
$this->throwValidationException($request, $validator);
}
// is user a deleted user?
$hash = hash('sha256', $data['email']);
$configuration = FireflyConfig::get('deleted_users', []);
$set = $configuration->data;
if (in_array($hash, $set)) {
// user already deleted, cannot re-register :(
$validator->getMessageBag()->add('email', (string)trans('validation.deleted_user'));
$this->reportBlockedDomainRegistrationAttempt($data['email'], $request->ip());
$this->throwValidationException($request, $validator);
}

View File

@ -12,6 +12,7 @@
return [
'iban' => 'This is not a valid IBAN.',
'unique_account_number_for_user' => 'It looks like this account number is already in use.',
'deleted_user' => 'Due to security constraints, you cannot register using this email address.',
'rule_trigger_value' => 'This value is invalid for the selected trigger.',
'rule_action_value' => 'This value is invalid for the selected action.',
'invalid_domain' => 'Due to security constraints, you cannot register from this domain.',