[ARVADOS] updated: 1621df028129634f1ad057ee9aad3179fd9afa95

git at public.curoverse.com git at public.curoverse.com
Sun Jun 22 00:55:48 EDT 2014


Summary of changes:
 apps/workbench/app/controllers/application_controller.rb | 13 +++++++++----
 apps/workbench/app/views/layouts/application.html.erb    |  2 +-
 apps/workbench/app/views/user_agreements/index.html.erb  | 11 +++++++++++
 apps/workbench/test/integration/anonymous_user_test.rb   |  1 +
 4 files changed, 22 insertions(+), 5 deletions(-)

       via  1621df028129634f1ad057ee9aad3179fd9afa95 (commit)
       via  a8dee54210543da8a1b5da3365339b2e03968cae (commit)
      from  238d00d830f909102c15454e4a706faeca45ad0a (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 1621df028129634f1ad057ee9aad3179fd9afa95
Author: radhika <radhika at curoverse.com>
Date:   Sun Jun 22 00:55:03 2014 -0400

    2659: inactive user agreements

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 43fc0cb..43d0d0d 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -480,6 +480,8 @@ class ApplicationController < ActionController::Base
 
     anonymous_user_token = Rails.configuration.anonymous_user_token
     if !anonymous_user_token
+      @@anonymous_user = nil
+      Thread.current[:arvados_anonymous_api_token] = nil
       return
     end
 
@@ -498,8 +500,11 @@ class ApplicationController < ActionController::Base
           prefs: u.prefs
         }
         @@anonymous_user = u
+        Thread.current[:arvados_anonymous_api_token] = anonymous_user_token
       else
         @@anonymous_user = nil
+        Thread.current[:arvados_api_token] = nil
+        Thread.current[:arvados_anonymous_api_token] = nil
       end
     elsif current_user && !current_user.andand.is_active
       previous_api_token = Thread.current[:arvados_api_token]
@@ -508,16 +513,16 @@ class ApplicationController < ActionController::Base
         valid_anonymous_token = verify_api_token
         if valid_anonymous_token
           @@anonymous_user = User.current
+          Thread.current[:arvados_anonymous_api_token] = anonymous_user_token
         else
           @@anonymous_user = nil
+          Thread.current[:arvados_anonymous_api_token] = nil
         end
         Thread.current[:arvados_api_token] = previous_api_token
         verify_api_token
-        if valid_anonymous_token
-          Thread.current[:arvados_api_token] = anonymous_user_token
-        end
       else
         @@anonymous_user = User.current
+        Thread.current[:arvados_anonymous_api_token] = anonymous_user_token
       end
     end
   end
@@ -530,7 +535,7 @@ class ApplicationController < ActionController::Base
   end
 
   def check_user_agreements
-    return if (Thread.current[:arvados_api_token] == Rails.configuration.anonymous_user_token)
+    return if Thread.current[:arvados_anonymous_api_token]
 
     if current_user && !current_user.is_active
       if not current_user.is_invited
diff --git a/apps/workbench/app/views/user_agreements/index.html.erb b/apps/workbench/app/views/user_agreements/index.html.erb
index 49516eb..c432b39 100644
--- a/apps/workbench/app/views/user_agreements/index.html.erb
+++ b/apps/workbench/app/views/user_agreements/index.html.erb
@@ -1,5 +1,16 @@
 <% content_for :breadcrumbs do raw '<!-- -->' end %>
 
+<%
+  if !@required_user_agreements
+    @signed_ua_uuids = UserAgreement.signatures.map &:head_uuid
+    @required_user_agreements = UserAgreement.all.map do |ua|
+      if not @signed_ua_uuids.index ua.uuid
+        Collection.find(ua.uuid)
+      end
+    end.compact
+  end
+%>
+
 <% n_files = @required_user_agreements.collect(&:files).flatten(1).count %>
 <% content_for :page_title do %>
 <% if n_files == 1 %>

commit a8dee54210543da8a1b5da3365339b2e03968cae
Author: radhika <radhika at curoverse.com>
Date:   Sat Jun 21 19:05:37 2014 -0400

    2659: test update

diff --git a/apps/workbench/app/views/layouts/application.html.erb b/apps/workbench/app/views/layouts/application.html.erb
index c0740ad..6dbc2c2 100644
--- a/apps/workbench/app/views/layouts/application.html.erb
+++ b/apps/workbench/app/views/layouts/application.html.erb
@@ -94,7 +94,7 @@
                 <% if !current_user.is_invited %>
                   <li role="presentation"><a href="/users/welcome" role="menuitem"><i class="fa fa-sign-out fa-fw"></i> Inactive </a></li>
                 <% else %>
-                  <li role="presentation"><a href="/user_agreements/index" role="menuitem"><i class="fa fa-sign-out fa-fw"></i> Inactive </a></li>
+                  <li role="presentation"><a href="/user_agreements" role="menuitem"><i class="fa fa-sign-out fa-fw"></i> Inactive </a></li>
                 <% end %>
               <% end %>
 
diff --git a/apps/workbench/test/integration/anonymous_user_test.rb b/apps/workbench/test/integration/anonymous_user_test.rb
index 9b9b060..2a5da9b 100644
--- a/apps/workbench/test/integration/anonymous_user_test.rb
+++ b/apps/workbench/test/integration/anonymous_user_test.rb
@@ -101,6 +101,7 @@ class AnonymousUserTest < ActionDispatch::IntegrationTest
       if !invited
         assert page.has_text? 'Your account must be activated'
       else
+        assert page.has_text? 'Please check the box below to indicate that you have read and accepted the user agreement'
       end
     end
   end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list