Skip to content

Commit

Permalink
First
Browse files Browse the repository at this point in the history
  • Loading branch information
mulroony committed Feb 29, 2012
0 parents commit a57e9c1
Show file tree
Hide file tree
Showing 1,367 changed files with 145,534 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .bzrignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
./log
./db_backups
./vendor/plugins/restful-authentication/generators/authenticated/templates/site_keys.rb
./config/database.yml
./student_activity_record.rb
./orig.public
./test/fixtures/users.yml
./public/maps
./local/counties-20110605
db_backups
local/counties-20110605
log
orig.public
public/maps
16 changes: 16 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require(File.join(File.dirname(__FILE__), 'config', 'boot'))

require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'

require 'tasks/rails'
begin
require 'query_reviewer/tasks'
rescue LoadError
STDERR.puts "The query_reviewer gem could not be found!"
end

80 changes: 80 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base

# Be sure to include AuthenticationSystem in Application Controller instead
include AuthenticatedSystem
include Mercator
require 'csv'

helper :all # include all helpers, all the time
protect_from_forgery # See ActionController::RequestForgeryProtection for details

$sort_table = {false => " asc", true =>" desc"}

def use_citation
session['citation'] = params[:id]
redirect_to :controller => "sites"
end

def remove_citation
session['citation'] = nil
redirect_to :controller => "citations"
end

#sets appropiate access levels for Yield/Trait
# return checked value and access_level
def access_conditions
if logged_in?
user = current_user
if user.page_access_level == 1
$checked = 0
$access_level = 1
elsif user.page_access_level <= 2
$checked = 0
$access_level = user.access_level
#$access_level = user.page_access_level
else
$checked = 1
$access_level = user.access_level
#$access_level = user.page_access_level
end
else
$checked = 1
$access_level = 4
end
end

#Attempting to not log Maps#mapoverlay
def silent?(action)
false
end

# this knows more than I'd like about the internals of process, but
# the other options require knowing even more. It would have been
# nice to be able to use logger.silence, but there isn't a good
# method to hook that around, due to the way benchmarking logs.

def log_processing_with_silence_logs
if logger && silent?(action_name) then
@old_logger_level, logger.level = logger.level, Logger::ERROR
end

log_processing_without_silence_logs
end

def process_with_silence_logs(request, response, method = :perform_action, *arguments)
ret = process_without_silence_logs(request, response, method, *arguments)
if logger && silent?(action_name) then
logger.level = @old_logger_level
end
ret
end

alias_method_chain :log_processing, :silence_logs
alias_method_chain :process, :silence_logs

# Scrub sensitive parameters from your log
# filter_parameter_logging :password
end
Loading

0 comments on commit a57e9c1

Please sign in to comment.