activeldap 1.2.3 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +6 -0
- data/README +1 -0
- data/lib/active_ldap/get_text_support.rb +3 -1
- data/lib/active_ldap.rb +1 -1
- metadata +5 -321
- data/examples/al-admin/README +0 -182
- data/examples/al-admin/Rakefile +0 -16
- data/examples/al-admin/app/controllers/account_controller.rb +0 -60
- data/examples/al-admin/app/controllers/application_controller.rb +0 -46
- data/examples/al-admin/app/controllers/attributes_controller.rb +0 -17
- data/examples/al-admin/app/controllers/directory_controller.rb +0 -49
- data/examples/al-admin/app/controllers/object_classes_controller.rb +0 -17
- data/examples/al-admin/app/controllers/syntaxes_controller.rb +0 -17
- data/examples/al-admin/app/controllers/users_controller.rb +0 -66
- data/examples/al-admin/app/controllers/welcome_controller.rb +0 -12
- data/examples/al-admin/app/helpers/account_helper.rb +0 -2
- data/examples/al-admin/app/helpers/application_helper.rb +0 -46
- data/examples/al-admin/app/helpers/attributes_helper.rb +0 -15
- data/examples/al-admin/app/helpers/directory_helper.rb +0 -7
- data/examples/al-admin/app/helpers/object_classes_helper.rb +0 -10
- data/examples/al-admin/app/helpers/syntaxes_helper.rb +0 -10
- data/examples/al-admin/app/helpers/url_helper.rb +0 -17
- data/examples/al-admin/app/helpers/users_helper.rb +0 -17
- data/examples/al-admin/app/helpers/welcome_helper.rb +0 -2
- data/examples/al-admin/app/models/entry.rb +0 -23
- data/examples/al-admin/app/models/ldap_user.rb +0 -58
- data/examples/al-admin/app/models/user.rb +0 -91
- data/examples/al-admin/app/views/_entry/_attributes_information.html.erb +0 -29
- data/examples/al-admin/app/views/_entry/_entry.html.erb +0 -15
- data/examples/al-admin/app/views/_schema/_aliases.html.erb +0 -7
- data/examples/al-admin/app/views/_switcher/_after.html.erb +0 -2
- data/examples/al-admin/app/views/_switcher/_before.html.erb +0 -5
- data/examples/al-admin/app/views/account/login.html.erb +0 -26
- data/examples/al-admin/app/views/account/sign_up.html.erb +0 -29
- data/examples/al-admin/app/views/attributes/_attributes.html.erb +0 -19
- data/examples/al-admin/app/views/attributes/_detail.html.erb +0 -29
- data/examples/al-admin/app/views/attributes/index.html.erb +0 -3
- data/examples/al-admin/app/views/attributes/show.html.erb +0 -31
- data/examples/al-admin/app/views/directory/_tree.html.erb +0 -10
- data/examples/al-admin/app/views/directory/_tree_view_js.html.erb +0 -25
- data/examples/al-admin/app/views/directory/index.html.erb +0 -13
- data/examples/al-admin/app/views/directory/populate.html.erb +0 -2
- data/examples/al-admin/app/views/layouts/_footer.html.erb +0 -11
- data/examples/al-admin/app/views/layouts/_header_menu.html.erb +0 -10
- data/examples/al-admin/app/views/layouts/_main_menu.html.erb +0 -18
- data/examples/al-admin/app/views/layouts/application.html.erb +0 -57
- data/examples/al-admin/app/views/object_classes/_attributes.html.erb +0 -28
- data/examples/al-admin/app/views/object_classes/_object_classes.html.erb +0 -19
- data/examples/al-admin/app/views/object_classes/index.html.erb +0 -3
- data/examples/al-admin/app/views/object_classes/show.html.erb +0 -39
- data/examples/al-admin/app/views/syntaxes/_detail.html.erb +0 -14
- data/examples/al-admin/app/views/syntaxes/_syntaxes.html.erb +0 -19
- data/examples/al-admin/app/views/syntaxes/index.html.erb +0 -3
- data/examples/al-admin/app/views/syntaxes/show.html.erb +0 -22
- data/examples/al-admin/app/views/users/_attributes_update_form.html.erb +0 -42
- data/examples/al-admin/app/views/users/_form.html.erb +0 -13
- data/examples/al-admin/app/views/users/_object_classes_update_form.html.erb +0 -46
- data/examples/al-admin/app/views/users/_password_change_form.html.erb +0 -20
- data/examples/al-admin/app/views/users/edit.html.erb +0 -15
- data/examples/al-admin/app/views/users/index.html.erb +0 -10
- data/examples/al-admin/app/views/users/show.html.erb +0 -11
- data/examples/al-admin/app/views/welcome/index.html.erb +0 -13
- data/examples/al-admin/config/boot.rb +0 -110
- data/examples/al-admin/config/database.yml.example +0 -19
- data/examples/al-admin/config/environment.rb +0 -73
- data/examples/al-admin/config/environments/development.rb +0 -17
- data/examples/al-admin/config/environments/production.rb +0 -24
- data/examples/al-admin/config/environments/test.rb +0 -22
- data/examples/al-admin/config/initializers/exception_notifier.rb +0 -2
- data/examples/al-admin/config/initializers/fast_gettext.rb +0 -3
- data/examples/al-admin/config/initializers/inflections.rb +0 -10
- data/examples/al-admin/config/initializers/mime_types.rb +0 -5
- data/examples/al-admin/config/initializers/session_store.rb +0 -23
- data/examples/al-admin/config/ldap.yml.example +0 -21
- data/examples/al-admin/config/routes.rb +0 -58
- data/examples/al-admin/config/session_secret.txt +0 -1
- data/examples/al-admin/config.ru +0 -7
- data/examples/al-admin/db/migrate/001_create_users.rb +0 -16
- data/examples/al-admin/db/schema.rb +0 -23
- data/examples/al-admin/lib/authenticated_system.rb +0 -124
- data/examples/al-admin/lib/authenticated_test_helper.rb +0 -113
- data/examples/al-admin/lib/ldap_test_helper.rb +0 -38
- data/examples/al-admin/lib/tasks/testing.rake +0 -10
- data/examples/al-admin/po/en/al-admin.po +0 -343
- data/examples/al-admin/po/ja/al-admin.po +0 -343
- data/examples/al-admin/po/nl/al-admin.po +0 -380
- data/examples/al-admin/public/.htaccess +0 -40
- data/examples/al-admin/public/404.html +0 -30
- data/examples/al-admin/public/500.html +0 -30
- data/examples/al-admin/public/dispatch.cgi +0 -10
- data/examples/al-admin/public/dispatch.fcgi +0 -24
- data/examples/al-admin/public/dispatch.rb +0 -10
- data/examples/al-admin/public/favicon.ico +0 -0
- data/examples/al-admin/public/images/active-ldap.svg +0 -6351
- data/examples/al-admin/public/images/al-admin.png +0 -0
- data/examples/al-admin/public/images/al-admin.svg +0 -6371
- data/examples/al-admin/public/images/header-background.png +0 -0
- data/examples/al-admin/public/images/header-background.svg +0 -99
- 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 +0 -2
- data/examples/al-admin/public/javascripts/controls.js +0 -963
- data/examples/al-admin/public/javascripts/dragdrop.js +0 -973
- data/examples/al-admin/public/javascripts/effects.js +0 -1128
- data/examples/al-admin/public/javascripts/prototype.js +0 -4320
- data/examples/al-admin/public/javascripts/spinelz/accordion.js +0 -185
- data/examples/al-admin/public/javascripts/spinelz/ajaxHistory.js +0 -157
- data/examples/al-admin/public/javascripts/spinelz/balloon.js +0 -287
- data/examples/al-admin/public/javascripts/spinelz/barchart.js +0 -524
- data/examples/al-admin/public/javascripts/spinelz/calendar.js +0 -3012
- data/examples/al-admin/public/javascripts/spinelz/colorpicker.js +0 -128
- data/examples/al-admin/public/javascripts/spinelz/datepicker.js +0 -438
- data/examples/al-admin/public/javascripts/spinelz/grid.js +0 -1391
- data/examples/al-admin/public/javascripts/spinelz/grid_resizeEx.js +0 -100
- data/examples/al-admin/public/javascripts/spinelz/grid_sortabletableEx.js +0 -129
- data/examples/al-admin/public/javascripts/spinelz/inplaceEditorEx.js +0 -148
- data/examples/al-admin/public/javascripts/spinelz/menubar.js +0 -232
- data/examples/al-admin/public/javascripts/spinelz/navPanel.js +0 -170
- data/examples/al-admin/public/javascripts/spinelz/selectableTable.js +0 -433
- data/examples/al-admin/public/javascripts/spinelz/sideBarBox.js +0 -282
- data/examples/al-admin/public/javascripts/spinelz/sideBarBox_effects.js +0 -83
- data/examples/al-admin/public/javascripts/spinelz/sortableTable.js +0 -270
- data/examples/al-admin/public/javascripts/spinelz/switcher.js +0 -78
- data/examples/al-admin/public/javascripts/spinelz/tabBox.js +0 -469
- data/examples/al-admin/public/javascripts/spinelz/timepicker.js +0 -384
- data/examples/al-admin/public/javascripts/spinelz/toolbar.js +0 -152
- data/examples/al-admin/public/javascripts/spinelz/treeview.js +0 -703
- data/examples/al-admin/public/javascripts/spinelz/window.js +0 -641
- data/examples/al-admin/public/javascripts/spinelz/window_resizeEx.js +0 -130
- data/examples/al-admin/public/javascripts/spinelz_lib/builder.js +0 -131
- data/examples/al-admin/public/javascripts/spinelz_lib/controls.js +0 -835
- data/examples/al-admin/public/javascripts/spinelz_lib/dragdrop.js +0 -944
- data/examples/al-admin/public/javascripts/spinelz_lib/effects.js +0 -1090
- data/examples/al-admin/public/javascripts/spinelz_lib/json.js +0 -139
- data/examples/al-admin/public/javascripts/spinelz_lib/prototype.js +0 -2515
- data/examples/al-admin/public/javascripts/spinelz_lib/resize.js +0 -215
- data/examples/al-admin/public/javascripts/spinelz_lib/scriptaculous.js +0 -51
- data/examples/al-admin/public/javascripts/spinelz_lib/slider.js +0 -278
- data/examples/al-admin/public/javascripts/spinelz_lib/spinelz_util.js +0 -1266
- data/examples/al-admin/public/javascripts/spinelz_lib/unittest.js +0 -564
- data/examples/al-admin/public/robots.txt +0 -1
- data/examples/al-admin/public/stylesheets/account.css +0 -41
- data/examples/al-admin/public/stylesheets/attributes.css +0 -1
- data/examples/al-admin/public/stylesheets/base.css +0 -104
- data/examples/al-admin/public/stylesheets/detail.css +0 -36
- data/examples/al-admin/public/stylesheets/directory.css +0 -22
- data/examples/al-admin/public/stylesheets/object-classes.css +0 -6
- data/examples/al-admin/public/stylesheets/rails.css +0 -35
- data/examples/al-admin/public/stylesheets/spinelz/accordion.css +0 -59
- data/examples/al-admin/public/stylesheets/spinelz/balloon.css +0 -151
- data/examples/al-admin/public/stylesheets/spinelz/calendar.css +0 -564
- data/examples/al-admin/public/stylesheets/spinelz/datepicker.css +0 -175
- data/examples/al-admin/public/stylesheets/spinelz/grid.css +0 -137
- data/examples/al-admin/public/stylesheets/spinelz/menubar.css +0 -78
- data/examples/al-admin/public/stylesheets/spinelz/modal.css +0 -22
- data/examples/al-admin/public/stylesheets/spinelz/navPanel.css +0 -58
- data/examples/al-admin/public/stylesheets/spinelz/selectableTable.css +0 -28
- data/examples/al-admin/public/stylesheets/spinelz/sideBarBox.css +0 -82
- data/examples/al-admin/public/stylesheets/spinelz/sortableTable.css +0 -51
- data/examples/al-admin/public/stylesheets/spinelz/switcher.css +0 -23
- data/examples/al-admin/public/stylesheets/spinelz/tabBox.css +0 -94
- data/examples/al-admin/public/stylesheets/spinelz/timepicker.css +0 -508
- data/examples/al-admin/public/stylesheets/spinelz/toolbar.css +0 -82
- data/examples/al-admin/public/stylesheets/spinelz/treeview.css +0 -121
- data/examples/al-admin/public/stylesheets/spinelz/window.css +0 -140
- data/examples/al-admin/public/stylesheets/structure.css +0 -81
- data/examples/al-admin/public/stylesheets/syntaxes.css +0 -1
- data/examples/al-admin/public/stylesheets/users.css +0 -13
- data/examples/al-admin/public/stylesheets/welcome.css +0 -0
- data/examples/al-admin/script/about +0 -3
- data/examples/al-admin/script/console +0 -3
- data/examples/al-admin/script/dbconsole +0 -3
- data/examples/al-admin/script/destroy +0 -3
- data/examples/al-admin/script/generate +0 -3
- data/examples/al-admin/script/performance/benchmarker +0 -3
- data/examples/al-admin/script/performance/profiler +0 -3
- data/examples/al-admin/script/performance/request +0 -3
- data/examples/al-admin/script/plugin +0 -3
- data/examples/al-admin/script/process/inspector +0 -3
- data/examples/al-admin/script/process/reaper +0 -3
- data/examples/al-admin/script/process/spawner +0 -3
- data/examples/al-admin/script/runner +0 -3
- data/examples/al-admin/script/server +0 -3
- data/examples/al-admin/test/fixtures/users.yml +0 -9
- data/examples/al-admin/test/functional/account_controller_test.rb +0 -12
- data/examples/al-admin/test/functional/attributes_controller_test.rb +0 -8
- data/examples/al-admin/test/functional/directory_controller_test.rb +0 -8
- data/examples/al-admin/test/functional/object_classes_controller_test.rb +0 -8
- data/examples/al-admin/test/functional/syntaxes_controller_test.rb +0 -8
- data/examples/al-admin/test/functional/users_controller_test.rb +0 -8
- data/examples/al-admin/test/functional/welcome_controller_test.rb +0 -8
- data/examples/al-admin/test/integration/sign_up_test.rb +0 -44
- data/examples/al-admin/test/run-test.sh +0 -3
- data/examples/al-admin/test/test_helper.rb +0 -52
- data/examples/al-admin/test/unit/user_test.rb +0 -12
- data/examples/al-admin/vendor/plugins/exception_notification/README +0 -111
- data/examples/al-admin/vendor/plugins/exception_notification/init.rb +0 -1
- data/examples/al-admin/vendor/plugins/exception_notification/lib/exception_notifiable.rb +0 -99
- data/examples/al-admin/vendor/plugins/exception_notification/lib/exception_notifier.rb +0 -66
- data/examples/al-admin/vendor/plugins/exception_notification/lib/exception_notifier_helper.rb +0 -78
- data/examples/al-admin/vendor/plugins/exception_notification/test/exception_notifier_helper_test.rb +0 -61
- data/examples/al-admin/vendor/plugins/exception_notification/test/test_helper.rb +0 -7
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_backtrace.rhtml +0 -1
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_environment.rhtml +0 -7
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_inspect_model.rhtml +0 -16
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_request.rhtml +0 -4
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_session.rhtml +0 -2
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/_title.rhtml +0 -3
- data/examples/al-admin/vendor/plugins/exception_notification/views/exception_notifier/exception_notification.rhtml +0 -6
@@ -1,110 +0,0 @@
|
|
1
|
-
# Don't change this file!
|
2
|
-
# Configure your app in config/environment.rb and config/environments/*.rb
|
3
|
-
|
4
|
-
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
|
5
|
-
|
6
|
-
module Rails
|
7
|
-
class << self
|
8
|
-
def boot!
|
9
|
-
unless booted?
|
10
|
-
preinitialize
|
11
|
-
pick_boot.run
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def booted?
|
16
|
-
defined? Rails::Initializer
|
17
|
-
end
|
18
|
-
|
19
|
-
def pick_boot
|
20
|
-
(vendor_rails? ? VendorBoot : GemBoot).new
|
21
|
-
end
|
22
|
-
|
23
|
-
def vendor_rails?
|
24
|
-
File.exist?("#{RAILS_ROOT}/vendor/rails")
|
25
|
-
end
|
26
|
-
|
27
|
-
def preinitialize
|
28
|
-
load(preinitializer_path) if File.exist?(preinitializer_path)
|
29
|
-
end
|
30
|
-
|
31
|
-
def preinitializer_path
|
32
|
-
"#{RAILS_ROOT}/config/preinitializer.rb"
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
class Boot
|
37
|
-
def run
|
38
|
-
load_initializer
|
39
|
-
Rails::Initializer.run(:set_load_path)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
class VendorBoot < Boot
|
44
|
-
def load_initializer
|
45
|
-
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
46
|
-
Rails::Initializer.run(:install_gem_spec_stubs)
|
47
|
-
Rails::GemDependency.add_frozen_gem_path
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
class GemBoot < Boot
|
52
|
-
def load_initializer
|
53
|
-
self.class.load_rubygems
|
54
|
-
load_rails_gem
|
55
|
-
require 'initializer'
|
56
|
-
end
|
57
|
-
|
58
|
-
def load_rails_gem
|
59
|
-
if version = self.class.gem_version
|
60
|
-
gem 'rails', version
|
61
|
-
else
|
62
|
-
gem 'rails'
|
63
|
-
end
|
64
|
-
rescue Gem::LoadError => load_error
|
65
|
-
$stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
|
66
|
-
exit 1
|
67
|
-
end
|
68
|
-
|
69
|
-
class << self
|
70
|
-
def rubygems_version
|
71
|
-
Gem::RubyGemsVersion rescue nil
|
72
|
-
end
|
73
|
-
|
74
|
-
def gem_version
|
75
|
-
if defined? RAILS_GEM_VERSION
|
76
|
-
RAILS_GEM_VERSION
|
77
|
-
elsif ENV.include?('RAILS_GEM_VERSION')
|
78
|
-
ENV['RAILS_GEM_VERSION']
|
79
|
-
else
|
80
|
-
parse_gem_version(read_environment_rb)
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
def load_rubygems
|
85
|
-
min_version = '1.3.2'
|
86
|
-
require 'rubygems'
|
87
|
-
unless rubygems_version >= min_version
|
88
|
-
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
89
|
-
exit 1
|
90
|
-
end
|
91
|
-
|
92
|
-
rescue LoadError
|
93
|
-
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
94
|
-
exit 1
|
95
|
-
end
|
96
|
-
|
97
|
-
def parse_gem_version(text)
|
98
|
-
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
|
99
|
-
end
|
100
|
-
|
101
|
-
private
|
102
|
-
def read_environment_rb
|
103
|
-
File.read("#{RAILS_ROOT}/config/environment.rb")
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
# All that for this:
|
110
|
-
Rails.boot!
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# SQLite version 3.x
|
2
|
-
# gem install sqlite3-ruby
|
3
|
-
development:
|
4
|
-
adapter: sqlite3
|
5
|
-
database: db/development.sqlite3
|
6
|
-
timeout: 5000
|
7
|
-
|
8
|
-
# Warning: The database defined as 'test' will be erased and
|
9
|
-
# re-generated from your development database when you run 'rake'.
|
10
|
-
# Do not set this db to the same as development or production.
|
11
|
-
test:
|
12
|
-
adapter: sqlite3
|
13
|
-
database: db/test.sqlite3
|
14
|
-
timeout: 5000
|
15
|
-
|
16
|
-
production:
|
17
|
-
adapter: sqlite3
|
18
|
-
database: db/production.sqlite3
|
19
|
-
timeout: 5000
|
@@ -1,73 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file
|
2
|
-
|
3
|
-
# Uncomment below to force Rails into production mode when
|
4
|
-
# you don't control web/app server and can't set it the proper way
|
5
|
-
# ENV['RAILS_ENV'] ||= 'production'
|
6
|
-
|
7
|
-
# Specifies gem version of Rails to use when vendor/rails is not present
|
8
|
-
RAILS_GEM_VERSION = '2.3.8' unless defined? RAILS_GEM_VERSION
|
9
|
-
|
10
|
-
# Bootstrap the Rails environment, frameworks, and default configuration
|
11
|
-
require File.join(File.dirname(__FILE__), 'boot')
|
12
|
-
|
13
|
-
Rails::Initializer.run do |config|
|
14
|
-
# Settings in config/environments/* take precedence over those specified here.
|
15
|
-
# Application configuration should go into files in config/initializers
|
16
|
-
# -- all .rb files in that directory are automatically loaded.
|
17
|
-
# See Rails::Configuration for more options.
|
18
|
-
|
19
|
-
# Skip frameworks you're not going to use. To use Rails without a database
|
20
|
-
# you must remove the Active Record framework.
|
21
|
-
# config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
|
22
|
-
|
23
|
-
# Specify gems that this application depends on.
|
24
|
-
# They can then be installed with "rake gems:install" on new installations.
|
25
|
-
# You have to specify the :lib option for libraries, where the Gem name (sqlite3-ruby) differs from the file itself (sqlite3)
|
26
|
-
# config.gem "bj"
|
27
|
-
# config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
|
28
|
-
# config.gem "sqlite3-ruby", :lib => "sqlite3"
|
29
|
-
# config.gem "aws-s3", :lib => "aws/s3"
|
30
|
-
# config.gem "locale_rails", :version => "2.0.5"
|
31
|
-
# config.gem "gettext_rails", :version => "2.1.0"
|
32
|
-
config.gem "fast_gettext", :version => '>=0.5.8'
|
33
|
-
#only used for mo/po file generation in development, !do not load(:lib=>false), will needlessly eat ram!
|
34
|
-
config.gem "gettext", :lib => false, :version => '>=2.1.0'
|
35
|
-
#this is needed for language/country translations
|
36
|
-
config.gem "gettext_i18n_rails", :version => '>=0.2.2'
|
37
|
-
#this is needed for language/country translations
|
38
|
-
config.gem "i18n_data", :version => '>=0.2.3'
|
39
|
-
|
40
|
-
# Only load the plugins named here, in the order given. By default, all plugins
|
41
|
-
# in vendor/plugins are loaded in alphabetical order.
|
42
|
-
# :all can be used as a placeholder for all plugins not explicitly named
|
43
|
-
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
44
|
-
|
45
|
-
# Add additional load paths for your own custom dirs
|
46
|
-
# config.load_paths += %W( #{RAILS_ROOT}/extras )
|
47
|
-
config.load_paths += ["#{RAILS_ROOT}/../../lib"]
|
48
|
-
config.plugin_paths += %W(#{RAILS_ROOT}/../..)
|
49
|
-
|
50
|
-
# Force all environments to use the same logger level
|
51
|
-
# (by default production uses :info, the others :debug)
|
52
|
-
# config.log_level = :debug
|
53
|
-
config.log_path = Logger::LogDevice.new(config.log_path)
|
54
|
-
|
55
|
-
# Make Time.zone default to the specified zone, and make Active Record store time values
|
56
|
-
# in the database in UTC, and return them converted to the specified local zone.
|
57
|
-
# Run "rake -D time" for a list of tasks for finding time zone names. Comment line to use default local time.
|
58
|
-
config.time_zone = 'UTC'
|
59
|
-
|
60
|
-
# The internationalization framework can be changed to have another default locale (standard is :en) or more load paths.
|
61
|
-
# All files from config/locales/*.rb,yml are added automatically.
|
62
|
-
# config.i18n.load_path << Dir[File.join(RAILS_ROOT, 'my', 'locales', '*.{rb,yml}')]
|
63
|
-
# config.i18n.default_locale = :de
|
64
|
-
|
65
|
-
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
66
|
-
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
67
|
-
# like if you have constraints or database-specific column types
|
68
|
-
# config.active_record.schema_format = :sql
|
69
|
-
|
70
|
-
# Activate observers that should always be running
|
71
|
-
# Please note that observers generated using script/generate observer need to have an _observer suffix
|
72
|
-
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
73
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
-
|
3
|
-
# In the development environment your application's code is reloaded on
|
4
|
-
# every request. This slows down response time but is perfect for development
|
5
|
-
# since you don't have to restart the webserver when you make code changes.
|
6
|
-
config.cache_classes = false
|
7
|
-
|
8
|
-
# Log error messages when you accidentally call methods on nil.
|
9
|
-
config.whiny_nils = true
|
10
|
-
|
11
|
-
# Show full error reports and disable caching
|
12
|
-
config.action_controller.consider_all_requests_local = true
|
13
|
-
config.action_view.debug_rjs = true
|
14
|
-
config.action_controller.perform_caching = false
|
15
|
-
|
16
|
-
# Don't care if the mailer can't send
|
17
|
-
config.action_mailer.raise_delivery_errors = false
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
-
|
3
|
-
# The production environment is meant for finished, "live" apps.
|
4
|
-
# Code is not reloaded between requests
|
5
|
-
config.cache_classes = true
|
6
|
-
|
7
|
-
# Enable threaded mode
|
8
|
-
# config.threadsafe!
|
9
|
-
|
10
|
-
# Use a different logger for distributed setups
|
11
|
-
# config.logger = SyslogLogger.new
|
12
|
-
|
13
|
-
# Full error reports are disabled and caching is turned on
|
14
|
-
config.action_controller.consider_all_requests_local = false
|
15
|
-
config.action_controller.perform_caching = true
|
16
|
-
|
17
|
-
# Use a different cache store in production
|
18
|
-
# config.cache_store = :mem_cache_store
|
19
|
-
|
20
|
-
# Enable serving of images, stylesheets, and javascripts from an asset server
|
21
|
-
# config.action_controller.asset_host = "http://assets.example.com"
|
22
|
-
|
23
|
-
# Disable delivery errors, bad email addresses will be ignored
|
24
|
-
# config.action_mailer.raise_delivery_errors = false
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
-
|
3
|
-
# The test environment is used exclusively to run your application's
|
4
|
-
# test suite. You never need to work with it otherwise. Remember that
|
5
|
-
# your test database is "scratch space" for the test suite and is wiped
|
6
|
-
# and recreated between test runs. Don't rely on the data there!
|
7
|
-
config.cache_classes = true
|
8
|
-
|
9
|
-
# Log error messages when you accidentally call methods on nil.
|
10
|
-
config.whiny_nils = true
|
11
|
-
|
12
|
-
# Show full error reports and disable caching
|
13
|
-
config.action_controller.consider_all_requests_local = true
|
14
|
-
config.action_controller.perform_caching = false
|
15
|
-
|
16
|
-
# Disable request forgery protection in test environment
|
17
|
-
config.action_controller.allow_forgery_protection = false
|
18
|
-
|
19
|
-
# Tell Action Mailer not to deliver emails to the real world.
|
20
|
-
# The :test delivery method accumulates sent emails in the
|
21
|
-
# ActionMailer::Base.deliveries array.
|
22
|
-
config.action_mailer.delivery_method = :test
|
@@ -1,10 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Add new inflection rules using the following format
|
4
|
-
# (all these examples are active by default):
|
5
|
-
# Inflector.inflections do |inflect|
|
6
|
-
# inflect.plural /^(ox)$/i, '\1en'
|
7
|
-
# inflect.singular /^(ox)en/i, '\1'
|
8
|
-
# inflect.irregular 'person', 'people'
|
9
|
-
# inflect.uncountable %w( fish sheep )
|
10
|
-
# end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Your secret key for verifying cookie session data integrity.
|
4
|
-
# If you change this key, all old sessions will become invalid!
|
5
|
-
# Make sure the secret is at least 30 characters and all random,
|
6
|
-
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
-
session_secret_file = File.join(RAILS_ROOT, "config", "session_secret.txt")
|
8
|
-
unless File.exist?(session_secret_file)
|
9
|
-
File.open(session_secret_file, "w") do |file|
|
10
|
-
file.puts(ActiveSupport::SecureRandom.hex(64))
|
11
|
-
end
|
12
|
-
end
|
13
|
-
session_secret = File.read(session_secret_file).strip
|
14
|
-
|
15
|
-
ActionController::Base.session = {
|
16
|
-
:key => '_al_admin_session',
|
17
|
-
:secret => session_secret,
|
18
|
-
}
|
19
|
-
|
20
|
-
# Use the database for sessions instead of the cookie-based default,
|
21
|
-
# which shouldn't be used to store highly confidential information
|
22
|
-
# (create the session table with "rake db:sessions:create")
|
23
|
-
# ActionController::Base.session_store = :active_record_store
|
@@ -1,21 +0,0 @@
|
|
1
|
-
development:
|
2
|
-
host: 127.0.0.1
|
3
|
-
port: 389
|
4
|
-
base: dc=devel,dc=local,dc=net
|
5
|
-
bind_dn: cn=admin,dc=local,dc=net
|
6
|
-
password: secret
|
7
|
-
|
8
|
-
test:
|
9
|
-
host: 127.0.0.1
|
10
|
-
port: 389
|
11
|
-
base: dc=test,dc=local,dc=net
|
12
|
-
bind_dn: cn=admin,dc=local,dc=net
|
13
|
-
password: secret
|
14
|
-
|
15
|
-
production:
|
16
|
-
host: 127.0.0.1
|
17
|
-
port: 389
|
18
|
-
method: :tls
|
19
|
-
base: dc=production,dc=local,dc=net
|
20
|
-
bind_dn: cn=admin,dc=local,dc=net
|
21
|
-
password: secret
|
@@ -1,58 +0,0 @@
|
|
1
|
-
ActionController::Routing::Routes.draw do |map|
|
2
|
-
lang_map = Proc.new do |*args|
|
3
|
-
method, path, options = args
|
4
|
-
duped_options = (options || {}).dup
|
5
|
-
requirements = duped_options.delete(:requirements) || {}
|
6
|
-
defaults = duped_options.delete(:defaults) || {}
|
7
|
-
lang_options = {
|
8
|
-
:requirements => {:lang => /(?:[a-z]{2,2})?/}.merge(requirements),
|
9
|
-
:defaults => {},
|
10
|
-
}
|
11
|
-
lang_options[:defaults] = {:lang => nil} if method != :connect
|
12
|
-
lang_options[:defaults].merge!(defaults)
|
13
|
-
map.send(method, ":lang/#{path}", lang_options.merge(duped_options))
|
14
|
-
map.send(:connect, *args[1..-1])
|
15
|
-
end
|
16
|
-
|
17
|
-
# The priority is based upon order of creation: first created -> highest priority.
|
18
|
-
|
19
|
-
# Sample of regular route:
|
20
|
-
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
|
21
|
-
# Keep in mind you can assign values other than :controller and :action
|
22
|
-
|
23
|
-
# Sample of named route:
|
24
|
-
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
|
25
|
-
# This route can be invoked with purchase_url(:id => product.id)
|
26
|
-
|
27
|
-
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
28
|
-
# map.resources :products
|
29
|
-
|
30
|
-
# Sample resource route with options:
|
31
|
-
# map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
|
32
|
-
|
33
|
-
# Sample resource route with sub-resources:
|
34
|
-
# map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
|
35
|
-
|
36
|
-
# Sample resource route within a namespace:
|
37
|
-
# map.namespace :admin do |admin|
|
38
|
-
# # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
|
39
|
-
# admin.resources :products
|
40
|
-
# end
|
41
|
-
|
42
|
-
# You can have the root of your site routed with map.root -- just remember to delete public/index.html.
|
43
|
-
# map.root :controller => "welcome"
|
44
|
-
lang_map.call(:top, '', :controller => "welcome")
|
45
|
-
|
46
|
-
# See how all your routes lay out with "rake routes"
|
47
|
-
|
48
|
-
lang_map.call(:connect, 'object_class/*id',
|
49
|
-
:controller => "object_classes", :action => "show")
|
50
|
-
lang_map.call(:connect, 'attribute/*id',
|
51
|
-
:controller => "attributes", :action => "show")
|
52
|
-
lang_map.call(:connect, 'syntax/*id',
|
53
|
-
:controller => "syntaxes", :action => "show")
|
54
|
-
|
55
|
-
# Install the default routes as the lowest priority.
|
56
|
-
lang_map.call(:connect, ':controller/:action/:id')
|
57
|
-
lang_map.call(:connect, ':controller/:action/:id.:format')
|
58
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
ebcc497433c106b5b66580c617c287f8e771a290bfcc015c81015dd1b11b35c56d913c09abdb77200f7776faab0636cff0f0d8293bd10619226b6930320b9763
|
data/examples/al-admin/config.ru
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
class CreateUsers < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
create_table "users", :force => true do |t|
|
4
|
-
t.column :login, :string
|
5
|
-
t.column :dn, :string
|
6
|
-
t.column :updated_at, :datetime
|
7
|
-
t.column :salt, :string
|
8
|
-
t.column :remember_token, :string
|
9
|
-
t.column :remember_token_expires_at, :datetime
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.down
|
14
|
-
drop_table "users"
|
15
|
-
end
|
16
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# This file is auto-generated from the current state of the database. Instead of editing this file,
|
2
|
-
# please use the migrations feature of Active Record to incrementally modify your database, and
|
3
|
-
# then regenerate this schema definition.
|
4
|
-
#
|
5
|
-
# Note that this schema.rb definition is the authoritative source for your database schema. If you need
|
6
|
-
# to create the application database on another system, you should be using db:schema:load, not running
|
7
|
-
# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
8
|
-
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
9
|
-
#
|
10
|
-
# It's strongly recommended to check this file into your version control system.
|
11
|
-
|
12
|
-
ActiveRecord::Schema.define(:version => 1) do
|
13
|
-
|
14
|
-
create_table "users", :force => true do |t|
|
15
|
-
t.string "login"
|
16
|
-
t.string "dn"
|
17
|
-
t.datetime "updated_at"
|
18
|
-
t.string "salt"
|
19
|
-
t.string "remember_token"
|
20
|
-
t.datetime "remember_token_expires_at"
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
@@ -1,124 +0,0 @@
|
|
1
|
-
module AuthenticatedSystem
|
2
|
-
protected
|
3
|
-
# Returns true or false if the user is logged in.
|
4
|
-
# Preloads @current_user with the user model if they're logged in.
|
5
|
-
def logged_in?
|
6
|
-
current_user != :false
|
7
|
-
end
|
8
|
-
|
9
|
-
# Accesses the current user from the session.
|
10
|
-
def current_user
|
11
|
-
@current_user ||= (session[:user] && User.find_by_id(session[:user])) || :false
|
12
|
-
end
|
13
|
-
|
14
|
-
# Store the given user in the session.
|
15
|
-
def current_user=(new_user)
|
16
|
-
session[:user] = (new_user.nil? || new_user.is_a?(Symbol)) ? nil : new_user.id
|
17
|
-
@current_user = new_user
|
18
|
-
end
|
19
|
-
|
20
|
-
# Check if the user is authorized.
|
21
|
-
#
|
22
|
-
# Override this method in your controllers if you want to restrict access
|
23
|
-
# to only a few actions or if you want to check if the user
|
24
|
-
# has the correct rights.
|
25
|
-
#
|
26
|
-
# Example:
|
27
|
-
#
|
28
|
-
# # only allow nonbobs
|
29
|
-
# def authorize?
|
30
|
-
# current_user.login != "bob"
|
31
|
-
# end
|
32
|
-
def authorized?
|
33
|
-
true
|
34
|
-
end
|
35
|
-
|
36
|
-
# Filter method to enforce a login requirement.
|
37
|
-
#
|
38
|
-
# To require logins for all actions, use this in your controllers:
|
39
|
-
#
|
40
|
-
# before_filter :login_required
|
41
|
-
#
|
42
|
-
# To require logins for specific actions, use this in your controllers:
|
43
|
-
#
|
44
|
-
# before_filter :login_required, :only => [ :edit, :update ]
|
45
|
-
#
|
46
|
-
# To skip this in a subclassed controller:
|
47
|
-
#
|
48
|
-
# skip_before_filter :login_required
|
49
|
-
#
|
50
|
-
def login_required
|
51
|
-
username, passwd = get_auth_data
|
52
|
-
self.current_user ||= User.authenticate(username, passwd) || :false if username && passwd
|
53
|
-
logged_in? && authorized? ? true : access_denied
|
54
|
-
end
|
55
|
-
|
56
|
-
# Redirect as appropriate when an access request fails.
|
57
|
-
#
|
58
|
-
# The default action is to redirect to the login screen.
|
59
|
-
#
|
60
|
-
# Override this method in your controllers if you want to have special
|
61
|
-
# behavior in case the user is not authorized
|
62
|
-
# to access the requested action. For example, a popup window might
|
63
|
-
# simply close itself.
|
64
|
-
def access_denied
|
65
|
-
respond_to do |accepts|
|
66
|
-
accepts.html do
|
67
|
-
store_location
|
68
|
-
flash.now[:notice] = _("Please login.")
|
69
|
-
redirect_to :controller => '/account', :action => 'login'
|
70
|
-
end
|
71
|
-
accepts.xml do
|
72
|
-
headers["Status"] = "Unauthorized"
|
73
|
-
headers["WWW-Authenticate"] = %(Basic realm="Web Password")
|
74
|
-
render :text => "Could't authenticate you", :status => '401 Unauthorized'
|
75
|
-
end
|
76
|
-
end
|
77
|
-
false
|
78
|
-
end
|
79
|
-
|
80
|
-
# Store the URI of the current request in the session.
|
81
|
-
#
|
82
|
-
# We can return to this location by calling #redirect_back_or_default.
|
83
|
-
def store_location
|
84
|
-
session[:return_to] = url_for(params.merge(:only_path => false))
|
85
|
-
end
|
86
|
-
|
87
|
-
# Redirect to the URI stored by the most recent store_location call or
|
88
|
-
# to the passed default.
|
89
|
-
def redirect_back_or_default(default)
|
90
|
-
redirect_to(session[:return_to] || default)
|
91
|
-
session[:return_to] = nil
|
92
|
-
end
|
93
|
-
|
94
|
-
# Inclusion hook to make #current_user and #logged_in?
|
95
|
-
# available as ActionView helper methods.
|
96
|
-
def self.included(base)
|
97
|
-
base.send :helper_method, :current_user, :logged_in?
|
98
|
-
end
|
99
|
-
|
100
|
-
# When called with before_filter :login_from_cookie will check for an :auth_token
|
101
|
-
# cookie and log the user back in if apropriate
|
102
|
-
def login_from_cookie
|
103
|
-
return unless cookies[:auth_token] && !logged_in?
|
104
|
-
user = User.find_by_remember_token(cookies[:auth_token])
|
105
|
-
if user && user.remember_token?
|
106
|
-
user.remember_me
|
107
|
-
self.current_user = user
|
108
|
-
cookies[:auth_token] = {
|
109
|
-
:value => current_user.remember_token,
|
110
|
-
:expires => current_user.remember_token_expires_at
|
111
|
-
}
|
112
|
-
flash.now[:notice] = _("Logged in successfully")
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
private
|
117
|
-
@@http_auth_headers = %w(X-HTTP_AUTHORIZATION HTTP_AUTHORIZATION Authorization)
|
118
|
-
# gets BASIC auth info
|
119
|
-
def get_auth_data
|
120
|
-
auth_key = @@http_auth_headers.detect { |h| request.env.has_key?(h) }
|
121
|
-
auth_data = request.env[auth_key].to_s.split unless auth_key.blank?
|
122
|
-
return auth_data && auth_data[0] == 'Basic' ? Base64.decode64(auth_data[1]).split(':')[0..1] : [nil, nil]
|
123
|
-
end
|
124
|
-
end
|