Actually do it in a not broken way
This commit is contained in:
parent
839bff1770
commit
14fd952f94
2 changed files with 6 additions and 4 deletions
|
|
@ -6,7 +6,7 @@ module HomeHelper
|
||||||
stdout, stderr, status = Open3.capture3('getent', 'passwd')
|
stdout, stderr, status = Open3.capture3('getent', 'passwd')
|
||||||
return [] unless status.success?
|
return [] unless status.success?
|
||||||
valid_users = stdout.split("\n").select { |user| user.start_with?(/\w/) }.map(&:split).map(&:first)
|
valid_users = stdout.split("\n").select { |user| user.start_with?(/\w/) }.map(&:split).map(&:first)
|
||||||
valid_users.map do |user|
|
return valid_users.map do |user|
|
||||||
user.split(':')[0]
|
user.split(':')[0]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -18,6 +18,8 @@ module HomeHelper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
users = list_all_users
|
def get_members
|
||||||
users_with_public_html(users)
|
users = list_all_users
|
||||||
|
users_with_public_html(users)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<div class="section">
|
<div class="section">
|
||||||
<p>Members</p>
|
<p>Members</p>
|
||||||
<ul class="members">
|
<ul class="members">
|
||||||
<% list_all_users.each do |user| %>
|
<% get_members.each do |user| %>
|
||||||
<li><a href="/~<%= user %>"><%= user %></a></li>
|
<li><a href="/~<%= user %>"><%= user %></a></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue