Class: ActiveSambaLdap::User

Inherits:
Base
  • Object
show all
Includes:
AccountEntry, Entry, Reloadable, SambaAccountEntry, SambaEntry, UserAccountEntry
Defined in:
lib/active_samba_ldap/user.rb

Constant Summary

Constants included from SambaAccountEntry

SambaAccountEntry::ACCOUNT_FLAGS_RE, SambaAccountEntry::DOMAIN_ADMIN_NAME, SambaAccountEntry::DOMAIN_ADMIN_RID, SambaAccountEntry::DOMAIN_GUEST_NAME, SambaAccountEntry::DOMAIN_GUEST_RID, SambaAccountEntry::FAR_FUTURE_TIME, SambaAccountEntry::WELL_KNOWN_NAMES, SambaAccountEntry::WELL_KNOWN_RIDS

Constants included from UserAccountEntry

ActiveSambaLdap::UserAccountEntry::NAME_RE

Constants included from AccountEntry

AccountEntry::NAME_RE_SRC

Instance Method Summary collapse

Methods included from SambaAccountEntry

#can_change_password?, #change_samba_password, #change_sid, #change_uid_number, #change_uid_number_by_rid, #disable, #disable_forcing_password_change, #disable_password_change, #disabled?, #enable, #enable_forcing_password_change, #enable_password_change, #enabled?, included, #must_change_password?, #rid

Methods included from UserAccountEntry

#default_gid_number, included, #remove_from_group

Methods included from AccountEntry

#change_password, #change_uid_number, #destroy, included, #setup_home_directory

Methods included from SambaEntry

#ensure_samba_available, #remove_samba_availability, #samba_available?, #samba_object_classes

Methods included from Entry

#ensure_unix_availability, included, #remove_unix_availability, #samba4?, #unix_available?, #unix_object_classes

Methods included from Reloadable

included

Methods inherited from Base

restart_nscd

Instance Method Details

#fill_default_values(options = {}) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/active_samba_ldap/user.rb', line 19

def fill_default_values(options={})
  result = super
  return result unless samba_available?

  options = options.stringify_keys
  subst = Proc.new do |key|
    value = options[key]
    if value
      substitute_template(value)
    else
      substituted_value(key)
    end
  end

  self.samba_home_path ||= subst["user_home_unc"]
  self.samba_home_drive ||= subst["user_home_drive"].sub(/([^:])$/, "\\1:")
  self.samba_profile_path ||= subst["user_profile"]
  self.samba_logon_script ||= subst["user_logon_script"]
end