  def ajax_delete_items
    Log.add_info(request, params.inspect)

    unless params[:check_item].blank?
      is_admin = @login_user.admin?(User::AUTH_ITEM)

      count = 0
      params[:check_item].each do |item_id, value|
        if value == '1'

          begin
            item = Item.find(item_id)
            next if !is_admin and item.user_id != @login_user.id

            item.destroy

          rescue => evar
            item = nil
            Log.add_error(request, evar)
          end

          count += 1
        end
      end
      flash[:notice] = t('item.deleted', :count => count)
    end

    get_items
  end
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.