Module: ActiveSambaLdap::SambaAccountEntry::ClassMethods

Defined in:
lib/active_samba_ldap/samba_account_entry.rb

Defined Under Namespace

Modules: PrimaryGroupProxy

Instance Method Summary collapse

Instance Method Details

#rid2uid(rid) ⇒ Object



51
52
53
54
55
56
57
58
# File 'lib/active_samba_ldap/samba_account_entry.rb', line 51

def rid2uid(rid)
  rid = Integer(rid)
  if WELL_KNOWN_RIDS.include?(rid)
    rid
  else
    (Integer(rid) - 1000) / 2
  end
end

#samba_object_classesObject



34
35
36
37
38
39
40
# File 'lib/active_samba_ldap/samba_account_entry.rb', line 34

def samba_object_classes
  if samba4?
    ["person", "organizationalPerson", "user"]
  else
    ["sambaSamAccount"]
  end
end

#start_ridObject



60
61
62
# File 'lib/active_samba_ldap/samba_account_entry.rb', line 60

def start_rid
  uid2rid(start_uid)
end

#uid2rid(uid) ⇒ Object



42
43
44
45
46
47
48
49
# File 'lib/active_samba_ldap/samba_account_entry.rb', line 42

def uid2rid(uid)
  uid = Integer(uid)
  if WELL_KNOWN_RIDS.include?(uid)
    uid
  else
    2 * uid + 1000
  end
end