diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index 2822cb3c4..c9d7a4725 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -141,20 +141,12 @@ class UserController extends Controller */ public function update(Request $request, $id) { - // Rename variables because autofill cannot be disabled - // in any logical manner, and editing users is impossible. - $fixedData = array_filter( - collect($request->all())->mapWithKeys(function ($item, $key) { - return [str_replace('input_', '', $key) => $item]; - })->only([ - 'email', 'password', 'name_first', - 'name_last', 'username', 'root_admin', - ])->toArray() - ); - try { $repo = new UserRepository; - $user = $repo->update($id, $fixedData); + $user = $repo->update($id, $request->intersect([ + 'email', 'password', 'name_first', + 'name_last', 'username', 'root_admin', + ])); Alert::success('User account was successfully updated.')->flash(); } catch (DisplayValidationException $ex) { return redirect()->route('admin.users.view', $id)->withErrors(json_decode($ex->getMessage())); diff --git a/public/js/autocomplete.js b/public/js/autocomplete.js new file mode 100644 index 000000000..15c43797e --- /dev/null +++ b/public/js/autocomplete.js @@ -0,0 +1,6 @@ +// Hacky fix for browsers ignoring autocomplete="off" +$(document).ready(function() { + $('.form-autocomplete-stop').on('click', function () { + $(this).removeAttr('readonly').blur().focus(); + }); +}); diff --git a/public/themes/pterodactyl/css/pterodactyl.css b/public/themes/pterodactyl/css/pterodactyl.css index 9c4f69c44..96a7f030e 100644 --- a/public/themes/pterodactyl/css/pterodactyl.css +++ b/public/themes/pterodactyl/css/pterodactyl.css @@ -299,3 +299,8 @@ tr:hover + tr.server-description { bottom: 5px; right: 10px; } + +input.form-autocomplete-stop[readonly] { + background: inherit; + cursor: text; +} diff --git a/resources/themes/pterodactyl/admin/users/view.blade.php b/resources/themes/pterodactyl/admin/users/view.blade.php index 3580b0dd3..39461e462 100644 --- a/resources/themes/pterodactyl/admin/users/view.blade.php +++ b/resources/themes/pterodactyl/admin/users/view.blade.php @@ -44,25 +44,25 @@