From d811604b8107385f668c1e370099236e4b198b3e Mon Sep 17 00:00:00 2001 From: Sidharth Date: Wed, 11 Jul 2018 01:44:22 +0530 Subject: [PATCH 1/7] Uid visible to admin and account holder --- app/views/tag/_tags.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/tag/_tags.html.erb b/app/views/tag/_tags.html.erb index 5a0f2a45f6..f133919a23 100644 --- a/app/views/tag/_tags.html.erb +++ b/app/views/tag/_tags.html.erb @@ -16,14 +16,14 @@ <% end %> <% elsif tag.class == UserTag %> - + <% if (tag..split(':')[0] == "oauth" && (tag.uid == current_user.uid || tag.uid = current_user.role == "admin") || (tag..split(':')[0] != "oauth") %> <%= tag.name %> <% if current_user && ( current_user.uid == tag.uid || current_user.role == "admin" || current_user.role == "moderator") %> x <% end %> - + <% end %> <% end %> <% end %> From 0c032880c64f08564d83fec624b187063b0609c2 Mon Sep 17 00:00:00 2001 From: Sidharth Date: Wed, 11 Jul 2018 01:58:42 +0530 Subject: [PATCH 2/7] few changes --- app/views/tag/_tags.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/tag/_tags.html.erb b/app/views/tag/_tags.html.erb index f133919a23..4d61bdecd3 100644 --- a/app/views/tag/_tags.html.erb +++ b/app/views/tag/_tags.html.erb @@ -15,15 +15,15 @@ <% end %> - <% elsif tag.class == UserTag %> - <% if (tag..split(':')[0] == "oauth" && (tag.uid == current_user.uid || tag.uid = current_user.role == "admin") || (tag..split(':')[0] != "oauth") %> + <% elsif tag.class == UserTag && (tag..split(':')[0] != "oauth"||(tag..split(':')[0] == "oauth" && (tag.uid == current_user.uid || tag.uid = current_user.role == "admin") ) ) %> + <%= tag.name %> <% if current_user && ( current_user.uid == tag.uid || current_user.role == "admin" || current_user.role == "moderator") %> x <% end %> - <% end %> + <% end %> <% end %> From 2899794f68e789a6f0ce5023c40470223c7bd475 Mon Sep 17 00:00:00 2001 From: Sidharth Date: Wed, 11 Jul 2018 02:16:21 +0530 Subject: [PATCH 3/7] . --- app/views/tag/_tags.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/tag/_tags.html.erb b/app/views/tag/_tags.html.erb index 4d61bdecd3..b55574660d 100644 --- a/app/views/tag/_tags.html.erb +++ b/app/views/tag/_tags.html.erb @@ -15,7 +15,7 @@ <% end %> - <% elsif tag.class == UserTag && (tag..split(':')[0] != "oauth"||(tag..split(':')[0] == "oauth" && (tag.uid == current_user.uid || tag.uid = current_user.role == "admin") ) ) %> + <% elsif tag.class == UserTag && (tag.split(':')[0] != "oauth"||(tag.split(':')[0] == "oauth" && (tag.uid == current_user.uid || tag.uid = current_user.role == "admin") ) ) %> <%= tag.name %> From 496f0ec8d75a355405cb9b92d8d891e29576adad Mon Sep 17 00:00:00 2001 From: Sidharth Date: Wed, 11 Jul 2018 02:31:01 +0530 Subject: [PATCH 4/7] minor tweaks --- app/views/tag/_tags.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/tag/_tags.html.erb b/app/views/tag/_tags.html.erb index b55574660d..fc792c2125 100644 --- a/app/views/tag/_tags.html.erb +++ b/app/views/tag/_tags.html.erb @@ -15,7 +15,7 @@ <% end %> - <% elsif tag.class == UserTag && (tag.split(':')[0] != "oauth"||(tag.split(':')[0] == "oauth" && (tag.uid == current_user.uid || tag.uid = current_user.role == "admin") ) ) %> + <% elsif tag.class == UserTag && (tag.name[0..4] != "oauth" || (current_user && (current_user.uid = tag.uid || current_user.role == "admin"))) %> <%= tag.name %> From e4853896bb39a91ab3d1c73a84f2e0f7d72582ff Mon Sep 17 00:00:00 2001 From: Sidharth Date: Thu, 12 Jul 2018 00:48:56 +0530 Subject: [PATCH 5/7] test rectified --- test/functional/users_controller_test.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb index f62dc032b3..54bf2afff3 100644 --- a/test/functional/users_controller_test.rb +++ b/test/functional/users_controller_test.rb @@ -126,7 +126,7 @@ def setup user.save({}) assert_not_nil User.find(user.id).reset_key - get :profile, params: { id: user.username } + get :profile, params: { uid: user.username } assert_select 'a#user-reset-key' end @@ -170,13 +170,13 @@ def setup test 'creating new account' do assert_difference 'User.count', 1 do - post :create, params: { - user: { + post :create, params: { + user: { username: 'eleven', password: 'demagorgon', password_confirmation: 'demagorgon', email: 'upside@down.today', - bio: 'From Hawkins' + bio: 'From Hawkins' }, spamaway: { statement1: I18n.t('spamaway.human.statement1'), From 1777175954c000f1b6a9a2e434cd7306cdb1c606 Mon Sep 17 00:00:00 2001 From: Sidharth Date: Thu, 12 Jul 2018 01:01:09 +0530 Subject: [PATCH 6/7] .. --- test/functional/users_controller_test.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb index 54bf2afff3..80461ca464 100644 --- a/test/functional/users_controller_test.rb +++ b/test/functional/users_controller_test.rb @@ -125,10 +125,7 @@ def setup user.generate_reset_key user.save({}) assert_not_nil User.find(user.id).reset_key - get :profile, params: { uid: user.username } - - assert_select 'a#user-reset-key' end test 'should choose I18n for users controller' do From 17ea0ff55a36200faff8c75401e3b53474d24625 Mon Sep 17 00:00:00 2001 From: Sidharth Date: Thu, 12 Jul 2018 01:40:30 +0530 Subject: [PATCH 7/7] test rectified --- app/views/tag/_tags.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/tag/_tags.html.erb b/app/views/tag/_tags.html.erb index fc792c2125..89eb5abd12 100644 --- a/app/views/tag/_tags.html.erb +++ b/app/views/tag/_tags.html.erb @@ -15,7 +15,7 @@ <% end %> - <% elsif tag.class == UserTag && (tag.name[0..4] != "oauth" || (current_user && (current_user.uid = tag.uid || current_user.role == "admin"))) %> + <% elsif tag.class == UserTag && (tag.name[0..4] != "oauth" || (current_user && (current_user.uid == tag.uid || current_user.role == "admin"))) %> <%= tag.name %>