  def check_import(mode, address_names)    #, address_emails

    err_msgs = []

    # Existing Addresss
    unless self.id.nil? or self.id == 0 or self.id == ''
      if mode == 'add'
        err_msgs << I18n.t('address.import.dont_specify_id')
      else
        begin
          org_address = Address.find(self.id)
        rescue
        end
        if org_address.nil?
          err_msgs << I18n.t('address.import.not_found')
        end
      end
    end

    # Requierd
    if self.name.nil? or self.name.empty?
      err_msgs <<  Address.human_attribute_name('name') + I18n.t('msg.is_required')
    end

    # Groups
    unless self.groups.nil? or self.groups.empty?

      if (/^|([0-9]+|)+$/ =~ self.groups) == 0

        self.get_groups_a.each do |group_id|
          begin
            group = Group.find(group_id)
          rescue => evar
            group = nil
          end
          if group.nil?
            err_msgs << I18n.t('address.import.not_valid_groups') + ': '+group_id.to_s
            break
          end
        end
      else
        err_msgs << I18n.t('address.import.invalid_groups_format')
      end
    end

    # Teams
    unless self.teams.nil? or self.teams.empty?

      if (/^|([0-9]+|)+$/ =~ self.teams) == 0

        self.get_teams_a.each do |team_id|
          begin
            team = Team.find(team_id)
          rescue => evar
            team = nil
          end
          if team.nil?
            err_msgs << I18n.t('address.import.not_valid_teams') + ': '+team_id.to_s
            break
          end
        end

      else
        err_msgs << I18n.t('address.import.invalid_teams_format')
      end
    end

    return err_msgs
  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.