active_directory 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,34 @@
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
+
8
+ A code example is worth a thousand words:
9
+
10
+ <pre>
11
+ require 'rubygems'
12
+ require 'active_directory'
13
+
14
+ # Uses the same settings as net/ldap
15
+ settings = {
16
+ :host => 'domain-controller.example.local',
17
+ :base => 'dc=example,dc=local',
18
+ :port => 636,
19
+ :encryption => :simple_tls,
20
+ :auth => {
21
+ :method => :simple,
22
+ :username => "username",
23
+ :password => "password"
24
+ }
25
+ }
26
+
27
+ # Basic usage
28
+ ActiveDirectory::Base.setup(settings)
29
+
30
+ ActiveDirectory::User.find(:all)
31
+ ActiveDirectory::User.find(:first, :userprincipalname => "john.smith@domain.com")
32
+
33
+ ActiveDirectory::Group.find(:all)
34
+ </pre>
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.0
1
+ 1.3.1
@@ -5,18 +5,18 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{active_directory}
8
- s.version = "1.3.0"
8
+ s.version = "1.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Adam T Kerr"]
12
- s.date = %q{2011-02-25}
12
+ s.date = %q{2011-02-28}
13
13
  s.description = %q{ActiveDirectory uses Net::LDAP to provide a means of accessing and modifying an Active Directory data store. This is a fork of the activedirectory gem.}
14
14
  s.email = %q{ajrkerr@gmail.com}
15
15
  s.extra_rdoc_files = [
16
- "README"
16
+ "README.md"
17
17
  ]
18
18
  s.files = [
19
- "README",
19
+ "README.md",
20
20
  "Rakefile",
21
21
  "VERSION",
22
22
  "active_directory.gemspec",
@@ -27,8 +27,11 @@ Gem::Specification.new do |s|
27
27
  "lib/active_directory/field_type/binary.rb",
28
28
  "lib/active_directory/field_type/date.rb",
29
29
  "lib/active_directory/field_type/dn_array.rb",
30
+ "lib/active_directory/field_type/group_dn_array.rb",
31
+ "lib/active_directory/field_type/member_dn_array.rb",
30
32
  "lib/active_directory/field_type/password.rb",
31
33
  "lib/active_directory/field_type/timestamp.rb",
34
+ "lib/active_directory/field_type/user_dn_array.rb",
32
35
  "lib/active_directory/group.rb",
33
36
  "lib/active_directory/member.rb",
34
37
  "lib/active_directory/user.rb"
@@ -33,6 +33,9 @@ require 'active_directory/field_type/binary.rb'
33
33
  require 'active_directory/field_type/date.rb'
34
34
  require 'active_directory/field_type/timestamp.rb'
35
35
  require 'active_directory/field_type/dn_array.rb'
36
+ require 'active_directory/field_type/user_dn_array.rb'
37
+ require 'active_directory/field_type/group_dn_array.rb'
38
+ require 'active_directory/field_type/member_dn_array.rb'
36
39
 
37
40
  module ActiveDirectory
38
41
 
@@ -66,7 +69,7 @@ module ActiveDirectory
66
69
  :lastlogontimestamp => :Timestamp,
67
70
  :pwdlastset => :Timestamp,
68
71
  :accountexpires => :Timestamp,
69
- :memberof => :DnArray,
72
+ :memberof => :MemberDnArray,
70
73
  },
71
74
 
72
75
  #Group objects
@@ -75,8 +78,8 @@ module ActiveDirectory
75
78
  :whencreated => :Date,
76
79
  :whenchanged => :Date,
77
80
  :objectsid => :Binary,
78
- :memberof => :DnArray,
79
- :member => :DnArray,
81
+ :memberof => :GroupDnArray,
82
+ :member => :MemberDnArray,
80
83
  },
81
84
  }
82
85
  end
@@ -32,6 +32,7 @@ module ActiveDirectory
32
32
  # Decodes a list of DNs into the objects that they are
33
33
  #
34
34
  def self.decode(dn_array)
35
+ # How to do user or group?
35
36
  Base.find( :all, :distinguishedname => dn_array)
36
37
  end
37
38
  end
@@ -0,0 +1,40 @@
1
+ #-- license
2
+ #
3
+ # Based on original code by Justin Mecham and James Hunt
4
+ # at http://rubyforge.org/projects/activedirectory
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ #
19
+ #++ license
20
+
21
+ module ActiveDirectory
22
+ module FieldType
23
+ class GroupDnArray
24
+ #
25
+ # Encodes an array of objects into a list of dns
26
+ #
27
+ def self.encode(obj_array)
28
+ obj_array.collect { |obj| obj.dn }
29
+ end
30
+
31
+ #
32
+ # Decodes a list of DNs into the objects that they are
33
+ #
34
+ def self.decode(dn_array)
35
+ # How to do user or group?
36
+ Group.find( :all, :distinguishedname => dn_array)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,40 @@
1
+ #-- license
2
+ #
3
+ # Based on original code by Justin Mecham and James Hunt
4
+ # at http://rubyforge.org/projects/activedirectory
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ #
19
+ #++ license
20
+
21
+ module ActiveDirectory
22
+ module FieldType
23
+ class MemberDnArray
24
+ #
25
+ # Encodes an array of objects into a list of dns
26
+ #
27
+ def self.encode(obj_array)
28
+ obj_array.collect { |obj| obj.dn }
29
+ end
30
+
31
+ #
32
+ # Decodes a list of DNs into the objects that they are
33
+ #
34
+ def self.decode(dn_array)
35
+ # How to do user or group?
36
+ User.find( :all, :distinguishedname => dn_array) + Group.find(:all, :distinguishedname => dn_array)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,40 @@
1
+ #-- license
2
+ #
3
+ # Based on original code by Justin Mecham and James Hunt
4
+ # at http://rubyforge.org/projects/activedirectory
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ #
19
+ #++ license
20
+
21
+ module ActiveDirectory
22
+ module FieldType
23
+ class UserDnArray
24
+ #
25
+ # Encodes an array of objects into a list of dns
26
+ #
27
+ def self.encode(obj_array)
28
+ obj_array.collect { |obj| obj.dn }
29
+ end
30
+
31
+ #
32
+ # Decodes a list of DNs into the objects that they are
33
+ #
34
+ def self.decode(dn_array)
35
+ # How to do user or group?
36
+ User.find( :all, :distinguishedname => dn_array)
37
+ end
38
+ end
39
+ end
40
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_directory
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 0
10
- version: 1.3.0
9
+ - 1
10
+ version: 1.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Adam T Kerr
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-25 00:00:00 -05:00
18
+ date: 2011-02-28 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -41,9 +41,9 @@ executables: []
41
41
  extensions: []
42
42
 
43
43
  extra_rdoc_files:
44
- - README
44
+ - README.md
45
45
  files:
46
- - README
46
+ - README.md
47
47
  - Rakefile
48
48
  - VERSION
49
49
  - active_directory.gemspec
@@ -54,8 +54,11 @@ files:
54
54
  - lib/active_directory/field_type/binary.rb
55
55
  - lib/active_directory/field_type/date.rb
56
56
  - lib/active_directory/field_type/dn_array.rb
57
+ - lib/active_directory/field_type/group_dn_array.rb
58
+ - lib/active_directory/field_type/member_dn_array.rb
57
59
  - lib/active_directory/field_type/password.rb
58
60
  - lib/active_directory/field_type/timestamp.rb
61
+ - lib/active_directory/field_type/user_dn_array.rb
59
62
  - lib/active_directory/group.rb
60
63
  - lib/active_directory/member.rb
61
64
  - lib/active_directory/user.rb
data/README DELETED
@@ -1,6 +0,0 @@
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
-