forked from External/greenlight
		
	Bug fixes related to banned users (#554)
This commit is contained in:
		| @@ -67,7 +67,7 @@ class AdminsController < ApplicationController | |||||||
|  |  | ||||||
|   # POST /admins/ban/:user_uid |   # POST /admins/ban/:user_uid | ||||||
|   def ban_user |   def ban_user | ||||||
|     @user.remove_role :pending if @user.has_role? :pending |     @user.roles = [] | ||||||
|     @user.add_role :denied |     @user.add_role :denied | ||||||
|     redirect_to admins_path, flash: { success: I18n.t("administrator.flash.banned") } |     redirect_to admins_path, flash: { success: I18n.t("administrator.flash.banned") } | ||||||
|   end |   end | ||||||
| @@ -75,6 +75,7 @@ class AdminsController < ApplicationController | |||||||
|   # POST /admins/unban/:user_uid |   # POST /admins/unban/:user_uid | ||||||
|   def unban_user |   def unban_user | ||||||
|     @user.remove_role :denied |     @user.remove_role :denied | ||||||
|  |     @user.add_role :user | ||||||
|     redirect_to admins_path, flash: { success: I18n.t("administrator.flash.unbanned") } |     redirect_to admins_path, flash: { success: I18n.t("administrator.flash.unbanned") } | ||||||
|   end |   end | ||||||
|  |  | ||||||
| @@ -110,7 +111,7 @@ class AdminsController < ApplicationController | |||||||
|   # POST /admins/branding |   # POST /admins/branding | ||||||
|   def branding |   def branding | ||||||
|     @settings.update_value("Branding Image", params[:url]) |     @settings.update_value("Branding Image", params[:url]) | ||||||
|     redirect_to admins_path |     redirect_to admins_path, flash: { success: I18n.t("administrator.flash.settings.image") } | ||||||
|   end |   end | ||||||
|  |  | ||||||
|   # POST /admins/color |   # POST /admins/color | ||||||
| @@ -118,23 +119,23 @@ class AdminsController < ApplicationController | |||||||
|     @settings.update_value("Primary Color", params[:color]) |     @settings.update_value("Primary Color", params[:color]) | ||||||
|     @settings.update_value("Primary Color Lighten", color_lighten(params[:color])) |     @settings.update_value("Primary Color Lighten", color_lighten(params[:color])) | ||||||
|     @settings.update_value("Primary Color Darken", color_darken(params[:color])) |     @settings.update_value("Primary Color Darken", color_darken(params[:color])) | ||||||
|     redirect_to admins_path |     redirect_to admins_path, flash: { success: I18n.t("administrator.flash.settings") } | ||||||
|   end |   end | ||||||
|  |  | ||||||
|   def coloring_lighten |   def coloring_lighten | ||||||
|     @settings.update_value("Primary Color Lighten", params[:color]) |     @settings.update_value("Primary Color Lighten", params[:color]) | ||||||
|     redirect_to admins_path |     redirect_to admins_path, flash: { success: I18n.t("administrator.flash.settings") } | ||||||
|   end |   end | ||||||
|  |  | ||||||
|   def coloring_darken |   def coloring_darken | ||||||
|     @settings.update_value("Primary Color Darken", params[:color]) |     @settings.update_value("Primary Color Darken", params[:color]) | ||||||
|     redirect_to admins_path |     redirect_to admins_path, flash: { success: I18n.t("administrator.flash.settings") } | ||||||
|   end |   end | ||||||
|  |  | ||||||
|   # POST /admins/room_authentication |   # POST /admins/room_authentication | ||||||
|   def room_authentication |   def room_authentication | ||||||
|     @settings.update_value("Room Authentication", params[:value]) |     @settings.update_value("Room Authentication", params[:value]) | ||||||
|     redirect_to admins_path |     redirect_to admins_path, flash: { success: I18n.t("administrator.flash.settings") } | ||||||
|   end |   end | ||||||
|  |  | ||||||
|   # POST /admins/registration_method/:method |   # POST /admins/registration_method/:method | ||||||
|   | |||||||
| @@ -52,8 +52,17 @@ module Greenlight | |||||||
|     config.bigbluebutton_secret_default = "8cd8ef52e8e101574e400365b55e11a6" |     config.bigbluebutton_secret_default = "8cd8ef52e8e101574e400365b55e11a6" | ||||||
|  |  | ||||||
|     # Use standalone BigBlueButton server. |     # Use standalone BigBlueButton server. | ||||||
|     config.bigbluebutton_endpoint = ENV["BIGBLUEBUTTON_ENDPOINT"].present? ? ENV["BIGBLUEBUTTON_ENDPOINT"] : config.bigbluebutton_endpoint_default |     config.bigbluebutton_endpoint = if ENV["BIGBLUEBUTTON_ENDPOINT"].present? | ||||||
|     config.bigbluebutton_secret = ENV["BIGBLUEBUTTON_SECRET"].present? ? ENV["BIGBLUEBUTTON_SECRET"] : config.bigbluebutton_secret_default |        ENV["BIGBLUEBUTTON_ENDPOINT"] | ||||||
|  |     else | ||||||
|  |       config.bigbluebutton_endpoint_default | ||||||
|  |     end | ||||||
|  |  | ||||||
|  |     config.bigbluebutton_secret = if ENV["BIGBLUEBUTTON_SECRET"].present? | ||||||
|  |       ENV["BIGBLUEBUTTON_SECRET"] | ||||||
|  |     else | ||||||
|  |       config.bigbluebutton_secret_default | ||||||
|  |     end | ||||||
|  |  | ||||||
|     # Fix endpoint format if required. |     # Fix endpoint format if required. | ||||||
|     config.bigbluebutton_endpoint += "/" unless config.bigbluebutton_endpoint.ends_with?('/') |     config.bigbluebutton_endpoint += "/" unless config.bigbluebutton_endpoint.ends_with?('/') | ||||||
|   | |||||||
| @@ -60,6 +60,7 @@ en: | |||||||
|       invite_email_verification: ALLOW_MAIL_NOTIFICATIONS must be set to true in order to use this method |       invite_email_verification: ALLOW_MAIL_NOTIFICATIONS must be set to true in order to use this method | ||||||
|       promoted: User has been successfully promoted |       promoted: User has been successfully promoted | ||||||
|       registration_method_updated: Registration method successfully updated |       registration_method_updated: Registration method successfully updated | ||||||
|  |       settings: Site Settings successfully changed | ||||||
|       unauthorized: You are not authorized to perform actions on this user |       unauthorized: You are not authorized to perform actions on this user | ||||||
|     title: Organization Settings |     title: Organization Settings | ||||||
|     users: |     users: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user