Admin is not Allowed to Delete Themselves

To stop an admin user deleting themselves so they can’t accidentally delete the last admin user, the UsersController.php file should be updated.
admindel

The delete function checks if the user role is ‘admin’. If so, and admin tries to delete themselves, an error message ‘Admin users can not delete themselves’ appears:
admindel1