Sha256: e8b9ab5478f01e8c4f6177e319adc9c895aa0fee3cf0699219e7d3689c9cd1ad

Contents?: true

Size: 1.46 KB

Versions: 2

Compression:

Stored size: 1.46 KB

Contents

class Mdm::User < ActiveRecord::Base
  extend MetasploitDataModels::SerializedPrefs
  
  #
  # Associations
  #

  has_many :automatic_exploitation_runs,
           class_name: 'MetasploitDataModels::AutomaticExploitation::Run',
           inverse_of: :user

  has_many :automatic_exploitation_match_sets,
           class_name: 'MetasploitDataModels::AutomaticExploitation::MatchSet',
           inverse_of: :user

  has_many :owned_workspaces,
           class_name: 'Mdm::Workspace',
           foreign_key: 'owner_id',
           inverse_of: :owner

  has_many :module_runs,
           class_name: 'MetasploitDataModels::ModuleRun',
           inverse_of: :user

  has_many :tags,
           class_name: 'Mdm::Tag',
           inverse_of: :user

  has_and_belongs_to_many :workspaces, -> { uniq }, :join_table => 'workspace_members', :class_name => 'Mdm::Workspace'

  #
  # Serialziations
  #

  serialize :prefs, MetasploitDataModels::Base64Serializer.new

  serialized_prefs_attr_accessor :nexpose_host, :nexpose_port, :nexpose_user, :nexpose_pass, :nexpose_creds_type, :nexpose_creds_user, :nexpose_creds_pass
  serialized_prefs_attr_accessor :http_proxy_host, :http_proxy_port, :http_proxy_user, :http_proxy_pass
  serialized_prefs_attr_accessor :time_zone, :session_key
  serialized_prefs_attr_accessor :last_login_address # specifically NOT last_login_ip to prevent confusion with AuthLogic magic columns (which dont work for serialized fields)
  
  Metasploit::Concern.run(self)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
metasploit_data_models-1.0.0.pre.rails.pre.4.0b app/models/mdm/user.rb
metasploit_data_models-1.0.0.pre.rails.pre.4.0a app/models/mdm/user.rb