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

    return unless request.post?

    folder_id = params[:id]
    SqlHelper.validate_token([folder_id])

    if Folder.check_user_auth(folder_id, @login_user, 'w', true)

      @folder = Folder.find(folder_id)

      disp_ctrls = []
      check_bbs_top = params[:check_bbs_top]
      if check_bbs_top == '1'
        disp_ctrls << Folder::DISPCTRL_BBS_TOP
      end

      select_sorting = params[:select_sorting]
      unless select_sorting.nil?
        disp_ctrls << Folder::DISPCTRL_DEF_SORT+'='+select_sorting
      end

      if disp_ctrls.empty?
        @folder.update_attribute(:disp_ctrl, nil)
      else
        @folder.update_attribute(:disp_ctrl, '|'+disp_ctrls.join('|')+'|')
      end

      flash[:notice] = t('msg.update_success')
    else
      flash[:notice] = 'ERROR:' + t('folder.need_auth_to_modify')
    end

    render(:partial => 'ajax_disp_ctrl', :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.