summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/users_controller.rb4
-rw-r--r--app/views/forums/show.html.erb8
2 files changed, 9 insertions, 3 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index aec4c36..ff21d8c 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -153,11 +153,11 @@ class UsersController < ApplicationController
end
if userdata[:role]
role = Role.get(userdata[:role])
- if role <= current_user.role
+ if role && role <= current_user.role
userdata[:role] = role
else
# don't change role
- userdata.delete[:role]
+ userdata.delete(:role)
end
end
if @user.youtube != userdata[:youtube]
diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb
index 0612dad..60f3185 100644
--- a/app/views/forums/show.html.erb
+++ b/app/views/forums/show.html.erb
@@ -6,7 +6,13 @@
<% end %>
<% if @forum.role_read && @forum.role_write && @forum.role_write < @forum.role_read %>
- <div class="lockednote">This forum is write-only. You can only see your own posts.</div>
+ <div class="lockednote">
+ <% if @forum.role_read > current_user.role %>
+ This forum is write-only. You can only see your own posts.
+ <% else %>
+ This forum is write-only for users ranked under <%= @forum.role_read %>. They can only see their own posts.
+ <% end %>
+ </div>
<% end %>
<div id="forum_groups">