  def self.on_desktop?(user, xtype, target_id)

    return false if user.nil? or xtype.nil? or target_id.nil?

    SqlHelper.validate_token([xtype, target_id])

    con = "(user_id=#{user.id}) and (xtype='#{xtype}') and (target_id=#{target_id})"

    begin
      toy = Toy.where(con).first
    rescue => evar
      Log.add_error(nil, evar)
    end

    return (!toy.nil?)
  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.