Show More
Commit Description:
merge latest feature to master branch
Commit Description:
merge latest feature to master branch
References:
File last commit:
Show/Diff file:
Action:
app/controllers/configurations_controller.rb | 29 lines | 832 B | text/x-ruby | RubyLexer |
class ConfigurationsController < ApplicationController
before_filter :authenticate
before_filter { |controller| controller.authorization_by_roles(['admin'])}
def index
@configurations = GraderConfiguration.find(:all,
:order => '`key`')
end
def reload
GraderConfiguration.reload
redirect_to :action => 'index'
end
def update
@config = GraderConfiguration.find(params[:id])
User.clear_last_login if @config.key == GraderConfiguration::MULTIPLE_IP_LOGIN_KEY and @config.value == 'true' and params[:grader_configuration][:value] == 'false'
respond_to do |format|
if @config.update_attributes(params[:grader_configuration])
format.json { head :ok }
else
format.json { respond_with_bip(@config) }
end
end
end
end