bsb_active_directory 8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ = Active Directory
2
+
3
+ Ruby Integration with Microsoft's Active Directory system based on original code by Justin Mecham and James Hunt at http://rubyforge.org/projects/activedirectory
4
+
5
+ See documentation on ActiveDirectory::Base for more information.
6
+
7
+ Caching:
8
+ Queries for membership and group membership are based on the distinguished name of objects. Doing a lot of queries, especially for a Rails app, is a sizable slowdown. To alleviate the problem, I've implemented a very basic cache for queries which search by :distinguishedname. This is disabled by default. All other queries are unaffected.
9
+
10
+
11
+ A code example is worth a thousand words:
12
+
13
+ <pre>
14
+ require 'rubygems'
15
+ require 'bsb_active_directory'
16
+
17
+ # Uses the same settings as net/ldap
18
+ settings = {
19
+ :host => 'domain-controller.example.local',
20
+ :base => 'dc=example,dc=local',
21
+ :port => 636,
22
+ :encryption => :simple_tls,
23
+ :auth => {
24
+ :method => :simple,
25
+ :username => "username",
26
+ :password => "password"
27
+ }
28
+ }
29
+
30
+ # Basic usage
31
+ ActiveDirectory::Base.setup(settings)
32
+
33
+ ActiveDirectory::User.find(:all)
34
+ ActiveDirectory::User.find(:first, :userprincipalname => "john.smith@domain.com")
35
+
36
+ ActiveDirectory::Group.find(:all)
37
+
38
+ #Caching is disabled by default, to enable:
39
+ ActiveDirectory::Base.enable_cache
40
+ ActiveDirectory::Base.disable_cache
41
+ ActiveDirectory::Base.cache?
42
+
43
+ </pre>
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.6.2
@@ -0,0 +1,11 @@
1
+ module ActiveDirectory
2
+ module GroupType
3
+ BUILTIN_LOCAL_GROUP = 0x00000001
4
+ ACCOUNT_GROUP = 0x00000002
5
+ RESSOURCE_GROUP = 0x00000004
6
+ UNIVERSAL_GROUP = 0x00000008
7
+ APP_BASIC_GROUP = 0x00000010
8
+ APP_QUERY_GROUP = 0x00000020
9
+ SECURITY_ENABLED = 0x80000000
10
+ end
11
+ end
@@ -0,0 +1,16 @@
1
+ module ActiveDirectory
2
+ module SamAccountType
3
+ DOMAIN_OBJECT = 0x0
4
+ GROUP_OBJECT = 0x10000000
5
+ NON_SECURITY_GROUP_OBJECT = 0x10000001
6
+ ALIAS_OBJECT = 0x20000000
7
+ NON_SECURITY_ALIAS_OBJECT = 0x20000001
8
+ USER_OBJECT = 0x30000000
9
+ NORMAL_USER_ACCOUNT = 0x30000000
10
+ MACHINE_ACCOUNT = 0x30000001
11
+ TRUST_ACCOUNT = 0x30000002
12
+ APP_BASIC_GROUP = 0x40000000
13
+ APP_QUERY_GROUP = 0x40000001
14
+ ACCOUNT_TYPE_MAX = 0x7fffffff
15
+ end
16
+ end
@@ -0,0 +1,3 @@
1
+ %w[sam_account_type group_type].each do |file_name|
2
+ require 'bsb_active_directory/attributes/' + file_name
3
+ end