From 50f16788f9a99753f1b37f0df57705bb32b9a14c Mon Sep 17 00:00:00 2001 From: pmkuipers Date: Sat, 23 May 2020 22:56:55 +0200 Subject: [PATCH] Fix in assigning and updating role of domain admin --- app/Http/Controllers/VMailController.php | 2 +- public/js/app.js | 1 - resources/js/app.js | 3 +-- resources/views/layouts/vmail.blade.php | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/VMailController.php b/app/Http/Controllers/VMailController.php index ecc8f5f..0d1f54a 100644 --- a/app/Http/Controllers/VMailController.php +++ b/app/Http/Controllers/VMailController.php @@ -179,7 +179,7 @@ class VMailController extends Controller } } - $domain->users()->attach($validatedData['userid'],['role' => $validatedData['userid']]); + $domain->users()->attach($validatedData['userid'],['role' => $validatedData['role']]); $domain->save(); return true; diff --git a/public/js/app.js b/public/js/app.js index 1b822ed..2139b95 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -75404,7 +75404,6 @@ Vue.component('datetime', vue_datetime__WEBPACK_IMPORTED_MODULE_0__["Datetime"]) * * ***************/ admin_tidy: function admin_tidy(a) { - // tidy_admininfo(a) a.changed = { role: false }; diff --git a/resources/js/app.js b/resources/js/app.js index ebe14e7..c403d56 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -1020,9 +1020,8 @@ Vue.component('datetime',Datetime); * * ***************/ admin_tidy: function admin_tidy(a) { - // tidy_admininfo(a) a.changed = { - role: false + role: false }; }, admins_list: function admins_list() { diff --git a/resources/views/layouts/vmail.blade.php b/resources/views/layouts/vmail.blade.php index ac4a25c..ad6d145 100644 --- a/resources/views/layouts/vmail.blade.php +++ b/resources/views/layouts/vmail.blade.php @@ -360,7 +360,7 @@ window.InitialState.IsSiteAdmin = @json(Auth::user()->hasRole('admin')); @{{{'own':'Owner','edit': 'Manager','view': 'Viewer',}[a.pivot.role]}} - +