Removed debugging

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-02-28 12:14:53 +00:00
parent 767b26d5b4
commit 94ca0fcb59
2 changed files with 2 additions and 27 deletions

View file

@ -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');

View file

@ -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');