Skip to content

Commit 4eaf858

Browse files
committed
Fix inability to set user as non-admin, closes pterodactyl#414
1 parent 43df653 commit 4eaf858

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
1010
* `[beta.2.1]` — Fixes a bug causing login issues and password reset failures when reCAPTCHA is enabled.
1111
* Fixes remote timing attack vulnerability due to hmac comparsion in API middleware.
1212
* `[beta.2.1]` — Fixes bug requiring docker image field to be filled out when adding a service option.
13+
* `[beta.2.1]` — Fixes inability to mark a user as a non-admin once they were assigned the role.
1314

1415
### Added
1516
* Added new scripts for service options that allows installation of software in a privileged Docker container on the node prior to marking a server as installed.

app/Http/Controllers/Admin/UserController.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,13 @@ public function update(Request $request, $id)
143143
{
144144
try {
145145
$repo = new UserRepository;
146-
$user = $repo->update($id, $request->intersect([
147-
'email', 'password', 'name_first',
148-
'name_last', 'username', 'root_admin',
149-
]));
146+
$user = $repo->update($id, array_merge(
147+
$request->only('root_admin'),
148+
$request->intersect([
149+
'email', 'password', 'name_first',
150+
'name_last', 'username',
151+
])
152+
));
150153
Alert::success('User account was successfully updated.')->flash();
151154
} catch (DisplayValidationException $ex) {
152155
return redirect()->route('admin.users.view', $id)->withErrors(json_decode($ex->getMessage()));

0 commit comments

Comments
 (0)