mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-10 07:16:06 -06:00
#1392 [profile] Changing email and sending confirmation
This commit is contained in:
parent
4530329a00
commit
d93d2ddf34
@ -33,4 +33,8 @@ return [
|
|||||||
'email_phone_not_found' => 'The E-mail, Phone Number is not correct!',
|
'email_phone_not_found' => 'The E-mail, Phone Number is not correct!',
|
||||||
|
|
||||||
'disable_account' => 'Do you want to close your account? This operation cannot be undone.',
|
'disable_account' => 'Do you want to close your account? This operation cannot be undone.',
|
||||||
|
|
||||||
|
// Mail
|
||||||
|
'update_email_mail_subject' => 'Email Updated!',
|
||||||
|
'update_email_mail_message' => 'Your Email Has Been Updated!',
|
||||||
];
|
];
|
||||||
|
|||||||
@ -79,7 +79,7 @@
|
|||||||
<label class="control-label font-weight-bold">
|
<label class="control-label font-weight-bold">
|
||||||
{{ trans("visiosoft.module.profile::field.email.name") }}
|
{{ trans("visiosoft.module.profile::field.email.name") }}
|
||||||
</label>
|
</label>
|
||||||
<input value="{{ user.email }}" type="text" disabled class="form-control">
|
{{ userForm.fields.email.input|raw }}
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
{{ userForm.actions|raw }}
|
{{ userForm.actions|raw }}
|
||||||
|
|||||||
@ -16,6 +16,9 @@ class UserFormBuilder extends FormBuilder
|
|||||||
'last_name' => [
|
'last_name' => [
|
||||||
'required' => true,
|
'required' => true,
|
||||||
],
|
],
|
||||||
|
'email' => [
|
||||||
|
'required' => true,
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $actions = [
|
protected $actions = [
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
use Anomaly\Streams\Platform\Message\MessageBag;
|
use Anomaly\Streams\Platform\Message\MessageBag;
|
||||||
use Anomaly\UsersModule\User\UserModel;
|
use Anomaly\UsersModule\User\UserModel;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Visiosoft\NotificationsModule\Notify\Notification\UserUpdateEmailMail;
|
||||||
|
|
||||||
class UserFormHandler
|
class UserFormHandler
|
||||||
{
|
{
|
||||||
@ -16,8 +17,14 @@ class UserFormHandler
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$userModel->find(Auth::id())
|
$data = $builder->getPostData();
|
||||||
->update($builder->getPostData());
|
|
||||||
|
$user = $userModel->find(\auth()->id());
|
||||||
|
if ($user->email != $data['email']) {
|
||||||
|
$user->notify(new UserUpdateEmailMail());
|
||||||
|
}
|
||||||
|
|
||||||
|
$user->update($builder->getPostData());
|
||||||
$messages->success(trans('visiosoft.module.profile::message.success_update'));
|
$messages->success(trans('visiosoft.module.profile::message.success_update'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user