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')
|
||||
return [] unless status.success?
|
||||
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]
|
||||
end
|
||||
end
|
||||
|
|
@ -18,6 +18,8 @@ module HomeHelper
|
|||
end
|
||||
end
|
||||
|
||||
users = list_all_users
|
||||
users_with_public_html(users)
|
||||
def get_members
|
||||
users = list_all_users
|
||||
users_with_public_html(users)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<div class="section">
|
||||
<p>Members</p>
|
||||
<ul class="members">
|
||||
<% list_all_users.each do |user| %>
|
||||
<% get_members.each do |user| %>
|
||||
<li><a href="/~<%= user %>"><%= user %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue