forked from External/greenlight
add ability to configure terms and conditions
This commit is contained in:
@ -54,7 +54,7 @@ class ApplicationController < ActionController::Base
|
||||
meeting_logout_url: request.base_url + logout_room_path(@room),
|
||||
meeting_recorded: true,
|
||||
moderator_message: "To invite someone to the meeting, send them this link:\n\n
|
||||
#{request.base_url + Rails.configuration.relative_url_root + room_path(@room)}"
|
||||
#{request.base_url + relative_root + room_path(@room)}"
|
||||
}
|
||||
end
|
||||
end
|
||||
|
@ -10,6 +10,6 @@ class MainController < ApplicationController
|
||||
|
||||
def redirect_to_room
|
||||
# If the user is logged in already, move them along to their room.
|
||||
redirect_to room_path(current_user.room.uid) if current_user
|
||||
redirect_to room_path(current_user.room) if current_user
|
||||
end
|
||||
end
|
||||
|
@ -1,5 +1,6 @@
|
||||
class RoomsController < ApplicationController
|
||||
|
||||
before_action :validate_accepted_terms, unless: -> { !Rails.configuration.terms }
|
||||
before_action :find_room, except: :create
|
||||
before_action :verify_room_ownership, except: [:create, :show, :join, :logout]
|
||||
|
||||
@ -159,4 +160,8 @@ class RoomsController < ApplicationController
|
||||
redirect_to root_path
|
||||
end
|
||||
end
|
||||
|
||||
def validate_accepted_terms
|
||||
redirect_to terms_path unless current_user.accepted_terms
|
||||
end
|
||||
end
|
||||
|
@ -73,6 +73,16 @@ class UsersController < ApplicationController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# GET /u/terms
|
||||
def terms
|
||||
redirect_to root_path unless current_user
|
||||
|
||||
if params[:accept] == "true"
|
||||
current_user.update_attribute(accepted_terms: true)
|
||||
redirect_to current_user.main_room
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
|
Reference in New Issue
Block a user