forked from External/greenlight
John fix issue#274 (#275)
* <fixed privacy policy errors> * <Fixed code style> * <Robustness changes> * <redirect to 404 page if terms are disabled> * <patched validation of accepted terms> * <relaunching scrutinizer>
This commit is contained in:
@ -180,6 +180,8 @@ class RoomsController < ApplicationController
|
||||
end
|
||||
|
||||
def validate_accepted_terms
|
||||
redirect_to terms_path unless current_user.accepted_terms
|
||||
if current_user
|
||||
redirect_to terms_path unless current_user.accepted_terms
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -99,6 +99,8 @@ class UsersController < ApplicationController
|
||||
|
||||
# GET /terms
|
||||
def terms
|
||||
redirect_to '/404' unless Rails.configuration.terms
|
||||
|
||||
if params[:accept] == "true"
|
||||
current_user.update_attributes(accepted_terms: true)
|
||||
redirect_to current_user.main_room if current_user
|
||||
|
Reference in New Issue
Block a user