public
Fork of trevorturk/el-dorado
Description: Localized version of El Dorado using Gibberish. Dutch language included.
Homepage: http://almosteffortless.com/eldorado/
Clone URL: git://github.com/jxl/el-dorado.git
Search Repo:
moving to cookie-based sessions, upgrading a few areas with rails 2.0 
stuff

git-svn-id: http://eldorado.googlecode.com/svn/trunk@550 
9c008b19-a030-0410-9975-d76d301b4276
trevorturk (author)
Sat Dec 08 13:14:57 -0800 2007
commit  54c085c38390dd2213ffacfde0446188835e0433
tree    0e2167cb98f92f6a66268d9c11c171bc17aa0649
parent  e9e22bcc71637c1ba3f98a4ca0a3a8accd368e68
0
...
2
3
4
5
6
7
8
9
10
 
 
 
 
11
12
13
14
15
16
 
 
17
18
19
...
29
30
31
32
 
33
34
35
 
36
...
2
3
4
 
 
 
 
 
 
5
6
7
8
9
10
11
 
 
 
12
13
14
15
16
...
26
27
28
 
29
30
31
 
32
33
0
@@ -2,18 +2,15 @@ Welcome to El Dorado!
0
 
0
 # Installation #
0
 
0
-1) Set up config/database.yml and config/deploy.rb according to your setup
0
-2) Run "rake db:schema:load" (see note below) and start your web server
0
-3) Visit your new site, note your temporary password, and log in
0
-
0
-NOTE: Rake tasks generally only affect the local "development" database. To install on a public site,
0
-you would need to run "rake db:schema:load RAILS_ENV=production" on the remote server.
0
+1) Install the required gems: Rails 2.0.1 and TZInfo (run this command to install them: "sudo gem install rails tzinfo")
0
+2) Rename config/database.example.yml to config/database.yml and fill in the database and session details for your setup
0
+3) Run "rake db:schema:load" and start your web server (use "rake db:schema:load RAILS_ENV=production" for a live site)
0
+4) Visit your new site and log in using the password displayed (log in and edit the user account to change this password)
0
 
0
 # Importing from a PunBB site (version 1.2.15) #
0
 
0
-1) Set up the "import" section of config/database.yml
0
-2) Run "rake import:database" (see note above)
0
-3) Run the other available rake tasks as necessary: import:avatars, import:headers, and import:files
0
+1) Set up the "import" section of config/database.yml and run "rake import:database"
0
+2) Run optional rake tasks if necessary: import:avatars, import:headers, and import:files
0
 
0
 # Upgrading #
0
 
0
@@ -29,7 +26,7 @@ Released under the MIT License, Copyright 2006 Trevor Turk (see LICENSE file for
0
 
0
 NewAthens.org, Matt Brent, Artie Jordan, Max Mearsheimer, Timothy O'Connell, Matz et a. (Ruby),
0
 DHH et al. (Rails), Rick Olson, Josh Goebel, Justin Palmer, Rickard Andersson (PunBB),
0
-Matt Mullenweg et al. (Wordpress), Michael Heilemann et al. (k2), Josh Peek, and Jeff Stahler...
0
+Matt Mullenweg et al. (Wordpress), Michael Heilemann et al. (k2), and Josh Peek.
0
 
0
 - Trevor Turk
0
-http://almosteffortless.com
0
+http://almosteffortless.com
0
\ No newline at end of file
...
1
2
 
 
 
3
4
5
6
7
8
9
...
1
2
3
4
5
6
7
8
 
9
10
11
0
@@ -1,9 +1,11 @@
0
 class ApplicationController < ActionController::Base
0
   
0
+ helper :all
0
+ protect_from_forgery
0
+
0
   around_filter :set_timezone
0
   before_filter :auth_token_login, :check_bans, :update_online_at, :get_settings, :get_reminders, :get_newest_user, :clean_params
0
   helper_method :current_user, :logged_in?, :is_online?, :admin?, :can_edit?, :require_login, :require_admin, :redirect_home
0
- helper :all
0
   
0
   rescue_from ActiveRecord::RecordNotFound, :with => :record_not_found
0
   
...
16
17
18
19
 
20
21
22
...
16
17
18
 
19
20
21
22
0
@@ -16,7 +16,7 @@ class TopicsController < ApplicationController
0
     @topic = Topic.find(params[:id])
0
     redirect_to login_path if (!logged_in? && @topic.private)
0
     @posts = @topic.posts.paginate(:page => params[:page], :include => :user)
0
- redirect_to @topic if @posts.blank?
0
+ redirect_to @topic if @posts.blank? # if params[:page] is too big, no posts will be found
0
     @page = params[:page] ? params[:page] : 1
0
     @padding = ((@page.to_i - 1) * Topic::PER_PAGE) # to get post #s w/ pagination
0
     @topic.hit!
...
36
37
38
39
 
40
41
42
...
36
37
38
 
39
40
41
42
0
@@ -36,7 +36,7 @@ class User < ActiveRecord::Base
0
   validates_uniqueness_of :login, :case_sensitive => false
0
   validates_length_of :login, :maximum => 25
0
   validates_confirmation_of :password, :on => :create
0
- validates_confirmation_of :password, :on => :update, :allow_nil => true
0
+ validates_confirmation_of :password, :on => :update, :allow_blank => true
0
   
0
   before_create { |u| u.online_at = u.profile_updated_at = Time.now.utc }
0
   
...
13
14
15
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
18
...
13
14
15
 
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
0
@@ -13,5 +13,21 @@
0
         </ul>
0
       <% end %>
0
     </ul>
0
- </div>
0
+ </div>
0
+</div>
0
+
0
+<div class="box" id="box-categories-new">
0
+ <%= error_messages_for :category %>
0
+ <% @category = Category.new unless @category %>
0
+ <% form_for @category do |f| %>
0
+ <span class="top">New Category</span>
0
+ <p class="label"><label for="category_name">Name</label></p>
0
+ <p><%= f.text_field :name, :style => 'width:66%;' %></p>
0
+ <p class="label"><label for="category_position">Position</label></p>
0
+ <p><%= f.text_field :position, :style => 'width:5%;' %></p>
0
+ <p>
0
+ <%= submit_tag "Add Category", :disable_with => "Add Category" %>&nbsp;
0
+ <%= link_to 'Cancel', forum_admin_path %>
0
+ </p>
0
+ <% end %>
0
 </div>
0
\ No newline at end of file
...
3
4
5
 
6
7
8
...
3
4
5
6
7
8
9
0
@@ -3,6 +3,7 @@
0
   <span class="detail">
0
     &nbsp;| &nbsp;
0
     <%= link_to 'Settings', settings_path %> &nbsp;
0
+ <%= link_to 'Forum', forum_admin_path %> &nbsp;
0
     <%= link_to 'Themes', themes_path %>
0
   </span>
0
 </div>
...
6
7
8
9
 
 
 
 
10
11
12
...
20
21
22
 
 
 
 
 
 
 
 
23
24
25
...
44
45
46
47
 
48
49
50
51
52
 
53
54
55
...
72
73
74
75
 
76
77
78
79
80
 
81
82
83
84
85
 
86
87
88
...
6
7
8
 
9
10
11
12
13
14
15
...
23
24
25
26
27
28
29
30
31
32
33
34
35
36
...
55
56
57
 
58
59
60
61
62
 
63
64
65
66
...
83
84
85
 
86
87
88
89
90
 
91
92
93
94
95
 
96
97
98
99
0
@@ -6,7 +6,10 @@ RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
0
 module Rails
0
   class << self
0
     def boot!
0
- pick_boot.run unless booted?
0
+ unless booted?
0
+ preinitialize
0
+ pick_boot.run
0
+ end
0
     end
0
 
0
     def booted?
0
@@ -20,6 +23,14 @@ module Rails
0
     def vendor_rails?
0
       File.exist?("#{RAILS_ROOT}/vendor/rails")
0
     end
0
+
0
+ def preinitialize
0
+ load(preinitializer_path) if File.exists?(preinitializer_path)
0
+ end
0
+
0
+ def preinitializer_path
0
+ "#{RAILS_ROOT}/config/preinitializer.rb"
0
+ end
0
   end
0
 
0
   class Boot
0
@@ -44,12 +55,12 @@ module Rails
0
 
0
     def load_rails_gem
0
       if version = self.class.gem_version
0
- gem 'rails', "=#{version}"
0
+ gem 'rails', version
0
       else
0
         gem 'rails'
0
       end
0
     rescue Gem::LoadError => load_error
0
- STDERR.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
0
+ $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
0
       exit 1
0
     end
0
 
0
@@ -72,17 +83,17 @@ module Rails
0
         require 'rubygems'
0
 
0
         unless rubygems_version >= '0.9.4'
0
- STDERR.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
0
+ $stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
0
           exit 1
0
         end
0
 
0
       rescue LoadError
0
- STDERR.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
0
+ $stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
0
         exit 1
0
       end
0
 
0
       def parse_gem_version(text)
0
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*'([\d.]+)'/
0
+ $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*'([!~<>=]*\s*[\d.]+)'/
0
       end
0
 
0
       private
...
1
2
3
4
5
6
7
8
 
 
9
10
11
12
13
14
15
16
17
18
 
 
19
 
 
20
21
22
23
24
25
 
 
26
27
28
29
 
30
31
32
33
34
 
...
 
 
1
2
3
4
5
6
7
8
9
 
 
 
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
32
33
34
35
 
36
37
0
@@ -1,33 +1,36 @@
0
-# MySQL (default setup). Versions 4.1 and 5.0 are recommended.
0
-
0
 development:
0
   adapter: mysql
0
   database: eldorado_development
0
   username: root
0
   password:
0
   host: localhost
0
+ session_key: eldorado_development
0
+ secret: YrDOFOmYJyFg2tTZykCbZjWYQUbKBt
0
 
0
-# Warning: The database defined as 'test' will be erased and
0
-# re-generated from your development database when you run 'rake'.
0
-# Do not set this db to the same as development or production.
0
 test:
0
   adapter: mysql
0
   database: eldorado_test
0
   username: root
0
   password:
0
   host: localhost
0
+ session_key: eldorado_test
0
+ secret: Pl8qJNFc8mo1yt1xtHOmfUGHOPEutu
0
 
0
+# This "session_key" can be any string, and should be unique to your installation (e.g. mysite_session)
0
+# This "secret" must be a random string, at least 30 characters long, and kept secret for security
0
 production:
0
   adapter: mysql
0
   database: eldorado_production
0
   username: root
0
   password:
0
   host: localhost
0
+ session_key:
0
+ secret:
0
 
0
 import:
0
   adapter: mysql
0
- database: eldorado_import
0
+ database: punbb
0
   username: root
0
   password:
0
   host: localhost
0
- prefix: pun_
0
\ No newline at end of file
0
+ prefix: pun_
...
1
2
3
4
5
 
 
 
6
7
8
 
9
10
11
 
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 
27
28
29
30
31
 
 
 
 
 
 
 
32
33
34
35
...
 
 
 
 
 
1
2
3
4
5
 
6
7
 
8
9
10
11
12
 
 
 
 
 
 
 
 
 
 
 
 
13
14
 
 
15
16
17
18
19
20
21
22
23
24
 
 
 
0
@@ -1,35 +1,24 @@
0
-# Be sure to restart your web server when you modify this file.
0
-
0
-# Uncomment below to force Rails into production mode when
0
-# you don't control web/app server and can't set it the proper way
0
-# ENV['RAILS_ENV'] ||= 'production'
0
+# Bootstrap the Rails environment, frameworks, and default configuration
0
+# Settings in config/environments/* take precedence those specified here
0
+# Be sure to restart your web server when you modify this file
0
 
0
 # Specifies gem version of Rails to use when vendor/rails is not present
0
-# RAILS_GEM_VERSION = '1.2.3'
0
+RAILS_GEM_VERSION = '2.0.1' unless defined? RAILS_GEM_VERSION
0
 
0
-# Bootstrap the Rails environment, frameworks, and default configuration
0
 require File.join(File.dirname(__FILE__), 'boot')
0
+require 'yaml'
0
 
0
 Rails::Initializer.run do |config|
0
   
0
- # Settings in config/environments/* take precedence those specified here
0
-
0
- # Vendor Everything: http://errtheblog.com/post/2120
0
- config.load_paths += Dir["#{RAILS_ROOT}/vendor/gems/**"].map do |dir|
0
- File.directory?(lib = "#{dir}/lib") ? lib : dir
0
- end
0
-
0
- # Use the database for sessions instead of the file system
0
- # (create the session table with 'rake db:sessions:create')
0
- config.action_controller.session_store = :active_record_store
0
-
0
- # Make Active Record use UTC-base instead of local time
0
+ # Make Active Record use UTC-base instead of local time, and make Time.new return time in UTC
0
   config.active_record.default_timezone = :utc
0
-
0
- # Make Time.now return time in UTC
0
   ENV['TZ'] = 'UTC'
0
   
0
+ # The session_key and secret (for verifying session data integrity) can be set in config/database.yml
0
+ db = YAML.load_file('config/database.yml')
0
+ config.action_controller.session = {
0
+ :session_key => db[RAILS_ENV]['session_key'],
0
+ :secret => db[RAILS_ENV]['secret']
0
+ }
0
+
0
 end
0
-
0
-# Require gems in vendor/gems
0
-%w(tzinfo).each { |g| require g }
...
1
2
 
 
3
 
 
 
 
 
 
 
4
5
 
6
7
8
...
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
...
 
 
1
2
3
4
5
6
7
8
9
10
11
 
12
13
14
15
...
106
107
108
 
 
 
 
 
 
 
 
 
109
110
111
0
@@ -1,8 +1,15 @@
0
-# This file is autogenerated. Instead of editing this file, please use the
0
-# migrations feature of ActiveRecord to incrementally modify your database, and
0
+# This file is auto-generated from the current state of the database. Instead of editing this file,
0
+# please use the migrations feature of ActiveRecord to incrementally modify your database, and
0
 # then regenerate this schema definition.
0
+#
0
+# Note that this schema.rb definition is the authoritative source for your database schema. If you need
0
+# to create the application database on another system, you should be using db:schema:load, not running
0
+# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
0
+# you'll amass, the slower it'll run and the greater likelihood for issues).
0
+#
0
+# It's strongly recommended to check this file into your version control system.
0
 
0
-ActiveRecord::Schema.define(:version => 65) do
0
+ActiveRecord::Schema.define(:version => 66) do
0
 
0
   create_table "avatars", :force => true do |t|
0
     t.integer "parent_id"
0
@@ -99,15 +106,6 @@ ActiveRecord::Schema.define(:version => 65) do
0
     t.integer "min_posts"
0
   end
0
 
0
- create_table "sessions", :force => true do |t|
0
- t.string "session_id"
0
- t.text "data"
0
- t.datetime "updated_at"
0
- end
0
-
0
- add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
0
- add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
0
-
0
   create_table "settings", :force => true do |t|
0
     t.string "title"
0
     t.string "tagline"
...
1
2
3
4
 
...
1
2
 
3
4
0
@@ -1,3 +1,3 @@
0
 #!/usr/bin/env ruby
0
 require File.dirname(__FILE__) + '/../config/boot'
0
-require 'commands/about'
0
\ No newline at end of file
0
+require 'commands/about'
...
15
16
17
 
 
 
 
18
19
20
...
24
25
26
 
 
 
 
 
 
27
28
29
...
15
16
17
18
19
20
21
22
23
24
...
28
29
30
31
32
33
34
35
36
37
38
39
0
@@ -15,6 +15,10 @@ class Test::Unit::TestCase
0
   # in MySQL. Turn off transactional fixtures in this case; however, if you
0
   # don't care one way or the other, switching from MyISAM to InnoDB tables
0
   # is recommended.
0
+ #
0
+ # The only drawback to using transactional fixtures is when you actually
0
+ # need to test transactions. Since your test is bracketed by a transaction,
0
+ # any transactions started in your code will be automatically rolled back.
0
   self.use_transactional_fixtures = true
0
 
0
   # Instantiated fixtures are slow, but give you @david where otherwise you
0
@@ -24,6 +28,12 @@ class Test::Unit::TestCase
0
   # then set this back to true.
0
   self.use_instantiated_fixtures = false
0
 
0
+ # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
0
+ #
0
+ # Note: You'll currently still have to declare fixtures explicitly in integration tests
0
+ # -- they do not yet inherit this setting
0
+ fixtures :all
0
+
0
   # Add more helper methods to be used by all tests here...
0
   
0
   def login_as(user)

Comments

    No one has commented yet.