Class: Ucert::AudiologTracker

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/ucert/audiolog_tracker.rb

Overview

Class to handle Audiolog user account IDs

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

#file_2_list, #is_fqdn?, #is_ip?, #is_url?, #list_2_file, #load_known_user_map_from_file, #nslookup, #search_ad, #update_dn

Constructor Details

#initialize(params = {}) ⇒ AudiologTracker

Instance default variables



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/ucert/audiolog_tracker.rb', line 18

def initialize (params ={})

   @verbose=params.fetch(:verbose, false)
   # Audiolog users are defined by assigning AD user into a container under CMBNY domain controller
   # Refer to the screenshot for further details
	#
	#
	# Define the Audiolog AD group instance variable
   @audiolog_class={"CN=Group Audiolog,CN=Users,DC=ny,DC=cmbchina,DC=com"=>true}
	# Load the Audiolog host machine instance variable
	@audiolog_host={"CN=3K103531,OU=Computers,OU=SystemManagement,DC=ny,DC=cmbchina,DC=com"=>true}
	# AudioLog users are configured directly in the application; there is no user report that could
	# be exported by the application GUI; so that we have to hard code it as below:
	@audiolog_user={1=>{"type"=>"local", "uid"=>"Admin", "desc"=>"Application Administrator", "dn"=>nil},
									2=>{"type"=>"local", "uid"=>"Archivist", "desc"=>"Archive Operator", "dn"=>nil},
									3=>{"type"=>"domain", "uid"=>"ChenZhon108", "desc"=>"Zhong Chen", "dn"=>"CN=Zhong Chen,OU=Disabled Users,OU=New York Branch,DC=ny,DC=cmbchina,DC=com"},
									4=>{"type"=>"domain", "uid"=>"chincm136", "desc"=>"Carmen Chin", "dn"=>"CN=Carmen Chin,OU=Users,OU=Compliance,OU=New York Branch,DC=ny,DC=cmbchina,DC=com"},
									5=>{"type"=>"domain", "uid"=>"FeiWang", "desc"=>"Fei Wang", "dn"=>"CN=Fei Wang,OU=Users,OU=Compliance,OU=New York Branch,DC=ny,DC=cmbchina,DC=com"},
									6=>{"type"=>"domain", "uid"=>"FrieKei804", "desc"=>"Keith Friedland", "dn"=>"CN=Keith Friedland,OU=Users,OU=Compliance,OU=New York Branch,DC=ny,DC=cmbchina,DC=com"},
									7=>{"type"=>"domain", "uid"=>"LianDuan", "desc"=>"Lian Duan", "dn"=>" CN=Lian Duan,OU=Users,OU=Compliance,OU=New York Branch,DC=ny,DC=cmbchina,DC=com"},
									8=>{"type"=>"local", "uid"=>"Engineer", "desc"=>"Application Configuration User", "dn"=>nil},
									9=>{"type"=>"local", "uid"=>"playback", "desc"=>"Playback user", "dn"=>nil},
									10=>{"type"=>"local", "uid"=>"Power", "desc"=>"Application Power User", "dn"=>nil},
									11=>{"type"=>"local", "uid"=>"User", "desc"=>"Normal application user", "dn"=>nil}

	}
end

Instance Attribute Details

#audiolog_userObject (readonly)

Returns the value of attribute audiolog_user.



15
16
17
# File 'lib/ucert/audiolog_tracker.rb', line 15

def audiolog_user
  @audiolog_user
end

#verboseObject

Class constant variables



14
15
16
# File 'lib/ucert/audiolog_tracker.rb', line 14

def verbose
  @verbose
end

Instance Method Details

Print out the user entitlement table in plain text, to be imported into database



49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/ucert/audiolog_tracker.rb', line 49

def print_user
	begin
		puts "Audiolog User Report in Plain-text Format" if @verbose
     @audiolog_user[1].keys.map {|x| print x,"|"} if @verbose
		puts if @verbose
		@audiolog_user.values.each do |record|
			record.values.map {|y| print y,"|"}
			puts
		end
     puts
	rescue => ee
		puts "Exception on method #{__method__}: #{ee}"
	end
end