activeldap 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +454 -0
- data/COPYING +340 -0
- data/LICENSE +58 -0
- data/README +101 -0
- data/Rakefile +175 -0
- data/TODO +25 -0
- data/benchmark/bench-al.rb +202 -0
- data/benchmark/config.yaml.sample +5 -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/README +182 -0
- data/examples/al-admin/Rakefile +10 -0
- data/examples/al-admin/app/controllers/account_controller.rb +59 -0
- data/examples/al-admin/app/controllers/application.rb +34 -0
- data/examples/al-admin/app/controllers/attributes_controller.rb +17 -0
- data/examples/al-admin/app/controllers/directory_controller.rb +47 -0
- data/examples/al-admin/app/controllers/object_classes_controller.rb +17 -0
- data/examples/al-admin/app/controllers/syntaxes_controller.rb +17 -0
- data/examples/al-admin/app/controllers/users_controller.rb +51 -0
- data/examples/al-admin/app/controllers/welcome_controller.rb +10 -0
- data/examples/al-admin/app/helpers/account_helper.rb +2 -0
- data/examples/al-admin/app/helpers/application_helper.rb +42 -0
- data/examples/al-admin/app/helpers/attributes_helper.rb +15 -0
- data/examples/al-admin/app/helpers/directory_helper.rb +7 -0
- data/examples/al-admin/app/helpers/object_classes_helper.rb +10 -0
- data/examples/al-admin/app/helpers/syntaxes_helper.rb +10 -0
- data/examples/al-admin/app/helpers/url_helper.rb +13 -0
- data/examples/al-admin/app/helpers/users_helper.rb +17 -0
- data/examples/al-admin/app/helpers/welcome_helper.rb +2 -0
- data/examples/al-admin/app/models/entry.rb +23 -0
- data/examples/al-admin/app/models/ldap_user.rb +54 -0
- data/examples/al-admin/app/models/user.rb +91 -0
- data/examples/al-admin/app/views/_entry/_attributes_information.rhtml +23 -0
- data/examples/al-admin/app/views/_entry/_entry.rhtml +15 -0
- data/examples/al-admin/app/views/_schema/_aliases.rhtml +7 -0
- data/examples/al-admin/app/views/_switcher/_after.rhtml +2 -0
- data/examples/al-admin/app/views/_switcher/_before.rhtml +5 -0
- data/examples/al-admin/app/views/account/login.rhtml +26 -0
- data/examples/al-admin/app/views/account/sign_up.rhtml +28 -0
- data/examples/al-admin/app/views/attributes/_attributes.rhtml +19 -0
- data/examples/al-admin/app/views/attributes/_detail.rhtml +29 -0
- data/examples/al-admin/app/views/attributes/index.rhtml +3 -0
- data/examples/al-admin/app/views/attributes/show.rhtml +31 -0
- data/examples/al-admin/app/views/directory/_tree.rhtml +10 -0
- data/examples/al-admin/app/views/directory/_tree_view_js.rhtml +26 -0
- data/examples/al-admin/app/views/directory/index.rhtml +13 -0
- data/examples/al-admin/app/views/directory/populate.rhtml +2 -0
- data/examples/al-admin/app/views/layouts/_flash_box.rhtml +4 -0
- data/examples/al-admin/app/views/layouts/_footer.rhtml +9 -0
- data/examples/al-admin/app/views/layouts/_header_menu.rhtml +10 -0
- data/examples/al-admin/app/views/layouts/_main_menu.rhtml +18 -0
- data/examples/al-admin/app/views/layouts/application.rhtml +56 -0
- data/examples/al-admin/app/views/object_classes/_attributes.rhtml +28 -0
- data/examples/al-admin/app/views/object_classes/_object_classes.rhtml +19 -0
- data/examples/al-admin/app/views/object_classes/index.rhtml +3 -0
- data/examples/al-admin/app/views/object_classes/show.rhtml +39 -0
- data/examples/al-admin/app/views/syntaxes/_detail.rhtml +14 -0
- data/examples/al-admin/app/views/syntaxes/_syntaxes.rhtml +19 -0
- data/examples/al-admin/app/views/syntaxes/index.rhtml +3 -0
- data/examples/al-admin/app/views/syntaxes/show.rhtml +22 -0
- data/examples/al-admin/app/views/users/_attributes_update_form.rhtml +30 -0
- data/examples/al-admin/app/views/users/_form.rhtml +13 -0
- data/examples/al-admin/app/views/users/_object_classes_update_form.rhtml +40 -0
- data/examples/al-admin/app/views/users/_password_change_form.rhtml +20 -0
- data/examples/al-admin/app/views/users/edit.rhtml +15 -0
- data/examples/al-admin/app/views/users/index.rhtml +10 -0
- data/examples/al-admin/app/views/users/show.rhtml +11 -0
- data/examples/al-admin/app/views/welcome/index.rhtml +13 -0
- data/examples/al-admin/config/boot.rb +45 -0
- data/examples/al-admin/config/database.yml.example +19 -0
- data/examples/al-admin/config/environment.rb +70 -0
- data/examples/al-admin/config/environments/development.rb +21 -0
- data/examples/al-admin/config/environments/production.rb +18 -0
- data/examples/al-admin/config/environments/test.rb +19 -0
- data/examples/al-admin/config/ldap.yml.example +21 -0
- data/examples/al-admin/config/routes.rb +46 -0
- data/examples/al-admin/db/migrate/001_create_users.rb +16 -0
- data/examples/al-admin/lib/accept_http_rails_relative_url_root.rb +9 -0
- data/examples/al-admin/lib/authenticated_system.rb +124 -0
- data/examples/al-admin/lib/authenticated_test_helper.rb +113 -0
- data/examples/al-admin/lib/tasks/gettext.rake +35 -0
- data/examples/al-admin/po/en/al-admin.po +341 -0
- data/examples/al-admin/po/ja/al-admin.po +341 -0
- data/examples/al-admin/po/nl/al-admin.po +373 -0
- data/examples/al-admin/public/.htaccess +40 -0
- data/examples/al-admin/public/404.html +30 -0
- data/examples/al-admin/public/500.html +30 -0
- data/examples/al-admin/public/dispatch.cgi +10 -0
- data/examples/al-admin/public/dispatch.fcgi +24 -0
- data/examples/al-admin/public/dispatch.rb +10 -0
- data/examples/al-admin/public/favicon.ico +0 -0
- data/examples/al-admin/public/images/active-ldap.svg +6351 -0
- data/examples/al-admin/public/images/al-admin.png +0 -0
- data/examples/al-admin/public/images/al-admin.svg +6371 -0
- data/examples/al-admin/public/images/header-background.png +0 -0
- data/examples/al-admin/public/images/header-background.svg +99 -0
- data/examples/al-admin/public/images/rails.png +0 -0
- data/examples/al-admin/public/images/spinelz/accordion_tab_left_active.gif +0 -0
- data/examples/al-admin/public/images/spinelz/accordion_tab_left_inactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/accordion_tab_middle_active.gif +0 -0
- data/examples/al-admin/public/images/spinelz/accordion_tab_middle_inactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/accordion_tab_right_active.gif +0 -0
- data/examples/al-admin/public/images/spinelz/accordion_tab_right_inactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_back.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_bottom_left.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_bottom_middle.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_bottom_right.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_left_down_arrow.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_left_up_arrow.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_middle_left.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_middle_right.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_right_down_arrow.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_right_up_arrow.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_top_left.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_top_middle.gif +0 -0
- data/examples/al-admin/public/images/spinelz/balloon_top_right.gif +0 -0
- data/examples/al-admin/public/images/spinelz/barchart_h.gif +0 -0
- data/examples/al-admin/public/images/spinelz/barchart_v.gif +0 -0
- data/examples/al-admin/public/images/spinelz/button.gif +0 -0
- data/examples/al-admin/public/images/spinelz/calendar_default_handler.gif +0 -0
- data/examples/al-admin/public/images/spinelz/calendar_delete.gif +0 -0
- data/examples/al-admin/public/images/spinelz/calendar_next.gif +0 -0
- data/examples/al-admin/public/images/spinelz/calendar_next_second.gif +0 -0
- data/examples/al-admin/public/images/spinelz/calendar_pre.gif +0 -0
- data/examples/al-admin/public/images/spinelz/calendar_pre_second.gif +0 -0
- data/examples/al-admin/public/images/spinelz/calendar_private_icon.gif +0 -0
- data/examples/al-admin/public/images/spinelz/calendar_schedule.gif +0 -0
- data/examples/al-admin/public/images/spinelz/calender_back.gif +0 -0
- data/examples/al-admin/public/images/spinelz/calender_back_second.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker2_back.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker2_back_second.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker2_next.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker2_next_second.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker2_pre.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker2_pre_second.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker_back.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker_back_second.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker_next.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker_next_second.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker_pre.gif +0 -0
- data/examples/al-admin/public/images/spinelz/datepicker_pre_second.gif +0 -0
- data/examples/al-admin/public/images/spinelz/grid_down.gif +0 -0
- data/examples/al-admin/public/images/spinelz/grid_state.gif +0 -0
- data/examples/al-admin/public/images/spinelz/grid_up.gif +0 -0
- data/examples/al-admin/public/images/spinelz/icon_day.gif +0 -0
- data/examples/al-admin/public/images/spinelz/icon_month.gif +0 -0
- data/examples/al-admin/public/images/spinelz/icon_week.gif +0 -0
- data/examples/al-admin/public/images/spinelz/menubar_back.gif +0 -0
- data/examples/al-admin/public/images/spinelz/menubar_subcontents_back.gif +0 -0
- data/examples/al-admin/public/images/spinelz/navPanel_tab_left_active.gif +0 -0
- data/examples/al-admin/public/images/spinelz/navPanel_tab_left_inactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/navPanel_tab_middle_active.gif +0 -0
- data/examples/al-admin/public/images/spinelz/navPanel_tab_middle_inactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/navPanel_tab_right_active.gif +0 -0
- data/examples/al-admin/public/images/spinelz/navPanel_tab_right_inactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/select_date.gif +0 -0
- data/examples/al-admin/public/images/spinelz/selectabletable_selected.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_about.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_menu.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_sample.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_tabBottomActive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_tabBottomInactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_tabMiddleActive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_tabMiddleActive2.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_tabMiddleInactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_tabMiddleInactive2.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_tabTopActive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_tabTopInactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sideBarBox_tabbar.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sortableTable_down.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sortableTable_normal.gif +0 -0
- data/examples/al-admin/public/images/spinelz/sortableTable_up.gif +0 -0
- data/examples/al-admin/public/images/spinelz/switcher_close.gif +0 -0
- data/examples/al-admin/public/images/spinelz/switcher_open.gif +0 -0
- data/examples/al-admin/public/images/spinelz/tabBox_close.gif +0 -0
- data/examples/al-admin/public/images/spinelz/tabBox_tabLeftActive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/tabBox_tabLeftInactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/tabBox_tabMiddleActive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/tabBox_tabMiddleInactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/tabBox_tabRightActive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/tabBox_tabRightInactive.gif +0 -0
- data/examples/al-admin/public/images/spinelz/tab_bar.gif +0 -0
- data/examples/al-admin/public/images/spinelz/table_back.gif +0 -0
- data/examples/al-admin/public/images/spinelz/timepicker_clock.gif +0 -0
- data/examples/al-admin/public/images/spinelz/toolbar_close.gif +0 -0
- data/examples/al-admin/public/images/spinelz/toolbar_left.gif +0 -0
- data/examples/al-admin/public/images/spinelz/toolbar_max.gif +0 -0
- data/examples/al-admin/public/images/spinelz/toolbar_middle.gif +0 -0
- data/examples/al-admin/public/images/spinelz/toolbar_min.gif +0 -0
- data/examples/al-admin/public/images/spinelz/toolbar_next.gif +0 -0
- data/examples/al-admin/public/images/spinelz/toolbar_right.gif +0 -0
- data/examples/al-admin/public/images/spinelz/treeview_dir.gif +0 -0
- data/examples/al-admin/public/images/spinelz/treeview_file.gif +0 -0
- data/examples/al-admin/public/images/spinelz/treeview_group.gif +0 -0
- data/examples/al-admin/public/images/spinelz/treeview_group_special.gif +0 -0
- data/examples/al-admin/public/images/spinelz/treeview_state.gif +0 -0
- data/examples/al-admin/public/images/spinelz/treeview_user.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_bottom_left.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_bottom_middle.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_bottom_right.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_close.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_max.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_middle_left.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_middle_right.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_min.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_top_left.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_top_middle.gif +0 -0
- data/examples/al-admin/public/images/spinelz/window_top_right.gif +0 -0
- data/examples/al-admin/public/javascripts/application.js +2 -0
- data/examples/al-admin/public/javascripts/controls.js +833 -0
- data/examples/al-admin/public/javascripts/dragdrop.js +942 -0
- data/examples/al-admin/public/javascripts/effects.js +1088 -0
- data/examples/al-admin/public/javascripts/prototype.js +2515 -0
- data/examples/al-admin/public/javascripts/spinelz/accordion.js +185 -0
- data/examples/al-admin/public/javascripts/spinelz/ajaxHistory.js +157 -0
- data/examples/al-admin/public/javascripts/spinelz/balloon.js +287 -0
- data/examples/al-admin/public/javascripts/spinelz/barchart.js +524 -0
- data/examples/al-admin/public/javascripts/spinelz/calendar.js +3012 -0
- data/examples/al-admin/public/javascripts/spinelz/colorpicker.js +128 -0
- data/examples/al-admin/public/javascripts/spinelz/datepicker.js +438 -0
- data/examples/al-admin/public/javascripts/spinelz/grid.js +1391 -0
- data/examples/al-admin/public/javascripts/spinelz/grid_resizeEx.js +100 -0
- data/examples/al-admin/public/javascripts/spinelz/grid_sortabletableEx.js +129 -0
- data/examples/al-admin/public/javascripts/spinelz/inplaceEditorEx.js +148 -0
- data/examples/al-admin/public/javascripts/spinelz/menubar.js +232 -0
- data/examples/al-admin/public/javascripts/spinelz/navPanel.js +170 -0
- data/examples/al-admin/public/javascripts/spinelz/selectableTable.js +433 -0
- data/examples/al-admin/public/javascripts/spinelz/sideBarBox.js +282 -0
- data/examples/al-admin/public/javascripts/spinelz/sideBarBox_effects.js +83 -0
- data/examples/al-admin/public/javascripts/spinelz/sortableTable.js +270 -0
- data/examples/al-admin/public/javascripts/spinelz/switcher.js +78 -0
- data/examples/al-admin/public/javascripts/spinelz/tabBox.js +469 -0
- data/examples/al-admin/public/javascripts/spinelz/timepicker.js +384 -0
- data/examples/al-admin/public/javascripts/spinelz/toolbar.js +152 -0
- data/examples/al-admin/public/javascripts/spinelz/treeview.js +703 -0
- data/examples/al-admin/public/javascripts/spinelz/window.js +641 -0
- data/examples/al-admin/public/javascripts/spinelz/window_resizeEx.js +130 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/builder.js +131 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/controls.js +835 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/dragdrop.js +944 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/effects.js +1090 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/json.js +139 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/prototype.js +2515 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/resize.js +215 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/scriptaculous.js +51 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/slider.js +278 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/spinelz_util.js +1266 -0
- data/examples/al-admin/public/javascripts/spinelz_lib/unittest.js +564 -0
- data/examples/al-admin/public/robots.txt +1 -0
- data/examples/al-admin/public/stylesheets/account.css +41 -0
- data/examples/al-admin/public/stylesheets/attributes.css +1 -0
- data/examples/al-admin/public/stylesheets/base.css +99 -0
- data/examples/al-admin/public/stylesheets/common.css +2 -0
- data/examples/al-admin/public/stylesheets/detail.css +36 -0
- data/examples/al-admin/public/stylesheets/directory.css +22 -0
- data/examples/al-admin/public/stylesheets/object-classes.css +6 -0
- data/examples/al-admin/public/stylesheets/rails.css +35 -0
- data/examples/al-admin/public/stylesheets/spinelz/accordion.css +59 -0
- data/examples/al-admin/public/stylesheets/spinelz/balloon.css +151 -0
- data/examples/al-admin/public/stylesheets/spinelz/calendar.css +564 -0
- data/examples/al-admin/public/stylesheets/spinelz/datepicker.css +175 -0
- data/examples/al-admin/public/stylesheets/spinelz/grid.css +137 -0
- data/examples/al-admin/public/stylesheets/spinelz/menubar.css +78 -0
- data/examples/al-admin/public/stylesheets/spinelz/modal.css +22 -0
- data/examples/al-admin/public/stylesheets/spinelz/navPanel.css +58 -0
- data/examples/al-admin/public/stylesheets/spinelz/selectableTable.css +28 -0
- data/examples/al-admin/public/stylesheets/spinelz/sideBarBox.css +82 -0
- data/examples/al-admin/public/stylesheets/spinelz/sortableTable.css +51 -0
- data/examples/al-admin/public/stylesheets/spinelz/switcher.css +23 -0
- data/examples/al-admin/public/stylesheets/spinelz/tabBox.css +94 -0
- data/examples/al-admin/public/stylesheets/spinelz/timepicker.css +508 -0
- data/examples/al-admin/public/stylesheets/spinelz/toolbar.css +82 -0
- data/examples/al-admin/public/stylesheets/spinelz/treeview.css +121 -0
- data/examples/al-admin/public/stylesheets/spinelz/window.css +140 -0
- data/examples/al-admin/public/stylesheets/structure.css +81 -0
- data/examples/al-admin/public/stylesheets/syntaxes.css +1 -0
- data/examples/al-admin/public/stylesheets/users.css +13 -0
- data/examples/al-admin/public/stylesheets/welcome.css +0 -0
- data/examples/al-admin/script/about +3 -0
- data/examples/al-admin/script/breakpointer +3 -0
- data/examples/al-admin/script/console +3 -0
- data/examples/al-admin/script/destroy +3 -0
- data/examples/al-admin/script/generate +3 -0
- data/examples/al-admin/script/performance/benchmarker +3 -0
- data/examples/al-admin/script/performance/profiler +3 -0
- data/examples/al-admin/script/plugin +3 -0
- data/examples/al-admin/script/process/inspector +3 -0
- data/examples/al-admin/script/process/reaper +3 -0
- data/examples/al-admin/script/process/spawner +3 -0
- data/examples/al-admin/script/runner +3 -0
- data/examples/al-admin/script/server +3 -0
- data/examples/al-admin/test/fixtures/users.yml +9 -0
- data/examples/al-admin/test/functional/account_controller_test.rb +24 -0
- data/examples/al-admin/test/functional/attributes_controller_test.rb +18 -0
- data/examples/al-admin/test/functional/directory_controller_test.rb +18 -0
- data/examples/al-admin/test/functional/object_classes_controller_test.rb +18 -0
- data/examples/al-admin/test/functional/syntaxes_controller_test.rb +18 -0
- data/examples/al-admin/test/functional/users_controller_test.rb +18 -0
- data/examples/al-admin/test/functional/welcome_controller_test.rb +18 -0
- data/examples/al-admin/test/run-test.sh +3 -0
- data/examples/al-admin/test/test_helper.rb +28 -0
- data/examples/al-admin/test/unit/user_test.rb +13 -0
- data/examples/al-admin/vendor/plugins/exception_notification/README +111 -0
- data/examples/al-admin/vendor/plugins/exception_notification/init.rb +1 -0
- data/examples/al-admin/vendor/plugins/exception_notification/lib/exception_notifiable.rb +99 -0
- data/examples/al-admin/vendor/plugins/exception_notification/lib/exception_notifier.rb +67 -0
- data/examples/al-admin/vendor/plugins/exception_notification/lib/exception_notifier_helper.rb +77 -0
- data/examples/al-admin/vendor/plugins/exception_notification/test/exception_notifier_helper_test.rb +61 -0
- data/examples/al-admin/vendor/plugins/exception_notification/test/test_helper.rb +7 -0
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_backtrace.rhtml +1 -0
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_environment.rhtml +7 -0
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_inspect_model.rhtml +16 -0
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_request.rhtml +3 -0
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_session.rhtml +2 -0
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_title.rhtml +3 -0
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/exception_notification.rhtml +6 -0
- data/examples/config.yaml.example +5 -0
- data/examples/example.der +0 -0
- data/examples/example.jpg +0 -0
- data/examples/groupadd +41 -0
- data/examples/groupdel +35 -0
- data/examples/groupls +49 -0
- data/examples/groupmod +42 -0
- data/examples/lpasswd +55 -0
- data/examples/objects/group.rb +13 -0
- data/examples/objects/ou.rb +4 -0
- data/examples/objects/user.rb +20 -0
- data/examples/ouadd +38 -0
- data/examples/useradd +45 -0
- data/examples/useradd-binary +50 -0
- data/examples/userdel +34 -0
- data/examples/userls +50 -0
- data/examples/usermod +42 -0
- data/examples/usermod-binary-add +47 -0
- data/examples/usermod-binary-add-time +51 -0
- data/examples/usermod-binary-del +48 -0
- data/examples/usermod-lang-add +43 -0
- data/lib/active_ldap/acts/tree.rb +75 -0
- data/lib/active_ldap/adapter/base.rb +531 -0
- data/lib/active_ldap/adapter/ldap.rb +231 -0
- data/lib/active_ldap/adapter/ldap_ext.rb +69 -0
- data/lib/active_ldap/adapter/net_ldap.rb +292 -0
- data/lib/active_ldap/adapter/net_ldap_ext.rb +29 -0
- data/lib/active_ldap/association/belongs_to.rb +47 -0
- data/lib/active_ldap/association/belongs_to_many.rb +42 -0
- data/lib/active_ldap/association/children.rb +21 -0
- data/lib/active_ldap/association/collection.rb +83 -0
- data/lib/active_ldap/association/has_many.rb +31 -0
- data/lib/active_ldap/association/has_many_utils.rb +35 -0
- data/lib/active_ldap/association/has_many_wrap.rb +46 -0
- data/lib/active_ldap/association/proxy.rb +102 -0
- data/lib/active_ldap/associations.rb +172 -0
- data/lib/active_ldap/attributes.rb +211 -0
- data/lib/active_ldap/base.rb +1273 -0
- data/lib/active_ldap/callbacks.rb +19 -0
- data/lib/active_ldap/command.rb +49 -0
- data/lib/active_ldap/configuration.rb +147 -0
- data/lib/active_ldap/connection.rb +237 -0
- data/lib/active_ldap/distinguished_name.rb +251 -0
- data/lib/active_ldap/escape.rb +12 -0
- data/lib/active_ldap/get_text/parser.rb +159 -0
- data/lib/active_ldap/get_text.rb +8 -0
- data/lib/active_ldap/get_text_fallback.rb +53 -0
- data/lib/active_ldap/get_text_support.rb +26 -0
- data/lib/active_ldap/helper.rb +33 -0
- data/lib/active_ldap/human_readable.rb +112 -0
- data/lib/active_ldap/ldap_error.rb +74 -0
- data/lib/active_ldap/ldif.rb +52 -0
- data/lib/active_ldap/object_class.rb +93 -0
- data/lib/active_ldap/operations.rb +429 -0
- data/lib/active_ldap/populate.rb +44 -0
- data/lib/active_ldap/schema/syntaxes.rb +386 -0
- data/lib/active_ldap/schema.rb +530 -0
- data/lib/active_ldap/timeout.rb +75 -0
- data/lib/active_ldap/timeout_stub.rb +17 -0
- data/lib/active_ldap/user_password.rb +93 -0
- data/lib/active_ldap/validations.rb +171 -0
- data/lib/active_ldap.rb +982 -0
- data/po/en/active-ldap.po +3677 -0
- data/po/ja/active-ldap.po +3713 -0
- data/rails/plugin/active_ldap/README +54 -0
- data/rails/plugin/active_ldap/generators/model_active_ldap/USAGE +17 -0
- data/rails/plugin/active_ldap/generators/model_active_ldap/model_active_ldap_generator.rb +70 -0
- data/rails/plugin/active_ldap/generators/model_active_ldap/templates/fixtures.yml +11 -0
- data/rails/plugin/active_ldap/generators/model_active_ldap/templates/model_active_ldap.rb +3 -0
- data/rails/plugin/active_ldap/generators/model_active_ldap/templates/unit_test.rb +10 -0
- data/rails/plugin/active_ldap/generators/scaffold_active_ldap/scaffold_active_ldap_generator.rb +7 -0
- data/rails/plugin/active_ldap/generators/scaffold_al/scaffold_al_generator.rb +20 -0
- data/rails/plugin/active_ldap/init.rb +26 -0
- data/test/al-test-utils.rb +362 -0
- data/test/command.rb +62 -0
- data/test/config.yaml.sample +6 -0
- data/test/run-test.rb +31 -0
- data/test/test-unit-ext/always-show-result.rb +28 -0
- data/test/test-unit-ext/backtrace-filter.rb +17 -0
- data/test/test-unit-ext/long-display-for-emacs.rb +25 -0
- data/test/test-unit-ext/priority.rb +163 -0
- data/test/test-unit-ext.rb +4 -0
- data/test/test_acts_as_tree.rb +57 -0
- data/test/test_adapter.rb +98 -0
- data/test/test_associations.rb +353 -0
- data/test/test_attributes.rb +79 -0
- data/test/test_base.rb +547 -0
- data/test/test_base_per_instance.rb +55 -0
- data/test/test_bind.rb +62 -0
- data/test/test_callback.rb +35 -0
- data/test/test_configuration.rb +40 -0
- data/test/test_connection.rb +59 -0
- data/test/test_connection_per_class.rb +58 -0
- data/test/test_connection_per_dn.rb +78 -0
- data/test/test_dn.rb +160 -0
- data/test/test_find.rb +96 -0
- data/test/test_groupadd.rb +50 -0
- data/test/test_groupdel.rb +46 -0
- data/test/test_groupls.rb +107 -0
- data/test/test_groupmod.rb +51 -0
- data/test/test_ldif.rb +35 -0
- data/test/test_lpasswd.rb +75 -0
- data/test/test_object_class.rb +56 -0
- data/test/test_reflection.rb +179 -0
- data/test/test_schema.rb +433 -0
- data/test/test_syntax.rb +329 -0
- data/test/test_user.rb +227 -0
- data/test/test_user_password.rb +93 -0
- data/test/test_useradd-binary.rb +61 -0
- data/test/test_useradd.rb +57 -0
- data/test/test_userdel.rb +48 -0
- data/test/test_userls.rb +91 -0
- data/test/test_usermod-binary-add-time.rb +64 -0
- data/test/test_usermod-binary-add.rb +63 -0
- data/test/test_usermod-binary-del.rb +66 -0
- data/test/test_usermod-lang-add.rb +59 -0
- data/test/test_usermod.rb +58 -0
- data/test/test_validation.rb +110 -0
- metadata +536 -0
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'al-test-utils'
|
2
|
+
|
3
|
+
class TestUseraddBinary < Test::Unit::TestCase
|
4
|
+
include AlTestUtils
|
5
|
+
|
6
|
+
def setup
|
7
|
+
super
|
8
|
+
@command = File.join(@examples_dir, "useradd-binary")
|
9
|
+
make_ou("People")
|
10
|
+
@user_class.instance_variable_set("@prefix", "ou=People")
|
11
|
+
end
|
12
|
+
|
13
|
+
priority :must
|
14
|
+
|
15
|
+
priority :normal
|
16
|
+
def test_exist_user
|
17
|
+
make_temporary_user do |user, password|
|
18
|
+
assert(@user_class.exists?(user.uid))
|
19
|
+
assert_equal([false, "User #{user.uid} already exists.\n"],
|
20
|
+
run_command(user.uid, user.cn, user.uid_number))
|
21
|
+
assert(@user_class.exists?(user.uid))
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_add_user
|
26
|
+
ensure_delete_user("test-user") do |uid,|
|
27
|
+
assert_useradd_binary_successfully(uid, uid, 10000)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
def assert_useradd_binary_successfully(name, cn, uid, *args, &block)
|
33
|
+
_wrap_assertion do
|
34
|
+
assert(!@user_class.exists?(name))
|
35
|
+
args.concat([name, cn, uid])
|
36
|
+
assert_equal([true, ""], run_command(*args, &block))
|
37
|
+
assert(@user_class.exists?(name))
|
38
|
+
|
39
|
+
user = @user_class.find(name)
|
40
|
+
assert_equal(name, user.uid)
|
41
|
+
assert_equal(cn, user.cn)
|
42
|
+
assert_equal(uid.to_i, user.uid_number)
|
43
|
+
assert_equal(uid.to_i, user.gid_number)
|
44
|
+
assert_equal(uid.to_s, user.uid_number_before_type_cast)
|
45
|
+
assert_equal(uid.to_s, user.gid_number_before_type_cast)
|
46
|
+
assert_equal(['person', 'posixAccount', 'shadowAccount',
|
47
|
+
'strongAuthenticationUser'].sort, user.classes.sort)
|
48
|
+
cert = File.read(File.join(@examples_dir, 'example.der'))
|
49
|
+
assert_equal({"binary" => cert}, user.user_certificate)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def assert_useradd_binary_failed(name, cn, uid, message, *args, &block)
|
54
|
+
_wrap_assertion do
|
55
|
+
assert(!@user_class.exists?(name))
|
56
|
+
args.concat([name, cn, uid])
|
57
|
+
assert_equal([false, message], run_command(*args, &block))
|
58
|
+
assert(!@user_class.exists?(name))
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'al-test-utils'
|
2
|
+
|
3
|
+
class TestUseradd < Test::Unit::TestCase
|
4
|
+
include AlTestUtils
|
5
|
+
|
6
|
+
def setup
|
7
|
+
super
|
8
|
+
@command = File.join(@examples_dir, "useradd")
|
9
|
+
make_ou("People")
|
10
|
+
@user_class.instance_variable_set("@prefix", "ou=People")
|
11
|
+
end
|
12
|
+
|
13
|
+
priority :must
|
14
|
+
|
15
|
+
priority :normal
|
16
|
+
def test_exist_user
|
17
|
+
make_temporary_user do |user, password|
|
18
|
+
assert(@user_class.exists?(user.uid))
|
19
|
+
assert_equal([false, "User #{user.uid} already exists.\n"],
|
20
|
+
run_command(user.uid, user.cn, user.uid_number))
|
21
|
+
assert(@user_class.exists?(user.uid))
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_add_user
|
26
|
+
ensure_delete_user("test-user") do |uid,|
|
27
|
+
assert_useradd_successfully(uid, uid, 10000)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
def assert_useradd_successfully(name, cn, uid, *args, &block)
|
33
|
+
_wrap_assertion do
|
34
|
+
assert(!@user_class.exists?(name))
|
35
|
+
args.concat([name, cn, uid])
|
36
|
+
assert_equal([true, ""], run_command(*args, &block))
|
37
|
+
assert(@user_class.exists?(name))
|
38
|
+
|
39
|
+
user = @user_class.find(name)
|
40
|
+
assert_equal(name, user.uid)
|
41
|
+
assert_equal(cn, user.cn)
|
42
|
+
assert_equal(uid.to_i, user.uid_number)
|
43
|
+
assert_equal(uid.to_i, user.gid_number)
|
44
|
+
assert_equal(uid.to_s, user.uid_number_before_type_cast)
|
45
|
+
assert_equal(uid.to_s, user.gid_number_before_type_cast)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def assert_useradd_failed(name, cn, uid, message, *args, &block)
|
50
|
+
_wrap_assertion do
|
51
|
+
assert(!@user_class.exists?(name))
|
52
|
+
args.concat([name, cn, uid])
|
53
|
+
assert_equal([false, message], run_command(*args, &block))
|
54
|
+
assert(!@user_class.exists?(name))
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'al-test-utils'
|
2
|
+
|
3
|
+
class TestUserdel < Test::Unit::TestCase
|
4
|
+
include AlTestUtils
|
5
|
+
|
6
|
+
def setup
|
7
|
+
super
|
8
|
+
@command = File.join(@examples_dir, "userdel")
|
9
|
+
make_ou("People")
|
10
|
+
@user_class.instance_variable_set("@prefix", "ou=People")
|
11
|
+
end
|
12
|
+
|
13
|
+
priority :must
|
14
|
+
|
15
|
+
priority :normal
|
16
|
+
def test_non_exist_user
|
17
|
+
ensure_delete_user("test-user") do |uid,|
|
18
|
+
assert(!@user_class.exists?(uid))
|
19
|
+
assert_equal([false, "User #{uid} doesn't exist.\n"], run_command(uid))
|
20
|
+
assert(!@user_class.exists?(uid))
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_delete_user
|
25
|
+
make_temporary_user do |user, password|
|
26
|
+
assert_userdel_successfully(user.uid)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
def assert_userdel_successfully(name, *args, &block)
|
32
|
+
_wrap_assertion do
|
33
|
+
assert(@user_class.exists?(name))
|
34
|
+
args.concat([name])
|
35
|
+
assert_equal([true, ""], run_command(*args, &block))
|
36
|
+
assert(!@user_class.exists?(name))
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def assert_userdel_failed(name, message, *args, &block)
|
41
|
+
_wrap_assertion do
|
42
|
+
assert(@user_class.exists?(name))
|
43
|
+
args.concat([name])
|
44
|
+
assert_equal([false, message], run_command(*args, &block))
|
45
|
+
assert(@user_class.exists?(name))
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/test/test_userls.rb
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
require 'al-test-utils'
|
2
|
+
|
3
|
+
class TestUserls < Test::Unit::TestCase
|
4
|
+
include AlTestUtils
|
5
|
+
|
6
|
+
def setup
|
7
|
+
super
|
8
|
+
@command = File.join(@examples_dir, "userls")
|
9
|
+
make_ou("People")
|
10
|
+
@user_class.instance_variable_set("@prefix", "ou=People")
|
11
|
+
end
|
12
|
+
|
13
|
+
priority :must
|
14
|
+
|
15
|
+
priority :normal
|
16
|
+
def test_non_exist_user
|
17
|
+
ensure_delete_user("test-user") do |uid,|
|
18
|
+
assert(!@user_class.exists?(uid))
|
19
|
+
assert_equal([false, "User #{uid} doesn't exist.\n"], run_command(uid))
|
20
|
+
assert(!@user_class.exists?(uid))
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_list_user_no_group
|
25
|
+
make_temporary_user do |user, password|
|
26
|
+
assert_userls_successfully(user.uid, [], [])
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_list_user_have_primary_group
|
31
|
+
make_temporary_group do |group|
|
32
|
+
make_temporary_user(:gid_number => group.gid_number) do |user, password|
|
33
|
+
assert_userls_successfully(user.uid, [group], [])
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_list_user_have_groups
|
39
|
+
make_temporary_group do |group1|
|
40
|
+
make_temporary_group do |group2|
|
41
|
+
options = {:gid_number => group2.gid_number.succ}
|
42
|
+
make_temporary_user(options) do |user, password|
|
43
|
+
user.groups << group1
|
44
|
+
user.groups << group2
|
45
|
+
assert_userls_successfully(user.uid, [], [group1, group2])
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_list_user_have_groups_and_primary_group
|
52
|
+
make_temporary_group do |group1|
|
53
|
+
make_temporary_user(:gid_number => group1.gid_number) do |user, password|
|
54
|
+
make_temporary_group do |group2|
|
55
|
+
make_temporary_group do |group3|
|
56
|
+
user.groups << group2
|
57
|
+
user.groups << group3
|
58
|
+
assert_userls_successfully(user.uid, [group1], [group2, group3])
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
private
|
66
|
+
def assert_userls_successfully(name, primary_groups, groups, *args, &block)
|
67
|
+
_wrap_assertion do
|
68
|
+
assert(@user_class.exists?(name))
|
69
|
+
args.concat([name])
|
70
|
+
user = @user_class.find(name)
|
71
|
+
group_names = groups.collect {|g| "#{g.cn}"}
|
72
|
+
group_infos = (primary_groups + groups).collect do |g|
|
73
|
+
"#{g.cn}[#{g.gid_number}]"
|
74
|
+
end
|
75
|
+
result = user.to_ldif
|
76
|
+
result << "Groups by name only: #{group_names.join(', ')}\n"
|
77
|
+
result << "Groups: #{group_infos.join(', ')}\n"
|
78
|
+
assert_equal([true, result], run_command(*args, &block))
|
79
|
+
assert(@user_class.exists?(name))
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
def assert_userls_failed(name, message, *args, &block)
|
84
|
+
_wrap_assertion do
|
85
|
+
assert(@user_class.exists?(name))
|
86
|
+
args.concat([name])
|
87
|
+
assert_equal([false, message], run_command(*args, &block))
|
88
|
+
assert(@user_class.exists?(name))
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'al-test-utils'
|
2
|
+
|
3
|
+
class TestUsermodBinaryAddTime < Test::Unit::TestCase
|
4
|
+
include AlTestUtils
|
5
|
+
|
6
|
+
def setup
|
7
|
+
super
|
8
|
+
@command = File.join(@examples_dir, "usermod-binary-add-time")
|
9
|
+
make_ou("People")
|
10
|
+
@user_class.instance_variable_set("@prefix", "ou=People")
|
11
|
+
end
|
12
|
+
|
13
|
+
priority :must
|
14
|
+
|
15
|
+
priority :normal
|
16
|
+
def test_non_exist_user
|
17
|
+
ensure_delete_user("test-user") do |uid,|
|
18
|
+
assert(!@user_class.exists?(uid))
|
19
|
+
assert_equal([false, "User #{uid} doesn't exist.\n"],
|
20
|
+
run_command(uid, "New CN", 11111))
|
21
|
+
assert(!@user_class.exists?(uid))
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_modify_user
|
26
|
+
make_temporary_user do |user, password|
|
27
|
+
assert_usermod_binary_add_time_successfully(user.uid, "New #{user.cn}",
|
28
|
+
user.uid_number.to_i + 100)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
def assert_usermod_binary_add_time_successfully(name, cn, uid, *args, &block)
|
34
|
+
_wrap_assertion do
|
35
|
+
assert(@user_class.exists?(name))
|
36
|
+
previous_classes = @user_class.find(name).classes
|
37
|
+
args.concat([name, cn, uid])
|
38
|
+
assert_equal([true, ""], run_command(*args, &block))
|
39
|
+
assert(@user_class.exists?(name))
|
40
|
+
|
41
|
+
user = @user_class.find(name)
|
42
|
+
assert_equal(name, user.uid)
|
43
|
+
assert_equal(cn, user.cn)
|
44
|
+
assert_equal(uid.to_i, user.uid_number)
|
45
|
+
assert_equal(uid.to_i, user.gid_number)
|
46
|
+
assert_equal(uid.to_s, user.uid_number_before_type_cast)
|
47
|
+
assert_equal(uid.to_s, user.gid_number_before_type_cast)
|
48
|
+
assert_equal((previous_classes + ['strongAuthenticationUser']).sort,
|
49
|
+
user.classes.sort)
|
50
|
+
cert = File.read(File.join(@examples_dir, 'example.der'))
|
51
|
+
assert_equal({"binary" => cert}, user.user_certificate)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def assert_usermod_binary_add_time_failed(name, cn, uid, message,
|
56
|
+
*args, &block)
|
57
|
+
_wrap_assertion do
|
58
|
+
assert(@user_class.exists?(name))
|
59
|
+
args.concat([name, cn, uid])
|
60
|
+
assert_equal([false, message], run_command(*args, &block))
|
61
|
+
assert(@user_class.exists?(name))
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'al-test-utils'
|
2
|
+
|
3
|
+
class TestUsermodBinaryAdd < Test::Unit::TestCase
|
4
|
+
include AlTestUtils
|
5
|
+
|
6
|
+
def setup
|
7
|
+
super
|
8
|
+
@command = File.join(@examples_dir, "usermod-binary-add")
|
9
|
+
make_ou("People")
|
10
|
+
@user_class.instance_variable_set("@prefix", "ou=People")
|
11
|
+
end
|
12
|
+
|
13
|
+
priority :must
|
14
|
+
|
15
|
+
priority :normal
|
16
|
+
def test_non_exist_user
|
17
|
+
ensure_delete_user("test-user") do |uid,|
|
18
|
+
assert(!@user_class.exists?(uid))
|
19
|
+
assert_equal([false, "User #{uid} doesn't exist.\n"],
|
20
|
+
run_command(uid, "New CN", 11111))
|
21
|
+
assert(!@user_class.exists?(uid))
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_modify_user
|
26
|
+
make_temporary_user do |user, password|
|
27
|
+
assert_usermod_binary_add_successfully(user.uid, "New #{user.cn}",
|
28
|
+
user.uid_number.to_i + 100)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
def assert_usermod_binary_add_successfully(name, cn, uid, *args, &block)
|
34
|
+
_wrap_assertion do
|
35
|
+
assert(@user_class.exists?(name))
|
36
|
+
previous_classes = @user_class.find(name).classes
|
37
|
+
args.concat([name, cn, uid])
|
38
|
+
assert_equal([true, ""], run_command(*args, &block))
|
39
|
+
assert(@user_class.exists?(name))
|
40
|
+
|
41
|
+
user = @user_class.find(name)
|
42
|
+
assert_equal(name, user.uid)
|
43
|
+
assert_equal(cn, user.cn)
|
44
|
+
assert_equal(uid.to_i, user.uid_number)
|
45
|
+
assert_equal(uid.to_i, user.gid_number)
|
46
|
+
assert_equal(uid.to_s, user.uid_number_before_type_cast)
|
47
|
+
assert_equal(uid.to_s, user.gid_number_before_type_cast)
|
48
|
+
assert_equal((previous_classes + ['strongAuthenticationUser']).sort,
|
49
|
+
user.classes.sort)
|
50
|
+
cert = File.read(File.join(@examples_dir, 'example.der'))
|
51
|
+
assert_equal({"binary" => cert}, user.user_certificate)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def assert_usermod_binary_add_failed(name, cn, uid, message, *args, &block)
|
56
|
+
_wrap_assertion do
|
57
|
+
assert(@user_class.exists?(name))
|
58
|
+
args.concat([name, cn, uid])
|
59
|
+
assert_equal([false, message], run_command(*args, &block))
|
60
|
+
assert(@user_class.exists?(name))
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'al-test-utils'
|
2
|
+
|
3
|
+
class TestUsermodBinaryDel < Test::Unit::TestCase
|
4
|
+
include AlTestUtils
|
5
|
+
|
6
|
+
def setup
|
7
|
+
super
|
8
|
+
@command = File.join(@examples_dir, "usermod-binary-del")
|
9
|
+
make_ou("People")
|
10
|
+
@user_class.instance_variable_set("@prefix", "ou=People")
|
11
|
+
end
|
12
|
+
|
13
|
+
priority :must
|
14
|
+
|
15
|
+
priority :normal
|
16
|
+
def test_non_exist_user
|
17
|
+
ensure_delete_user("test-user") do |uid,|
|
18
|
+
assert(!@user_class.exists?(uid))
|
19
|
+
assert_equal([false, "User #{uid} doesn't exist.\n"],
|
20
|
+
run_command(uid, "New CN", 11111))
|
21
|
+
assert(!@user_class.exists?(uid))
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_modify_user
|
26
|
+
make_temporary_user(:simple => true) do |user, password|
|
27
|
+
user.add_class("strongAuthenticationUser")
|
28
|
+
user.user_certificate = certificate
|
29
|
+
assert(user.save)
|
30
|
+
assert_usermod_binary_del_successfully(user.uid, "New #{user.cn}",
|
31
|
+
user.uid_number.to_i + 100)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
def assert_usermod_binary_del_successfully(name, cn, uid, *args, &block)
|
37
|
+
_wrap_assertion do
|
38
|
+
assert(@user_class.exists?(name))
|
39
|
+
previous_classes = @user_class.find(name).classes
|
40
|
+
assert_operator(previous_classes, :include?, "strongAuthenticationUser")
|
41
|
+
args.concat([name, cn, uid])
|
42
|
+
assert_equal([true, ""], run_command(*args, &block))
|
43
|
+
assert(@user_class.exists?(name))
|
44
|
+
|
45
|
+
user = @user_class.find(name)
|
46
|
+
assert_equal(name, user.uid)
|
47
|
+
assert_equal(cn, user.cn)
|
48
|
+
assert_equal(uid.to_i, user.uid_number)
|
49
|
+
assert_equal(uid.to_i, user.gid_number)
|
50
|
+
assert_equal(uid.to_s, user.uid_number_before_type_cast)
|
51
|
+
assert_equal(uid.to_s, user.gid_number_before_type_cast)
|
52
|
+
assert_equal((previous_classes - ['strongAuthenticationUser']).sort,
|
53
|
+
user.classes.sort)
|
54
|
+
assert(!user.respond_to?(:user_certificate))
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def assert_usermod_binary_del_failed(name, cn, uid, message, *args, &block)
|
59
|
+
_wrap_assertion do
|
60
|
+
assert(@user_class.exists?(name))
|
61
|
+
args.concat([name, cn, uid])
|
62
|
+
assert_equal([false, message], run_command(*args, &block))
|
63
|
+
assert(@user_class.exists?(name))
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'al-test-utils'
|
2
|
+
|
3
|
+
class TestUsermodLangAdd < Test::Unit::TestCase
|
4
|
+
include AlTestUtils
|
5
|
+
|
6
|
+
def setup
|
7
|
+
super
|
8
|
+
@command = File.join(@examples_dir, "usermod-lang-add")
|
9
|
+
make_ou("People")
|
10
|
+
@user_class.instance_variable_set("@prefix", "ou=People")
|
11
|
+
end
|
12
|
+
|
13
|
+
priority :must
|
14
|
+
|
15
|
+
priority :normal
|
16
|
+
def test_non_exist_user
|
17
|
+
ensure_delete_user("test-user") do |uid,|
|
18
|
+
assert(!@user_class.exists?(uid))
|
19
|
+
assert_equal([false, "User #{uid} doesn't exist.\n"],
|
20
|
+
run_command(uid, "New CN", 11111))
|
21
|
+
assert(!@user_class.exists?(uid))
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_modify_user
|
26
|
+
make_temporary_user do |user, password|
|
27
|
+
assert_usermod_lang_add_successfully(user.uid, "New #{user.cn}",
|
28
|
+
user.uid_number.to_i + 100)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
def assert_usermod_lang_add_successfully(name, cn, uid, *args, &block)
|
34
|
+
_wrap_assertion do
|
35
|
+
assert(@user_class.exists?(name))
|
36
|
+
previous_classes = @user_class.find(name).classes
|
37
|
+
args.concat([name, cn, uid])
|
38
|
+
assert_equal([true, ""], run_command(*args, &block))
|
39
|
+
assert(@user_class.exists?(name))
|
40
|
+
|
41
|
+
user = @user_class.find(name)
|
42
|
+
assert_equal(name, user.uid)
|
43
|
+
assert_equal([cn, {'lang-en-us' => cn}], user.cn)
|
44
|
+
assert_equal(uid.to_i, user.uid_number)
|
45
|
+
assert_equal(uid.to_i, user.gid_number)
|
46
|
+
assert_equal(uid.to_s, user.uid_number_before_type_cast)
|
47
|
+
assert_equal(uid.to_s, user.gid_number_before_type_cast)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def assert_usermod_lang_add_failed(name, cn, uid, message, *args, &block)
|
52
|
+
_wrap_assertion do
|
53
|
+
assert(@user_class.exists?(name))
|
54
|
+
args.concat([name, cn, uid])
|
55
|
+
assert_equal([false, message], run_command(*args, &block))
|
56
|
+
assert(@user_class.exists?(name))
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'al-test-utils'
|
2
|
+
|
3
|
+
class TestUsermod < Test::Unit::TestCase
|
4
|
+
include AlTestUtils
|
5
|
+
|
6
|
+
def setup
|
7
|
+
super
|
8
|
+
@command = File.join(@examples_dir, "usermod")
|
9
|
+
make_ou("People")
|
10
|
+
@user_class.instance_variable_set("@prefix", "ou=People")
|
11
|
+
end
|
12
|
+
|
13
|
+
priority :must
|
14
|
+
|
15
|
+
priority :normal
|
16
|
+
def test_non_exist_user
|
17
|
+
ensure_delete_user("test-user") do |uid,|
|
18
|
+
assert(!@user_class.exists?(uid))
|
19
|
+
assert_equal([false, "User #{uid} doesn't exist.\n"],
|
20
|
+
run_command(uid, "New CN", 11111))
|
21
|
+
assert(!@user_class.exists?(uid))
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_modify_user
|
26
|
+
make_temporary_user do |user, password|
|
27
|
+
assert_usermod_successfully(user.uid, "New #{user.cn}",
|
28
|
+
user.uid_number.to_i + 100)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
def assert_usermod_successfully(name, cn, uid, *args, &block)
|
34
|
+
_wrap_assertion do
|
35
|
+
assert(@user_class.exists?(name))
|
36
|
+
args.concat([name, cn, uid])
|
37
|
+
assert_equal([true, ""], run_command(*args, &block))
|
38
|
+
assert(@user_class.exists?(name))
|
39
|
+
|
40
|
+
user = @user_class.find(name)
|
41
|
+
assert_equal(name, user.uid)
|
42
|
+
assert_equal(cn, user.cn)
|
43
|
+
assert_equal(uid.to_i, user.uid_number)
|
44
|
+
assert_equal(uid.to_i, user.gid_number)
|
45
|
+
assert_equal(uid.to_s, user.uid_number_before_type_cast)
|
46
|
+
assert_equal(uid.to_s, user.gid_number_before_type_cast)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def assert_usermod_failed(name, cn, uid, message, *args, &block)
|
51
|
+
_wrap_assertion do
|
52
|
+
assert(@user_class.exists?(name))
|
53
|
+
args.concat([name, cn, uid])
|
54
|
+
assert_equal([false, message], run_command(*args, &block))
|
55
|
+
assert(@user_class.exists?(name))
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,110 @@
|
|
1
|
+
require 'al-test-utils'
|
2
|
+
|
3
|
+
class TestValidation < Test::Unit::TestCase
|
4
|
+
include AlTestUtils
|
5
|
+
include ActiveLdap::Helper
|
6
|
+
|
7
|
+
priority :must
|
8
|
+
def test_syntax_validation
|
9
|
+
make_temporary_user do |user, password|
|
10
|
+
assert(user.save)
|
11
|
+
|
12
|
+
user.see_also = "cn=test,dc=example,dc=com"
|
13
|
+
assert(user.save)
|
14
|
+
end
|
15
|
+
|
16
|
+
assert_invalid_see_also_value("test", "test")
|
17
|
+
assert_invalid_see_also_value("test-en",
|
18
|
+
["cn=test,dc=example,dc=com",
|
19
|
+
{"lang-en-us" => "test-en"}],
|
20
|
+
"lang-en-us")
|
21
|
+
assert_invalid_see_also_value("test-ja-jp",
|
22
|
+
["cn=test,dc=example,dc=com",
|
23
|
+
{"lang-ja-jp" =>
|
24
|
+
["cn=test-ja,dc=example,dc=com",
|
25
|
+
"test-ja-jp"]}],
|
26
|
+
"lang-ja-jp")
|
27
|
+
end
|
28
|
+
|
29
|
+
priority :normal
|
30
|
+
def test_duplicated_dn_creation
|
31
|
+
assert(ou_class.new("YYY").save)
|
32
|
+
ou = ou_class.new("YYY")
|
33
|
+
assert(!ou.save)
|
34
|
+
if ActiveLdap.get_text_supported?
|
35
|
+
format = _("%{fn} is duplicated: %s") % {:fn => la_("DN")}
|
36
|
+
else
|
37
|
+
format = "Dn " + _("is duplicated: %s")
|
38
|
+
end
|
39
|
+
assert_equal([format % ou.dn], ou.errors.full_messages)
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_save!
|
43
|
+
make_temporary_group do |group|
|
44
|
+
group.description = ""
|
45
|
+
|
46
|
+
assert_nothing_raised do
|
47
|
+
group.save!
|
48
|
+
end
|
49
|
+
|
50
|
+
@group_class.validates_presence_of(:description)
|
51
|
+
assert_raises(ActiveLdap::EntryInvalid) do
|
52
|
+
group.save!
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_validates_presence_of
|
58
|
+
make_temporary_group do |group|
|
59
|
+
assert_nothing_raised do
|
60
|
+
group.description = ""
|
61
|
+
end
|
62
|
+
assert(group.valid?)
|
63
|
+
assert_equal([], group.errors.to_a)
|
64
|
+
|
65
|
+
@group_class.validates_presence_of(:description)
|
66
|
+
assert(!group.valid?)
|
67
|
+
assert(group.errors.invalid?(:description))
|
68
|
+
assert_equal(1, group.errors.size)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
private
|
73
|
+
def assert_invalid_see_also_value(invalid_value, value, option=nil)
|
74
|
+
make_temporary_user do |user, password|
|
75
|
+
assert(user.save)
|
76
|
+
|
77
|
+
user.see_also = "cn=test,dc=example,dc=com"
|
78
|
+
assert(user.save)
|
79
|
+
|
80
|
+
user.see_also = value
|
81
|
+
assert(!user.save)
|
82
|
+
assert(user.errors.invalid?(:seeAlso))
|
83
|
+
assert_equal(1, user.errors.size)
|
84
|
+
|
85
|
+
syntax_description = lsd_("1.3.6.1.4.1.1466.115.121.1.12")
|
86
|
+
assert_not_nil(syntax_description)
|
87
|
+
reason_params = [invalid_value, _("attribute value is missing")]
|
88
|
+
reason = _('%s is invalid distinguished name (DN): %s') % reason_params
|
89
|
+
params = [invalid_value, syntax_description, reason]
|
90
|
+
params.unshift(option) if option
|
91
|
+
if ActiveLdap.get_text_supported?
|
92
|
+
if option
|
93
|
+
format =
|
94
|
+
_("%{fn} (%s) has invalid format: %s: required syntax: %s: %s")
|
95
|
+
else
|
96
|
+
format = _("%{fn} has invalid format: %s: required syntax: %s: %s")
|
97
|
+
end
|
98
|
+
format = format % {:fn => la_("seeAlso")}
|
99
|
+
assert_equal([format % params], user.errors.full_messages)
|
100
|
+
else
|
101
|
+
if option
|
102
|
+
format = _("(%s) has invalid format: %s: required syntax: %s: %s")
|
103
|
+
else
|
104
|
+
format = _("has invalid format: %s: required syntax: %s: %s")
|
105
|
+
end
|
106
|
+
assert_equal(["seeAlso #{format % params}"], user.errors.full_messages)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|