discourse/app/controllers/request_access_controller.rb

23 lines
539 B
Ruby
Raw Normal View History

2013-02-06 03:16:51 +08:00
class RequestAccessController < ApplicationController
skip_before_filter :check_xhr, :check_restricted_access
def new
@return_path = params[:return_path] || "/"
render layout: 'no_js'
end
def create
@return_path = params[:return_path] || "/"
if params[:password] == SiteSetting.access_password
cookies.permanent['_access'] = SiteSetting.access_password
redirect_to @return_path
2013-02-07 23:45:24 +08:00
else
2013-02-06 03:16:51 +08:00
flash[:error] = I18n.t(:'request_access.incorrect')
render :new, layout: 'no_js'
end
end
end