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.
21 lines
466 B
Ruby
21 lines
466 B
Ruby
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
|