activeldap 1.0.9 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +648 -567
- data/README +53 -48
- data/Rakefile +25 -53
- data/TODO +2 -0
- data/data/locale/en/LC_MESSAGES/active-ldap.mo +0 -0
- data/data/locale/ja/LC_MESSAGES/active-ldap.mo +0 -0
- data/examples/al-admin/app/controllers/application_controller.rb +1 -1
- data/examples/al-admin/app/views/_entry/_attributes_information.html.erb +7 -1
- data/examples/al-admin/app/views/users/_attributes_update_form.html.erb +13 -1
- data/examples/al-admin/config/environment.rb +2 -3
- data/lib/active_ldap.rb +103 -98
- data/lib/active_ldap/association/belongs_to_many.rb +7 -7
- data/lib/active_ldap/association/has_many.rb +4 -4
- data/lib/active_ldap/associations.rb +29 -5
- data/lib/active_ldap/attributes.rb +5 -1
- data/lib/active_ldap/base.rb +17 -13
- data/lib/active_ldap/configuration.rb +3 -4
- data/lib/active_ldap/connection.rb +3 -3
- data/lib/active_ldap/get_text/parser.rb +4 -2
- data/lib/active_ldap/helper.rb +59 -0
- data/lib/active_ldap/operations.rb +15 -10
- data/lib/active_ldap/xml.rb +22 -30
- data/po/en/active-ldap.po +221 -154
- data/po/ja/active-ldap.po +237 -178
- data/test-unit/History.txt +26 -0
- data/test-unit/Manifest.txt +1 -1
- data/test-unit/README.txt +1 -0
- data/test-unit/Rakefile +6 -1
- data/test-unit/lib/test/unit/autorunner.rb +6 -0
- data/test-unit/lib/test/unit/testcase.rb +101 -36
- data/test-unit/test/{test_testcase.rb → test-testcase.rb} +30 -1
- data/test-unit/test/test_assertions.rb +1 -1
- data/test/al-test-utils.rb +3 -1
- data/test/test_associations.rb +75 -6
- data/test/test_base.rb +45 -3
- metadata +75 -45
- data/examples/al-admin/config/initializers/gettext.rb +0 -15
data/test/test_base.rb
CHANGED
@@ -6,6 +6,49 @@ class TestBase < Test::Unit::TestCase
|
|
6
6
|
include AlTestUtils
|
7
7
|
|
8
8
|
priority :must
|
9
|
+
def test_delete_tree
|
10
|
+
make_ou("base")
|
11
|
+
_ou_class = ou_class("ou=base")
|
12
|
+
root1 = _ou_class.create("root1")
|
13
|
+
child1 = _ou_class.create(:ou => "child1", :parent => root1)
|
14
|
+
child2 = _ou_class.create(:ou => "child2", :parent => root1)
|
15
|
+
root2 = _ou_class.create("root2")
|
16
|
+
assert_equal(["base", "root1", "child1", "child2", "root2"],
|
17
|
+
_ou_class.find(:all).collect(&:ou))
|
18
|
+
_ou_class.delete_all(:base => root1.dn)
|
19
|
+
assert_equal(["base", "root2"],
|
20
|
+
_ou_class.find(:all).collect(&:ou))
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_delete_mixed_tree
|
24
|
+
make_ou("base")
|
25
|
+
_ou_class = ou_class("ou=base")
|
26
|
+
domain_class = Class.new(ActiveLdap::Base)
|
27
|
+
domain_class.ldap_mapping :dn_attribute => "dc",
|
28
|
+
:prefix => "",
|
29
|
+
:classes => ['domain']
|
30
|
+
|
31
|
+
root1 = _ou_class.create("root1")
|
32
|
+
child1 = _ou_class.create(:ou => "child1", :parent => root1)
|
33
|
+
domain1 = domain_class.create(:dc => "domain1", :parent => child1)
|
34
|
+
grandchild1 = _ou_class.create(:ou => "grandchild1", :parent => child1)
|
35
|
+
child2 = _ou_class.create(:ou => "child2", :parent => root1)
|
36
|
+
domain2 = domain_class.create(:dc => "domain2", :parent => child2)
|
37
|
+
root2 = _ou_class.create("root2")
|
38
|
+
|
39
|
+
entry_class = Class.new(ActiveLdap::Base)
|
40
|
+
entry_class.ldap_mapping :prefix => "ou=base",
|
41
|
+
:classes => ["top"]
|
42
|
+
entry_class.dn_attribute = nil
|
43
|
+
assert_equal(["base", "root1", "child1", "domain1", "grandchild1",
|
44
|
+
"child2", "domain2", "root2"],
|
45
|
+
entry_class.find(:all).collect(&:id))
|
46
|
+
entry_class.delete_all(nil, :base => child2.dn)
|
47
|
+
assert_equal(["base", "root1", "child1", "domain1", "grandchild1", "root2"],
|
48
|
+
entry_class.find(:all).collect(&:id))
|
49
|
+
end
|
50
|
+
|
51
|
+
priority :normal
|
9
52
|
def test_first
|
10
53
|
make_temporary_user(:simple => true) do |user1,|
|
11
54
|
make_temporary_user(:simple => true) do |user2,|
|
@@ -34,7 +77,6 @@ class TestBase < Test::Unit::TestCase
|
|
34
77
|
end
|
35
78
|
end
|
36
79
|
|
37
|
-
priority :normal
|
38
80
|
def test_set_attributes_with_a_blank_value_in_values
|
39
81
|
make_temporary_user(:simple => true) do |user,|
|
40
82
|
user.attributes = {"description" => ["a", "b", ""]}
|
@@ -657,7 +699,7 @@ class TestBase < Test::Unit::TestCase
|
|
657
699
|
EOX
|
658
700
|
|
659
701
|
assert_equal(<<-EOX, ou.to_xml)
|
660
|
-
|
702
|
+
<anonymous>
|
661
703
|
<dn>#{ou.dn}</dn>
|
662
704
|
<objectClasses type="array">
|
663
705
|
<objectClass>organizationalUnit</objectClass>
|
@@ -666,7 +708,7 @@ EOX
|
|
666
708
|
<ous type="array">
|
667
709
|
<ou>Sample</ou>
|
668
710
|
</ous>
|
669
|
-
|
711
|
+
</anonymous>
|
670
712
|
EOX
|
671
713
|
|
672
714
|
make_temporary_user do |user, password|
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeldap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Will Drewry
|
8
8
|
- Kouhei Sutou
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-
|
13
|
+
date: 2009-07-18 00:00:00 +09:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -19,9 +19,39 @@ dependencies:
|
|
19
19
|
version_requirement:
|
20
20
|
version_requirements: !ruby/object:Gem::Requirement
|
21
21
|
requirements:
|
22
|
-
- - "
|
22
|
+
- - "="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: 2.3.2
|
25
|
+
version:
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: locale
|
28
|
+
type: :runtime
|
29
|
+
version_requirement:
|
30
|
+
version_requirements: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 2.0.4
|
35
|
+
version:
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: gettext
|
38
|
+
type: :runtime
|
39
|
+
version_requirement:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - "="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 2.0.4
|
45
|
+
version:
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: gettext_activerecord
|
48
|
+
type: :runtime
|
49
|
+
version_requirement:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "="
|
23
53
|
- !ruby/object:Gem::Version
|
24
|
-
version:
|
54
|
+
version: 2.0.4
|
25
55
|
version:
|
26
56
|
- !ruby/object:Gem::Dependency
|
27
57
|
name: hoe
|
@@ -31,9 +61,9 @@ dependencies:
|
|
31
61
|
requirements:
|
32
62
|
- - ">="
|
33
63
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
64
|
+
version: 2.3.2
|
35
65
|
version:
|
36
|
-
description: "'Ruby/ActiveLdap' is a ruby extension library which provides a clean
|
66
|
+
description: " 'Ruby/ActiveLdap' is a ruby extension library which provides a clean\n objected oriented interface to the Ruby/LDAP library. It was inspired\n by ActiveRecord. This is not nearly as clean or as flexible as\n ActiveRecord, but it is still trivial to define new objects and manipulate\n them with minimal difficulty.\n"
|
37
67
|
email:
|
38
68
|
- redpig@dataspill.org
|
39
69
|
- kou@cozmixng.org
|
@@ -42,10 +72,10 @@ executables: []
|
|
42
72
|
extensions: []
|
43
73
|
|
44
74
|
extra_rdoc_files:
|
45
|
-
-
|
46
|
-
-
|
47
|
-
-
|
48
|
-
-
|
75
|
+
- README
|
76
|
+
- CHANGES
|
77
|
+
- COPYING
|
78
|
+
- LICENSE
|
49
79
|
files:
|
50
80
|
- CHANGES
|
51
81
|
- COPYING
|
@@ -122,7 +152,6 @@ files:
|
|
122
152
|
- examples/al-admin/config/environments/production.rb
|
123
153
|
- examples/al-admin/config/environments/test.rb
|
124
154
|
- examples/al-admin/config/initializers/exception_notifier.rb
|
125
|
-
- examples/al-admin/config/initializers/gettext.rb
|
126
155
|
- examples/al-admin/config/initializers/inflections.rb
|
127
156
|
- examples/al-admin/config/initializers/mime_types.rb
|
128
157
|
- examples/al-admin/config/ldap.yml.example
|
@@ -511,10 +540,10 @@ files:
|
|
511
540
|
- test-unit/test/test-omission.rb
|
512
541
|
- test-unit/test/test-pending.rb
|
513
542
|
- test-unit/test/test-priority.rb
|
543
|
+
- test-unit/test/test-testcase.rb
|
514
544
|
- test-unit/test/test_assertions.rb
|
515
545
|
- test-unit/test/test_error.rb
|
516
546
|
- test-unit/test/test_failure.rb
|
517
|
-
- test-unit/test/test_testcase.rb
|
518
547
|
- test-unit/test/test_testresult.rb
|
519
548
|
- test-unit/test/test_testsuite.rb
|
520
549
|
- test-unit/test/testunit-test-util.rb
|
@@ -566,6 +595,8 @@ files:
|
|
566
595
|
- test/test_validation.rb
|
567
596
|
has_rdoc: true
|
568
597
|
homepage: http://rubyforge.org/projects/ruby-activeldap/
|
598
|
+
licenses: []
|
599
|
+
|
569
600
|
post_install_message:
|
570
601
|
rdoc_options:
|
571
602
|
- --main
|
@@ -584,49 +615,48 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
584
615
|
- !ruby/object:Gem::Version
|
585
616
|
version: "0"
|
586
617
|
version:
|
587
|
-
requirements:
|
588
|
-
|
589
|
-
- (Open)LDAP server
|
618
|
+
requirements: []
|
619
|
+
|
590
620
|
rubyforge_project: ruby-activeldap
|
591
|
-
rubygems_version: 1.3.
|
621
|
+
rubygems_version: 1.3.4
|
592
622
|
signing_key:
|
593
|
-
specification_version:
|
623
|
+
specification_version: 3
|
594
624
|
summary: Ruby/ActiveLdap is a object-oriented API to LDAP
|
595
625
|
test_files:
|
596
|
-
- test/
|
597
|
-
- test/
|
598
|
-
- test/
|
599
|
-
- test/
|
626
|
+
- test/test_userdel.rb
|
627
|
+
- test/test_reflection.rb
|
628
|
+
- test/test_callback.rb
|
629
|
+
- test/test_usermod-lang-add.rb
|
600
630
|
- test/test_base.rb
|
601
|
-
- test/
|
631
|
+
- test/test_associations.rb
|
632
|
+
- test/test_connection.rb
|
633
|
+
- test/test_usermod-binary-add.rb
|
634
|
+
- test/test_groupdel.rb
|
602
635
|
- test/test_bind.rb
|
603
|
-
- test/
|
636
|
+
- test/test_attributes.rb
|
604
637
|
- test/test_configuration.rb
|
605
|
-
- test/test_connection.rb
|
606
|
-
- test/test_connection_per_class.rb
|
607
|
-
- test/test_connection_per_dn.rb
|
608
|
-
- test/test_dn.rb
|
609
|
-
- test/test_find.rb
|
610
638
|
- test/test_groupadd.rb
|
611
|
-
- test/
|
612
|
-
- test/
|
613
|
-
- test/
|
614
|
-
- test/
|
615
|
-
- test/test_load.rb
|
639
|
+
- test/test_usermod-binary-add-time.rb
|
640
|
+
- test/test_userls.rb
|
641
|
+
- test/test_validation.rb
|
642
|
+
- test/test_adapter.rb
|
616
643
|
- test/test_lpasswd.rb
|
617
|
-
- test/
|
618
|
-
- test/
|
644
|
+
- test/test_ldif.rb
|
645
|
+
- test/test_connection_per_dn.rb
|
619
646
|
- test/test_schema.rb
|
647
|
+
- test/test_groupls.rb
|
648
|
+
- test/test_useradd-binary.rb
|
649
|
+
- test/test_dn.rb
|
650
|
+
- test/test_base_per_instance.rb
|
620
651
|
- test/test_syntax.rb
|
621
|
-
- test/
|
652
|
+
- test/test_find.rb
|
653
|
+
- test/test_connection_per_class.rb
|
622
654
|
- test/test_user_password.rb
|
623
|
-
- test/test_useradd-binary.rb
|
624
|
-
- test/test_useradd.rb
|
625
|
-
- test/test_userdel.rb
|
626
|
-
- test/test_userls.rb
|
627
|
-
- test/test_usermod-binary-add-time.rb
|
628
|
-
- test/test_usermod-binary-add.rb
|
629
655
|
- test/test_usermod-binary-del.rb
|
630
|
-
- test/
|
656
|
+
- test/test_user.rb
|
657
|
+
- test/test_load.rb
|
658
|
+
- test/test_object_class.rb
|
631
659
|
- test/test_usermod.rb
|
632
|
-
- test/
|
660
|
+
- test/test_groupmod.rb
|
661
|
+
- test/test_useradd.rb
|
662
|
+
- test/test_acts_as_tree.rb
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# GetText doesn't support Rails 2.2.2 yet. :<
|
2
|
-
# require 'gettext/rails'
|
3
|
-
|
4
|
-
class ::ActionController::Base
|
5
|
-
include ActiveLdap::GetText
|
6
|
-
|
7
|
-
class << self
|
8
|
-
def init_gettext(*args)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
class ::ActionView::Base
|
14
|
-
include ActiveLdap::GetText
|
15
|
-
end
|