[ARVADOS] updated: 6ceb6f30683a68e65c76531121f509874d0a6105

git at public.curoverse.com git at public.curoverse.com
Tue Jan 21 17:31:35 EST 2014


Summary of changes:
 apps/admin/list-inactive-users.rb |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
 create mode 100755 apps/admin/list-inactive-users.rb

       via  6ceb6f30683a68e65c76531121f509874d0a6105 (commit)
      from  d84737275793fcab0ac253c4abe734ad5e84ea12 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 6ceb6f30683a68e65c76531121f509874d0a6105
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Jan 21 14:30:07 2014 -0800

    add list-inactive-users.rb script.
    
    closes #1817

diff --git a/apps/admin/list-inactive-users.rb b/apps/admin/list-inactive-users.rb
new file mode 100755
index 0000000..25311b7
--- /dev/null
+++ b/apps/admin/list-inactive-users.rb
@@ -0,0 +1,24 @@
+#!/usr/bin/env ruby
+
+# usage: list-inactive-users.rb [n-days-old-to-ignore]
+#
+# (default = 7)
+
+abort 'Error: Ruby >= 1.9.3 required.' if RUBY_VERSION < '1.9.3'
+
+threshold = ARGV.shift.to_i rescue 7
+
+require 'arvados'
+arv = Arvados.new(api_version: 'v1')
+
+saidheader = false
+arv.user.list(where: {is_active: false})[:items].each do |user|
+  if Time.now - Time.parse(user[:created_at]) < threshold*86400
+    if !saidheader
+      saidheader = true
+      puts "Inactive users who first logged in <#{threshold} days ago:"
+      puts ""
+    end
+    puts "#{user[:modified_at]} #{user[:uuid]} #{user[:full_name]} <#{user[:email]}>"
+  end
+end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list