@@ -288,33 +288,31 @@ public function update(SaveUserRequest $request, User $user)
288288 $ user ->password = bcrypt ($ request ->input ('password ' ));
289289 }
290290
291-
292291 // Update the location of any assets checked out to this user
293292 Asset::where ('assigned_type ' , User::class)
294293 ->where ('assigned_to ' , $ user ->id )
295294 ->update (['location_id ' => $ user ->location_id ]);
296295
297- $ permissions_array = $ request ->input ('permission ' );
298-
296+ $ permissions_array = $ request ->input ('permission ' );
299297
300- // Strip out the superuser permission if the user isn't a superadmin
301- if (! auth ()->user ()->isSuperUser ()) {
302- unset($ permissions_array ['superuser ' ]);
303- $ permissions_array ['superuser ' ] = $ orig_superuser ;
304- }
298+ // Strip out the superuser permission if the user isn't a superadmin
299+ if (! auth ()->user ()->isSuperUser ()) {
300+ unset($ permissions_array ['superuser ' ]);
301+ $ permissions_array ['superuser ' ] = $ orig_superuser ;
302+ }
305303
306- $ user ->permissions = json_encode ($ permissions_array );
304+ $ user ->permissions = json_encode ($ permissions_array );
307305
308- // Handle uploaded avatar
309- app (ImageUploadRequest::class)->handleImages ($ user , 600 , 'avatar ' , 'avatars ' , 'avatar ' );
310- session ()->put (['redirect_option ' => $ request ->get ('redirect_option ' )]);
306+ // Handle uploaded avatar
307+ app (ImageUploadRequest::class)->handleImages ($ user , 600 , 'avatar ' , 'avatars ' , 'avatar ' );
308+ session ()->put (['redirect_option ' => $ request ->get ('redirect_option ' )]);
311309
312- if ($ user ->save ()) {
313- // Redirect to the user page
314- return redirect ()->to (Helper::getRedirectOption ($ request , $ user ->id , 'Users ' ))
315- ->with ('success ' , trans ('admin/users/message.success.update ' ));
316- }
317- return redirect ()->back ()->withInput ()->withErrors ($ user ->getErrors ());
310+ if ($ user ->save ()) {
311+ // Redirect to the user page
312+ return redirect ()->to (Helper::getRedirectOption ($ request , $ user ->id , 'Users ' ))
313+ ->with ('success ' , trans ('admin/users/message.success.update ' ));
314+ }
315+ return redirect ()->back ()->withInput ()->withErrors ($ user ->getErrors ());
318316 }
319317
320318 /**
0 commit comments