This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 39098bb Show inactive count
39098bb is described below
commit 39098bb242ca7ae203c88823230211f5795590f5
Author: Sebb <[email protected]>
AuthorDate: Mon Mar 11 16:51:55 2019 +0000
Show inactive count
---
lib/whimsy/asf/ldap.rb | 5 +++++
www/roster/main.rb | 1 +
www/roster/views/index.html.rb | 7 ++++++-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/lib/whimsy/asf/ldap.rb b/lib/whimsy/asf/ldap.rb
index 608b7d6..37160fa 100644
--- a/lib/whimsy/asf/ldap.rb
+++ b/lib/whimsy/asf/ldap.rb
@@ -749,6 +749,11 @@ module ASF
attrs['asf-banned'] == 'yes'
end
+ # is the login marked as inactive?
+ def inactive?
+ nologin? || asf_banned?
+ end
+
# primary mail addresses
def mail
attrs['mail'] || []
diff --git a/www/roster/main.rb b/www/roster/main.rb
index 3432810..c664554 100755
--- a/www/roster/main.rb
+++ b/www/roster/main.rb
@@ -39,6 +39,7 @@ end
get '/' do
if env['REQUEST_URI'].end_with? '/'
+ ASF::Person.preload(['asf-banned','loginShell']) # so can get inactive
count
@committers = ASF::Person.list
@committees = ASF::Committee.pmcs
@nonpmcs = ASF::Committee.nonpmcs
diff --git a/www/roster/views/index.html.rb b/www/roster/views/index.html.rb
index 5834de2..5ab9cfd 100644
--- a/www/roster/views/index.html.rb
+++ b/www/roster/views/index.html.rb
@@ -26,7 +26,12 @@ _html do
_a 'Committers', href: 'committer/'
end
- _td 'Search for committers by name, user id, or email address'
+ _td do
+ _ 'Search for committers by name, user id, or email address'
+ _ ' (includes '
+ _ @committers.select{|c| c.inactive?}.length
+ _ ' inactive accounts)'
+ end
end
### members