Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:annaswims/GrinnellPlans
Conflicts: Gemfile
- Loading branch information
Showing
18 changed files
with
269 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
source 'http://rubygems.org' | ||
source 'http://gems.github.com' | ||
|
||
gem 'rails', '3.0.4' | ||
gem 'sqlite3' | ||
gem 'capistrano' | ||
gem 'mysql' | ||
gem 'haml' | ||
gem 'authlogic' | ||
gem 'dynamic_form' | ||
gem 'crypt3' | ||
|
||
#https://github.com/rails/jquery-ujs | ||
gem 'jquery-rails', '>= 0.2.6' | ||
|
||
group :production do | ||
gem "exception_notification", :git => "git://github.com/rails/exception_notification", :require => 'exception_notifier' | ||
end | ||
|
||
group :development do | ||
gem 'hirb' | ||
gem 'annotate' | ||
gem "railroady" | ||
# gem 'rails3-footnotes' | ||
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+) | ||
gem 'ruby-debug' | ||
# gem 'ruby-debug19' | ||
gem "single_test" | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
class AccountSessionsController < ApplicationController | ||
|
||
def new | ||
@session = AccountSession.new | ||
end | ||
|
||
def create | ||
@session = AccountSession.new params[ :account_session ] | ||
if @session.save | ||
redirect_to :controller => :home, :action => :index | ||
else | ||
render :action => :new | ||
end | ||
end | ||
|
||
def destroy | ||
current_account_session.destroy | ||
flash[ :notice ] = "You've been logged out." | ||
redirect_to new_account_session_path | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class AccountSession < Authlogic::Session::Base | ||
# Workaround for Rails 3 compat | ||
def to_key | ||
new_record? ? nil : [ self.send(self.class.primary_key) ] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class AddAuthlogicColumns < ActiveRecord::Migration | ||
def self.up | ||
add_column :accounts, :persistence_token, :string | ||
add_column :accounts, :password_salt, :string | ||
end | ||
|
||
def self.down | ||
remove_column :accounts, :persistence_token | ||
remove_column :accounts, :password_salt | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
require 'active_record/fixtures' | ||
# This file should contain all the record creation needed to seed the database with its default values. | ||
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). | ||
# | ||
# Examples: | ||
# | ||
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) | ||
# Mayor.create(:name => 'Daley', :city => cities.first) | ||
|
||
puts "Loading #{Rails.env} seeds" | ||
Dir[Rails.root.join("db/seed", Rails.env, "*.{yml,csv}")].each do |file| | ||
Fixtures.create_fixtures("db/seed/#{Rails.env}", File.basename(file, '.*')) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module PhpCrypt | ||
module CryptoProviders | ||
class DES | ||
attr_writer :salt | ||
def self.salt | ||
@salt ||= "ab" | ||
end | ||
|
||
def self.encrypt *tokens | ||
tokens.join.crypt salt | ||
end | ||
|
||
def self.matches? crypted, *tokens | ||
salt = crypted[ 0..1 ] | ||
crypted == tokens.join.crypt( salt ) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module PhpCrypt | ||
module CryptoProviders | ||
class MD5 | ||
def self.encrypt *tokens | ||
Crypt3.crypt tokens.join | ||
end | ||
|
||
def self.matches? crypted, *tokens | ||
begin | ||
Crypt3.check tokens.join, crypted | ||
rescue | ||
false | ||
end | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.