diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index 7611ad96a1..51c5ce3e22 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -358,7 +358,6 @@ class UsersController extends Controller if (Gate::allows('users.permissions', $user)) { - \Log::debug('This user can edit permissions'); if ($request->has('permissions')) { $permissions_array = $request->input('permissions'); diff --git a/app/Http/Controllers/Users/UsersController.php b/app/Http/Controllers/Users/UsersController.php index 3c3bb1a0f0..d32f54904b 100755 --- a/app/Http/Controllers/Users/UsersController.php +++ b/app/Http/Controllers/Users/UsersController.php @@ -125,7 +125,6 @@ class UsersController extends Controller if (Gate::allows('users.permissions', $user)) { - \Log::debug('This user can edit permissions'); $permissions_array = $request->input('permission'); // Strip out the superuser permission if the user isn't a superadmin @@ -133,8 +132,6 @@ class UsersController extends Controller unset($permissions_array['superuser']); } $user->permissions = json_encode($permissions_array); - } else { - \Log::debug('This user can not edit permissions'); } @@ -222,13 +219,8 @@ class UsersController extends Controller // permissions here before we update the user. $permissions = $request->input('permissions', []); - \Log::debug('Page loaded permissions:'); - \Log::debug(print_r($permissions, true)); app('request')->request->set('permission', $permissions); - \Log::debug('After App:'); - \Log::debug(print_r($request->input('permission'), true)); - // This is a janky hack to prevent people from changing admin demo user data on the public demo. // The $ids 1 and 2 are special since they are seeded as superadmins in the demo seeder. // Thanks, jerks. You are why we can't have nice things. - snipe @@ -249,9 +241,6 @@ class UsersController extends Controller // Figure out of this user was an admin before this edit $orig_permissions_array = $user->decodePermissions(); - \Log::debug('Original User Permissions from the user object:'); - \Log::debug(print_r($orig_permissions_array, true)); - $orig_superuser = '0'; if (is_array($orig_permissions_array)) { if (array_key_exists('superuser', $orig_permissions_array)) { @@ -308,31 +297,18 @@ class UsersController extends Controller $user->password = bcrypt($request->input('password')); } - - \Log::debug('This user can edit permissions'); - if ($request->has('permission')) { - \Log::debug('The permissions array is present'); - \Log::debug('New Permissions via Request:'); - \Log::debug(print_r($request->input('permission'), true)); - $permissions_array = $request->input('permission'); - \Log::debug('Processed Permissions'); - \Log::debug(print_r($permissions_array, true)); // Strip out the superuser permission if the API user isn't a superadmin if (!Auth::user()->isSuperUser()) { - \Log::debug('The user is a superuser'); unset($permissions_array['superuser']); } + $user->permissions = $permissions_array; } - - - \Log::debug('New Permissions we think we are sending: '); - \Log::debug(print_r($user->permissions, true)); - + // Handle uploaded avatar app(ImageUploadRequest::class)->handleImages($user, 600, 'avatar', 'avatars', 'avatar');