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

    return unless request.post?

    @mail_folder = MailFolder.find(params[:id])

    if params[:thetisBoxSelKeeper].blank?
      prms = ApplicationHelper.get_fwd_params(params)
      prms[:action] = 'show_tree'
      redirect_to(prms)
      return
    end

    parent_id = params[:thetisBoxSelKeeper].split(':').last
    SqlHelper.validate_token([parent_id])

    if parent_id == '0'   # '0' for ROOT
      flash[:notice] = 'ERROR:' + t('mail_folder.root_cannot_have_folders')
    else
      # Check if specified parent is not one of subfolders.
      childs = MailFolder.get_childs(@mail_folder.id, true, false)
      if childs.include?(parent_id) or (@mail_folder.id == parent_id.to_i)
        flash[:notice] = 'ERROR:' + t('folder.cannot_be_parent')
        prms = ApplicationHelper.get_fwd_params(params)
        prms[:action] = 'show_tree'
        redirect_to(prms)
        return
      end

      @mail_folder.parent_id = parent_id
      @mail_folder.xorder = nil
      @mail_folder.save

      flash[:notice] = t('msg.move_success')
    end

    prms = ApplicationHelper.get_fwd_params(params)
    prms[:action] = 'show_tree'
    redirect_to(prms)
  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.