Improve admin LDAP user index
* Show which domain the current list is for * Render text links as such
This commit is contained in:
parent
8cf631fd94
commit
db9118cb7c
@ -4,11 +4,9 @@ class Admin::LdapUsersController < Admin::BaseController
|
|||||||
def index
|
def index
|
||||||
attributes = %w{dn cn uid mail admin}
|
attributes = %w{dn cn uid mail admin}
|
||||||
filter = Net::LDAP::Filter.eq("uid", "*")
|
filter = Net::LDAP::Filter.eq("uid", "*")
|
||||||
if params[:ou]
|
|
||||||
treebase = "ou=#{params[:ou]},cn=users,dc=kosmos,dc=org"
|
@ou = params[:ou] || "kosmos.org"
|
||||||
else
|
treebase = "ou=#{@ou},cn=users,dc=kosmos,dc=org"
|
||||||
treebase = "ou=kosmos.org,cn=users,dc=kosmos,dc=org"
|
|
||||||
end
|
|
||||||
|
|
||||||
entries = ldap_client.search(base: treebase, filter: filter, attributes: attributes)
|
entries = ldap_client.search(base: treebase, filter: filter, attributes: attributes)
|
||||||
entries.sort_by! { |e| e.cn[0] }
|
entries.sort_by! { |e| e.cn[0] }
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
<h2>LDAP users</h2>
|
<h2>LDAP users: <%= @ou %></h2>
|
||||||
|
|
||||||
<ul>
|
<h3 class="hidden">Domains</h3>
|
||||||
<li><%= link_to 'kosmos.org', admin_ldap_users_path %></li>
|
<ul class="mb-10">
|
||||||
<li><%= link_to '5apps.com', admin_ldap_users_path(ou: '5apps.com') %></li>
|
<li class="inline-block">
|
||||||
|
<%= link_to 'kosmos.org', admin_ldap_users_path, class: "ks-text-link" %>
|
||||||
|
</li>
|
||||||
|
<li class="inline-block ml-6">
|
||||||
|
<%= link_to '5apps.com', admin_ldap_users_path(ou: '5apps.com'), class: "ks-text-link" %>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user