mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-05-07 05:53:07 +00:00
Prevent emails to be reused and changed to an exisiting one in the Controllers
This commit is contained in:
parent
3c4040d317
commit
c291a356db
3 changed files with 4 additions and 2 deletions
|
|
@ -20,7 +20,7 @@ class EmailController extends Controller
|
|||
public function update(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'email' => 'required|confirmed|email',
|
||||
'email' => 'required|unique:external.accounts,email|different:email_current|confirmed|email',
|
||||
]);
|
||||
|
||||
$account = $request->user();
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class RegisterController extends Controller
|
|||
'terms' => 'accepted',
|
||||
'username' => 'required|unique:external.accounts,username|min:6',
|
||||
'g-recaptcha-response' => 'required|captcha',
|
||||
'email' => 'required|email|confirmed'
|
||||
'email' => 'required|email|unique:external.accounts,email|confirmed'
|
||||
]);
|
||||
|
||||
$account = new Account;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@
|
|||
{!! Form::email('email_confirmation', old('email_confirm'), ['class' => 'form-control', 'placeholder' => 'username@server.com', 'required']) !!}
|
||||
</div>
|
||||
|
||||
{!! Form::hidden('email_current', $account->email) !!}
|
||||
|
||||
{!! Form::submit('Change', ['class' => 'btn btn-primary btn-centered']) !!}
|
||||
{!! Form::close() !!}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue