2016-05-25 07:19:45 +00:00
|
|
|
class Sessions::Event::Maintenance < Sessions::Event::Base
|
|
|
|
|
|
|
|
def initialize(params)
|
|
|
|
super(params)
|
|
|
|
return if !@is_web_socket
|
|
|
|
ActiveRecord::Base.establish_connection
|
|
|
|
end
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
return if !@is_web_socket
|
|
|
|
ActiveRecord::Base.remove_connection
|
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
|
|
|
|
|
|
|
# check if sender is admin
|
2016-08-12 16:39:09 +00:00
|
|
|
return if !permission_check('admin.maintenance', 'maintenance')
|
2016-05-25 07:19:45 +00:00
|
|
|
Sessions.broadcast(@payload, 'public', @session['id'])
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|