Rename admin users controller/route
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Started out as a simple helper page to list LDAP users, but turning into proper user management now.
This commit is contained in:
20
app/controllers/admin/users_controller.rb
Normal file
20
app/controllers/admin/users_controller.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
class Admin::UsersController < Admin::BaseController
|
||||
before_action :set_current_section
|
||||
|
||||
def index
|
||||
ldap = LdapService.new
|
||||
@ou = params[:ou] || "kosmos.org"
|
||||
@orgs = ldap.fetch_organizations
|
||||
@entries = ldap.fetch_users(ou: @ou)
|
||||
@stats = {
|
||||
users_confirmed: User.where(ou: @ou).confirmed.count,
|
||||
users_pending: User.where(ou: @ou).pending.count
|
||||
}
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_current_section
|
||||
@current_section = :users
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user