# File lib/active_samba_ldap/configuration.rb, line 111 def compute_required_variables not_required_variables = %(base scope ldap_scope) (VARIABLES - public_methods - not_required_variables).collect do |x| x.to_sym end end
# File lib/active_samba_ldap/configuration.rb, line 142 def [](name) @target[name.to_sym] || (respond_to?(name) ? send(name) : nil) end
# File lib/active_samba_ldap/configuration.rb, line 202 def allow_anonymous false end
# File lib/active_samba_ldap/configuration.rb, line 311 def bind_dn nil end
# File lib/active_samba_ldap/configuration.rb, line 230 def computers_suffix suffix = retrieve_value_from_smb_conf(/ldap\s+machine\s+suffix/) return suffix if suffix if self[:samba4] "cn=Computers" else "ou=Computers" end end
# File lib/active_samba_ldap/configuration.rb, line 257 def default_computer_gid rid = ActiveSambaLdap::Group::DOMAIN_COMPUTERS_RID ActiveSambaLdap::Group.rid2gid(rid) end
# File lib/active_samba_ldap/configuration.rb, line 252 def default_user_gid rid = ActiveSambaLdap::Group::DOMAIN_USERS_RID ActiveSambaLdap::Group.rid2gid(rid) end
# File lib/active_samba_ldap/configuration.rb, line 220 def groups_suffix suffix = retrieve_value_from_smb_conf(/ldap\s+group\s+suffix/) return suffix if suffix if self[:samba4] "cn=Users" else "ou=Groups" end end
# File lib/active_samba_ldap/configuration.rb, line 194 def host "localhost" end
# File lib/active_samba_ldap/configuration.rb, line 240 def idmap_suffix retrieve_value_from_smb_conf(/ldap\s+idmap\s+suffix/) || "ou=Idmap" end
# File lib/active_samba_ldap/configuration.rb, line 123 def merge result = @target.dup VARIABLES.each do |variable| key = variable.to_sym result[key] ||= send(variable) if respond_to?(variable) normalize_method = "normalize_#{variable}" if respond_to?(normalize_method) result[key] = __send__(normalize_method, result[key]) end validate_method = "validate_#{variable}" if respond_to?(validate_method) __send__(validate_method, result[key]) end end result end
# File lib/active_samba_ldap/configuration.rb, line 206 def method :plain end
# File lib/active_samba_ldap/configuration.rb, line 319 def normalize_password_hash_type(type) type.to_s.downcase.to_sym end
# File lib/active_samba_ldap/configuration.rb, line 284 def normalize_user_home_directory_mode(mode) if mode Integer(mode) else nil end rescue ArgumentError raise InvalidConfigurationValueError.new("user_home_directory", mode, $!.message) end
# File lib/active_samba_ldap/configuration.rb, line 315 def password_hash_type :ssha end
# File lib/active_samba_ldap/configuration.rb, line 198 def port 389 end
# File lib/active_samba_ldap/configuration.rb, line 323 def samba4 smb_conf = self[:smb_conf] if smb_conf and /^\s*server\s*role\s*=/ =~ File.read(smb_conf) true else false end end
# File lib/active_samba_ldap/configuration.rb, line 162 def samba_domain _smb_conf = self["smb_conf"] if _smb_conf File.open(_smb_conf) do |f| f.read.grep(/^\s*[^#;]/).each do |line| if /^\s*workgroup\s*=\s*(\S+)\s*$/ =~ line return $1.upcase end end end else nil end end
# File lib/active_samba_ldap/configuration.rb, line 177 def samba_netbios_name netbios_name = nil _smb_conf = self["smb_conf"] if _smb_conf File.open(_smb_conf) do |f| f.read.grep(/^\s*[^#;]/).each do |line| if /^\s*netbios\s*name\s*=\s*(.+)\s*$/ =~ line netbios_name = $1 break end end end end netbios_name ||= Socket.gethostname netbios_name ? netbios_name.upcase : nil end
# File lib/active_samba_ldap/configuration.rb, line 146 def sid result = `net getlocalsid` if $?.success? result.chomp.gsub(/\G[^:]+:\s*/, '') else nil end end
# File lib/active_samba_ldap/configuration.rb, line 262 def skeleton_directory "/etc/skel" end
# File lib/active_samba_ldap/configuration.rb, line 155 def smb_conf %(/etc/samba/smb.conf /usr/local/etc/samba/smb.conf).each do |guess| return guess if File.exist?(guess) end nil end
# File lib/active_samba_ldap/configuration.rb, line 248 def start_gid 10000 end
# File lib/active_samba_ldap/configuration.rb, line 244 def start_uid 10000 end
# File lib/active_samba_ldap/configuration.rb, line 307 def user_gecos nil end
# File lib/active_samba_ldap/configuration.rb, line 276 def user_home_directory "/home/%U" end
# File lib/active_samba_ldap/configuration.rb, line 280 def user_home_directory_mode 0755 end
# File lib/active_samba_ldap/configuration.rb, line 299 def user_home_drive "H:" end
# File lib/active_samba_ldap/configuration.rb, line 266 def user_home_unc netbios_name = self["samba_netbios_name"] netbios_name ? "\\\\#{netbios_name}\\%U" : nil end
# File lib/active_samba_ldap/configuration.rb, line 295 def user_login_shell "/bin/false" end
# File lib/active_samba_ldap/configuration.rb, line 303 def user_logon_script "logon.bat" end
# File lib/active_samba_ldap/configuration.rb, line 271 def user_profile netbios_name = self["samba_netbios_name"] netbios_name ? "\\\\#{netbios_name}\\profiles\\%U" : nil end
# File lib/active_samba_ldap/configuration.rb, line 210 def users_suffix suffix = retrieve_value_from_smb_conf(/ldap\s+user\s+suffix/) return suffix if suffix if self[:samba4] "cn=Users" else "ou=Users" end end
# File lib/active_samba_ldap/configuration.rb, line 333 def validate_password_hash_type(type) unless AVAILABLE_HASH_TYPES.include?(type) types = AVAILABLE_HASH_TYPES.collect {|x| x.inspect}.join(", ") raise InvalidConfigurationValueError.new("password_hash_type", type, _("must be in %s") % types) end end
Generated with the Darkfish Rdoc Generator 2.