Merge pull request #611 from openclassify/dia

#1753 [dress-theme] everyscarfs.com eksikler ve buglar ve istekler
This commit is contained in:
Ozcan Durak 2020-07-09 16:24:48 +03:00 committed by GitHub
commit 29a6799ed4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 3 deletions

View File

@ -1,6 +1,7 @@
<?php namespace Visiosoft\AdvsModule;
use Anomaly\Streams\Platform\Addon\Plugin\Plugin;
use Twig_Environment;
use Visiosoft\AdvsModule\Adv\AdvModel;
use Visiosoft\AdvsModule\Adv\Command\appendRequestURL;
use Visiosoft\AdvsModule\Adv\Command\GetAd;
@ -87,6 +88,18 @@ class AdvsModulePlugin extends Plugin
->where('status', 'passive')
->get();
}
),
new \Twig_SimpleFunction(
'fn',
function (Twig_Environment $twig, $name, ...$args) {
$fn = $twig->getFunction($name);
if ($fn === false) {
return null;
}
return $fn->getCallable()(...$args);
}, ['needs_environment' => true]
)
];
}

View File

@ -33,4 +33,8 @@ return [
'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.',
// Mail
'update_email_mail_subject' => 'Email Updated!',
'update_email_mail_message' => 'Your Email Has Been Updated!',
];

View File

@ -79,7 +79,7 @@
<label class="control-label font-weight-bold">
{{ trans("visiosoft.module.profile::field.email.name") }}
</label>
<input value="{{ user.email }}" type="text" disabled class="form-control">
{{ userForm.fields.email.input|raw }}
</div>
<div class="form-group">
{{ userForm.actions|raw }}

View File

@ -16,6 +16,9 @@ class UserFormBuilder extends FormBuilder
'last_name' => [
'required' => true,
],
'email' => [
'required' => true,
],
];
protected $actions = [

View File

@ -3,6 +3,7 @@
use Anomaly\Streams\Platform\Message\MessageBag;
use Anomaly\UsersModule\User\UserModel;
use Illuminate\Support\Facades\Auth;
use Visiosoft\NotificationsModule\Notify\Notification\UserUpdateEmailMail;
class UserFormHandler
{
@ -16,8 +17,14 @@ class UserFormHandler
return;
}
$userModel->find(Auth::id())
->update($builder->getPostData());
$data = $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'));
}
}