Class: Admin::EnablerController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/admin/enabler_controller.rb

Instance Method Summary collapse

Instance Method Details

#disableObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'app/controllers/admin/enabler_controller.rb', line 18

def disable
  if Radiant::Config['application.api_key'] == params[:api_key] && request.post?
    Radiant::Config['application.enabled?'] = false
    if params[:message]
      Radiant::Config['application.disabled_message'] = CGI.unescape(params[:message])
    end
    Radiant::Cache.clear
    respond_to do |format|
      format.any { head :ok }
    end
  else
    Page.find_by_url(request.request_uri).process(request, response)
  end
end

#enableObject



6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/admin/enabler_controller.rb', line 6

def enable
  if Radiant::Config['application.api_key'] == params[:api_key] && request.post?
    Radiant::Config['application.enabled?'] = true
    Radiant::Cache.clear
    respond_to do |format|
      format.any { head :ok }
    end
  else
    Page.find_by_url(request.request_uri).process(request, response)
  end
end