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

    return unless request.post?

    @user = User.find(params[:user_id])

    unless params[:official_titles].nil?
      params[:official_titles].each do |official_title_id|
        if @user.user_titles.index{|user_title| user_title.official_title_id.to_s == official_title_id}.nil?
          user_title = UserTitle.new
          user_title.user_id = @user.id
          user_title.official_title_id = official_title_id
          user_title.save!

          @user.user_titles << user_title
        end
      end
    end

    render(:partial => 'ajax_user_titles', :layout => false)
  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.