1 class SystemController < ApplicationController
2 before_filter :authenticate_admin!, :except => [:start]
16 Manifest::load JSON.parse(open(Rails.root + 'public/manifest.json').read)
17 Manifest.manifest.init
18 LocalManifest::load JSON.parse(open(Rails.root + 'public/local_manifest.json').read)
19 LocalManifest.manifest.init
20 respond_to do |format|
21 format.html { redirect_to({:action => :index}) }
29 @admin = current_admin
30 respond_to do |format|
31 if @admin.create_token
32 flash[:notice] = I18n.t('flash.notice.created', :model => Admin.human_attribute_name(:authentication_token))
33 format.html { redirect_to({:action => :auth_token}) }
35 flash[:notice] = I18n.t('flash.notice.not_created', :model => Admin.human_attribute_name(:authentication_token))
36 format.html { render action: "auth_token" }
42 respond_to do |format|
43 if current_admin.delete_token
44 flash[:notice] = I18n.t('flash.notice.destroyed', :model => Admin.human_attribute_name(:authentication_token))
45 format.html { redirect_to :action => :auth_token}
47 flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => Admin.human_attribute_name(:authentication_token))
48 format.html { render action: "auth_token" }
54 @admin = Admin.find params[:id]
55 respond_to do |format|
57 format.html { redirect_to({:action => :waiting_list}, {:notice => 'admin was successfully approved.'}) }
59 format.html { render action: "waiting_list" }
65 @waits = Admin.find(:all, :conditions => ['approve = 0'])
69 @newadmin = Admin.find params[:id]
70 if admin_signed_in? and current_admin.activate
71 @newadmin.activate = 1