-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update admin_controller.rb #11531
Update admin_controller.rb #11531
Conversation
Thanks for opening this pull request! This space is protected by our Code of Conduct - and we're here to help. |
app/controllers/admin_controller.rb
Outdated
@@ -15,7 +15,7 @@ def promote_admin | |||
flash[:error] = 'Only admins can promote other users to admins.' | |||
end | |||
end | |||
redirect_to '/profile/' + @user.username + '?_=' + Time.now.to_i.to_s | |||
redirect_to "/profile/#{@user.username}?_=#{Time.now.to_i}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible unprotected redirect
app/controllers/admin_controller.rb
Outdated
@@ -29,7 +29,7 @@ | |||
flash[:error] = 'Only moderators can promote other users.' | |||
end | |||
end | |||
redirect_to '/profile/' + @user.username + '?_=' + Time.now.to_i.to_s | |||
redirect_to "/profile/#{@user.username}?_=#{Time.now.to_i}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible unprotected redirect
@@ -43,7 +43,7 @@ | |||
flash[:error] = 'Only admins and moderators can demote other users.' | |||
end | |||
end | |||
redirect_to '/profile/' + @user.username + '?_=' + Time.now.to_i.to_s | |||
redirect_to "/profile/#{@user.username}?_=#{Time.now.to_i}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible unprotected redirect
app/controllers/admin_controller.rb
Outdated
@@ -280,7 +280,7 @@ | |||
else | |||
flash[:error] = 'Only moderators can moderate other users.' | |||
end | |||
redirect_to '/profile/' + user.name + '?_=' + Time.now.to_i.to_s | |||
redirect_to "/profile/#{user.name}?_=#{Time.now.to_i}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible unprotected redirect
@@ -291,7 +291,7 @@ | |||
else | |||
flash[:error] = 'Only moderators can unmoderate other users.' | |||
end | |||
redirect_to '/profile/' + user.name + '?_=' + Time.now.to_i.to_s | |||
redirect_to "/profile/#{user.name}?_=#{Time.now.to_i}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible unprotected redirect
This pull request generated screenshots of many common pages in the running app. You should be able to download and view them here: |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #11531 +/- ##
==========================================
- Coverage 83.33% 83.21% -0.13%
==========================================
Files 93 93
Lines 5772 5772
==========================================
- Hits 4810 4803 -7
- Misses 962 969 +7
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Ceejaycodez, feel free to click the Commit suggestion
button. Thanks!
Co-authored-by: Tilda Udufo <[email protected]>
Co-authored-by: Tilda Udufo <[email protected]>
Co-authored-by: Tilda Udufo <[email protected]>
Co-authored-by: Tilda Udufo <[email protected]>
Co-authored-by: Tilda Udufo <[email protected]>
Co-authored-by: Tilda Udufo <[email protected]>
@@ -15,7 +15,7 @@ def promote_admin | |||
flash[:error] = 'Only admins can promote other users to admins.' | |||
end | |||
end | |||
redirect_to '/profile/' + @user.username + '?_=' + Time.now.to_i.to_s | |||
redirect_to "/profile/#{@user.username}?_=#{Time.now.to_i}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible unprotected redirect
@@ -29,7 +29,7 @@ def promote_moderator | |||
flash[:error] = 'Only moderators can promote other users.' | |||
end | |||
end | |||
redirect_to '/profile/' + @user.username + '?_=' + Time.now.to_i.to_s | |||
redirect_to "/profile/#{@user.username}?_=#{Time.now.to_i}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible unprotected redirect
@@ -280,7 +280,7 @@ def moderate | |||
else | |||
flash[:error] = 'Only moderators can moderate other users.' | |||
end | |||
redirect_to '/profile/' + user.name + '?_=' + Time.now.to_i.to_s | |||
redirect_to "/profile/#{user.name}?_=#{Time.now.to_i}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible unprotected redirect
@@ -301,7 +301,7 @@ def ban | |||
else | |||
flash[:error] = 'Only moderators can ban other users.' | |||
end | |||
redirect_to '/profile/' + user.name + '?_=' + Time.now.to_i.to_s | |||
redirect_to "/profile/#{user.name}?_=#{Time.now.to_i}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible unprotected redirect
@@ -312,7 +312,7 @@ def unban | |||
else | |||
flash[:error] = 'Only moderators can unban other users.' | |||
end | |||
redirect_to '/profile/' + user.name + '?_=' + Time.now.to_i.to_s | |||
redirect_to "/profile/#{user.name}?_=#{Time.now.to_i}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible unprotected redirect
Code Climate has analyzed commit b672567 and detected 14 issues on this pull request. Here's the issue category breakdown:
Note: there are 8 critical issues. View more on Code Climate. |
This pull request generated screenshots of many common pages in the running app. You should be able to download and view them here: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work @Ceejaycodez. Thank you!
Congrats on merging your first pull request! 🙌🎉⚡️ Help others take their first stepNow that you've merged your first pull request, you're the perfect person to help someone else out with this challenging first step. 🙌 Try looking at this list of `first-timers-only` issues, and see if someone else is waiting for feedback, or even stuck! 😕 People often get stuck at the same steps, so you might be able to help someone get unstuck, or help lead them to some documentation that'd help. Reach out and be encouraging and friendly! 😄 🎉 Read about how to help support another newcomer here, or find other ways to offer mutual support here. You can also join our Gitter channel to connect with other contributors 📥 |
Congratulations on merging your PR @Ceejaycodez 🎉 |
#11429
Fixes #0000
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
rake test
@publiclab/reviewers
for help, in a comment below