1 class SystemController < ApplicationController
2 before_filter :authenticate_admin!, :except => [:start]
22 @admin = current_admin
23 respond_to do |format|
24 if @admin.create_token
25 flash[:notice] = I18n.t('flash.notice.created', :model => Admin.human_attribute_name(:authentication_token))
26 format.html { redirect_to({:action => :auth_token}) }
28 flash[:notice] = I18n.t('flash.notice.not_created', :model => Admin.human_attribute_name(:authentication_token))
29 format.html { render action: "auth_token" }
35 respond_to do |format|
36 if current_admin.delete_token
37 flash[:notice] = I18n.t('flash.notice.destroyed', :model => Admin.human_attribute_name(:authentication_token))
38 format.html { redirect_to :action => :auth_token}
40 flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => Admin.human_attribute_name(:authentication_token))
41 format.html { render action: "auth_token" }
47 @admin = Admin.find params[:id]
48 respond_to do |format|
50 format.html { redirect_to({:action => :waiting_list}, {:notice => 'admin was successfully approved.'}) }
52 format.html { render action: "waiting_list" }
58 @waits = Admin.find(:all, :conditions => ['approve = 0'])
62 @newadmin = Admin.find params[:id]
63 if admin_signed_in? and current_admin.activate
64 @newadmin.activate = 1
71 MagicNumber['test_layout'] = false
72 respond_to do |format|
73 format.html { render text: 'production', status: 200 }
78 MagicNumber['test_layout'] = 'test'
79 respond_to do |format|
80 format.html { render text: 'test', status: 200 }