ucb_rails_user 4.0.3 → 4.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/assets/javascripts/ucb_rails_user/ucb_rails_user.js +6 -1
- data/app/controllers/ucb_rails_user/concerns/home_controller.rb +1 -1
- data/app/controllers/ucb_rails_user/concerns/sessions_controller.rb +1 -1
- data/app/controllers/ucb_rails_user/concerns/users_controller.rb +6 -5
- data/app/views/ucb_rails_user/users/index.html.haml +2 -2
- data/config/routes.rb +2 -0
- data/lib/ucb_rails_user/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a8118f9d0b261b1ad04181b2fa0211c30535bedb47b75b1438275b6ef7c5af0
|
4
|
+
data.tar.gz: 7eee880cef304680125f21beaffeab8a6c95525beda0bfdb750920ab4c996f2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9567b7aa7b943fd70cfe138345d191a84d36a92455e1eb0b6d1d472eb1bc17d09beea6c854804a7e8facea817ed8e2616ece9e27df6dda10bf95fc51e88911b8
|
7
|
+
data.tar.gz: 7e074a6ae931a175285882810cede02a0e83d0322d1c50302d2139df7e9230af1891e8015df91e59132cb27071e4e479b30bc1b0cacb1786b93452c2612e4e30
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@ This engine also includes the [Datatables](https://datatables.net/) JQuery plug-
|
|
16
16
|
|
17
17
|
Version 2.0 and greater of this gem sets a user's `employee_id` to the new UCPath employee id, rather than the legacy HCM employee id. If you need to use the older ID, use version 1.1.3 of this gem, or lower.
|
18
18
|
|
19
|
-
## Upgrading to version 3.0 from version 2.x
|
19
|
+
## Upgrading to version 3.0+ from version 2.x
|
20
20
|
|
21
21
|
See [this wiki page](https://github.com/ucb-ist-eas/ucb_rails_user/wiki/Upgrading-to-version-3.0) for details.
|
22
22
|
|
@@ -18,11 +18,16 @@ var addDatatablesToSearchResults = function () {
|
|
18
18
|
}
|
19
19
|
|
20
20
|
var addDatatablesToUsersTable = function () {
|
21
|
+
var unsorted_columns = $('.ucb-rails-users-table th.unsorted').map((i, e) => $(e).index()).toArray()
|
22
|
+
if (unsorted_columns === []) {
|
23
|
+
var unsorted_columns = $(".ucb-rails-users-table th:contains('Edit'),.ucb-rails-users-table th:contains('Delete')").map((i, e) => $(e).index()).toArray()
|
24
|
+
}
|
25
|
+
|
21
26
|
$('.ucb-rails-users-table').dataTable({
|
22
27
|
searching: true,
|
23
28
|
order: [[ 3, "asc" ]],
|
24
29
|
columnDefs: [ {
|
25
|
-
targets:
|
30
|
+
targets: unsorted_columns,
|
26
31
|
orderable: false
|
27
32
|
}],
|
28
33
|
})
|
@@ -2,7 +2,7 @@ module UcbRailsUser::Concerns::SessionsController
|
|
2
2
|
extend ActiveSupport::Concern
|
3
3
|
|
4
4
|
included do
|
5
|
-
skip_before_action :ensure_authenticated_user, :log_request
|
5
|
+
skip_before_action :ensure_authenticated_user, :log_request, raise: false
|
6
6
|
end
|
7
7
|
|
8
8
|
# Redirects to authentication provider
|
@@ -4,7 +4,7 @@ module UcbRailsUser::Concerns::UsersController
|
|
4
4
|
included do
|
5
5
|
before_action :find_user, :only => [:edit, :update, :destroy]
|
6
6
|
before_action :ensure_admin_user
|
7
|
-
skip_before_action :ensure_admin_user, if: ->{ action_name == "toggle_superuser" && Rails.env.development? }
|
7
|
+
skip_before_action :ensure_admin_user, if: ->{ action_name == "toggle_superuser" && Rails.env.development? }, raise: false
|
8
8
|
end
|
9
9
|
|
10
10
|
def index
|
@@ -76,7 +76,7 @@ module UcbRailsUser::Concerns::UsersController
|
|
76
76
|
def ldap_search
|
77
77
|
# FIXME: this was retrofitted to support typeahead ajax json queries
|
78
78
|
if(query = params[:query])
|
79
|
-
@lps_entries =
|
79
|
+
@lps_entries = UcbRailsUser::OmniUserTypeahead.new.ldap_results(query)
|
80
80
|
@lps_entries.map!{|entry|
|
81
81
|
attrs = entry.attributes.tap{|attrs| attrs["first_last_name"] = "#{attrs['first_name']} #{attrs['last_name']}" }
|
82
82
|
attrs.as_json
|
@@ -85,13 +85,14 @@ module UcbRailsUser::Concerns::UsersController
|
|
85
85
|
render json: @lps_entries
|
86
86
|
|
87
87
|
else
|
88
|
-
@lps_entries =
|
88
|
+
@lps_entries = UcbRailsUser::LdapPerson::Finder.find_by_first_last(
|
89
89
|
params.fetch(:first_name),
|
90
90
|
params.fetch(:last_name),
|
91
91
|
:sort => :last_first_downcase
|
92
92
|
)
|
93
|
-
|
94
|
-
|
93
|
+
uid_strings = @lps_entries.map { |entry| entry.uid&.to_s }.compact
|
94
|
+
@lps_existing_uids = User.where(ldap_uid: uid_strings).pluck(:uid)
|
95
|
+
render 'ucb_rails_user/lps/search'
|
95
96
|
end
|
96
97
|
|
97
98
|
end
|
data/config/routes.rb
CHANGED
@@ -17,6 +17,8 @@ Rails.application.routes.draw do
|
|
17
17
|
as: "admin_user_search", via: [:get]
|
18
18
|
match "/admin/users/impersonate_search", to: UcbRailsUser::UsersController.action(:impersonate_search),
|
19
19
|
as: "admin_user_impersonate_search", via: [:get]
|
20
|
+
match "/admin/users/ldap_search", to: UcbRailsUser::UsersController.action(:ldap_search),
|
21
|
+
as: "admin_user_ldap_search", via: [:get]
|
20
22
|
resources :users, controller: "ucb_rails_user/users", path: "admin/users", as: :admin_users
|
21
23
|
|
22
24
|
resources :impersonations, controller: "ucb_rails_user/impersonations", path: "admin/impersonations", as: :admin_impersonations
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ucb_rails_user
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Downey
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2021-07-14 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|