diff --git a/Gemfile b/Gemfile index e316c31..08c9553 100644 --- a/Gemfile +++ b/Gemfile @@ -8,12 +8,6 @@ gem 'rails', '3.0.0.rc' # gem 'sqlite3-ruby', :require => 'sqlite3' gem 'pg' gem 'devise' -gem 'ruby-openid' -gem 'rack-openid' -gem 'devise_openid_authenticatable', :git => "git://github.com/nbudin/devise_openid_authenticatable.git" -gem 'ruby-openid-apps-discovery' -gem "devise_ldap_authenticatable", "0.4.4" -#gem "devise_ldap_authenticatable", :git => "git://github.com/cschiewek/devise_ldap_authenticatable.git" # Use unicorn as the web server # gem 'unicorn' diff --git a/Gemfile.lock b/Gemfile.lock index 1534b4e..7205f9d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,11 +1,3 @@ -GIT - remote: git://github.com/nbudin/devise_openid_authenticatable.git - revision: 8c23a93 - specs: - devise_openid_authenticatable (1.0.0.alpha6) - devise (>= 1.0.6) - rack-openid (>= 1.0.3) - GEM remote: http://rubygems.org/ specs: @@ -43,9 +35,6 @@ GEM devise (1.1.1) bcrypt-ruby (~> 2.1.2) warden (~> 0.10.7) - devise_ldap_authenticatable (0.4.4) - devise (> 1.0.4) - net-ldap (>= 0.1.1) erubis (2.6.6) abstract (>= 1.0.0) i18n (0.4.1) @@ -54,15 +43,11 @@ GEM mime-types treetop (>= 1.4.5) mime-types (1.16) - net-ldap (0.1.1) pg (0.9.0) polyglot (0.3.1) rack (1.2.1) rack-mount (0.6.9) rack (>= 1.0.0) - rack-openid (1.1.1) - rack (>= 0.4) - ruby-openid (>= 2.0.3) rack-test (0.5.4) rack (>= 1.0) rails (3.0.0.rc) @@ -79,9 +64,6 @@ GEM rake (>= 0.8.3) thor (~> 0.14.0) rake (0.8.7) - ruby-openid (2.1.8) - ruby-openid-apps-discovery (1.2.0) - ruby-openid (>= 2.1.7) thor (0.14.0) treetop (1.4.8) polyglot (>= 0.3.1) @@ -94,10 +76,5 @@ PLATFORMS DEPENDENCIES devise - devise_ldap_authenticatable (= 0.4.4) - devise_openid_authenticatable! pg - rack-openid rails (= 3.0.0.rc) - ruby-openid - ruby-openid-apps-discovery diff --git a/app/models/user.rb b/app/models/user.rb index 799800f..46ff92e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,44 +1,14 @@ class User < ActiveRecord::Base # Include default devise modules. Others available are: # :token_authenticatable, :confirmable, :lockable and :timeoutable - devise :database_authenticatable, :openid_authenticatable, :registerable, :recoverable, :trackable, :validatable -# devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable - # devise :openid_authenticatable + devise :database_authenticatable, :registerable, + :recoverable, :rememberable, :trackable, :validatable, + :token_authenticatable, :confirmable # Setup accessible (or protected) attributes for your model - # attr_accessible :email, :password, :password_confirmation, :remember_me, :identity_url + attr_accessible :name, :email, :password, :password_confirmation, :remember_me - # Handle creation of user authenticated via OpenID - def self.create_from_identity_url(identity_url) - User.find_or_initialize_by_identity_url(identity_url) + def to_s + name || email end - - # Set email as a required field from the Open ID provider - def self.openid_required_fields - ["email", "http://axschema.org/contact/email"] - end - - # Accept fields from Open ID provider - def openid_fields=(fields) - fields.each do |key, value| - case key.to_s - when "email", "http://axschema.org/contact/email" - case value - when Array - self.email = value.first - else - self.email = value - end - if alt = self.class.find_by_email(email) and alt.id != id - self.id = alt.id - self.reload - @new_record = false - end - end - end - - # Create this user - self.save! - - end end diff --git a/app/views/devise/menu/_registration_items.html.erb b/app/views/devise/menu/_registration_items.html.erb index ae4044f..d1c5259 100644 --- a/app/views/devise/menu/_registration_items.html.erb +++ b/app/views/devise/menu/_registration_items.html.erb @@ -1,6 +1,6 @@ <% if user_signed_in? %>
<%= f.label :name %>
+ <%= f.text_field :name %>
<%= f.label :email %>
<%= f.text_field :email %>
<%= f.label :identity_url %>
- <%= f.text_field :identity_url %>
<%= f.label :name %>
+ <%= f.text_field :name %>
<%= f.label :email %>
<%= f.text_field :email %>
<%= f.label :identity_url %>
- <%= f.text_field :identity_url %>
<%= f.label :email %>
<%= f.text_field :email %>
<%= f.submit "Sign in" %>
<% end %> -<%= render :partial => "devise/shared/links" %> +<%= render :partial => "devise/shared/links" %> \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 2f3e650..3632057 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -12,7 +12,7 @@ <%= render 'devise/menu/registration_items' %> <%= render 'devise/menu/login_items' %> -<%= notice %>
<%= alert %>
diff --git a/config/application.rb b/config/application.rb index fefafae..893d885 100644 --- a/config/application.rb +++ b/config/application.rb @@ -39,6 +39,5 @@ class Application < Rails::Application # Configure sensitive parameters which will be filtered from the log file. config.filter_parameters += [:password, :password_confirmation] - config.middleware.insert_before(Warden::Manager, Rack::OpenID) end end diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 7746356..06af1d5 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -46,7 +46,7 @@ config.encryptor = :bcrypt # Setup a pepper to generate the encrypted password. - config.pepper = "4dda21a3b0da60adda7a8d0fa3a98e120618443e3e03ee3699823f20a395c6afb38027edf5bdfbc85810c3a005bec9c91368beb25c4c2bb6295e1af7540b9c69" + config.pepper = "44d61859aad32afab93602ac0cdc1f2527332d0782a9b0d91e75ace2a6b54177cdf2f3775d2f58575f80e04ea213f6f337bc36669c50d11d49bc852213d6a0a2" # ==> Configuration for :confirmable # The time you want to give your user to confirm his account. During this time diff --git a/config/routes.rb b/config/routes.rb index 4f343fa..72b3c9d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,6 +4,7 @@ resources :characters devise_for :users + resources :users, :only => [:index, :show] # The priority is based upon order of creation: # first created -> highest priority. diff --git a/db/migrate/20100820221903_devise_create_users.rb b/db/migrate/20100820221903_devise_create_users.rb deleted file mode 100644 index 9c58450..0000000 --- a/db/migrate/20100820221903_devise_create_users.rb +++ /dev/null @@ -1,27 +0,0 @@ -class DeviseCreateUsers < ActiveRecord::Migration - def self.up - create_table(:users) do |t| - t.database_authenticatable :null => false - t.recoverable - t.rememberable - t.trackable - t.openid_authenticatable - t.confirmable - t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both - t.token_authenticatable - - t.timestamps - end - - add_index :users, :email, :unique => true - add_index :users, :reset_password_token, :unique => true - add_index :users, :confirmation_token, :unique => true - add_index :users, :unlock_token, :unique => true - add_index :users, :identity_url, :unique => true - end - - def self.down - drop_table :users - end - -end diff --git a/db/migrate/20100821001441_create_characters.rb b/db/migrate/20100821001441_create_characters.rb deleted file mode 100644 index 3a54567..0000000 --- a/db/migrate/20100821001441_create_characters.rb +++ /dev/null @@ -1,20 +0,0 @@ -class CreateCharacters < ActiveRecord::Migration - def self.up - create_table :characters do |t| - t.references :user - t.string :name - t.integer :str - t.integer :dex - t.integer :con - t.integer :int - t.integer :wis - t.integer :cha - - t.timestamps - end - end - - def self.down - drop_table :characters - end -end diff --git a/db/schema.rb b/db/schema.rb index d8eb7bc..c2b6a51 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20100821001441) do +ActiveRecord::Schema.define(:version => 20101104191045) do create_table "characters", :force => true do |t| t.integer "user_id" @@ -29,6 +29,7 @@ t.string "email", :default => "", :null => false t.string "encrypted_password", :limit => 128, :default => "", :null => false t.string "password_salt", :default => "", :null => false + t.string "name", :limit => 40 t.string "reset_password_token" t.string "remember_token" t.datetime "remember_created_at" @@ -37,13 +38,9 @@ t.datetime "last_sign_in_at" t.string "current_sign_in_ip" t.string "last_sign_in_ip" - t.string "identity_url" t.string "confirmation_token" t.datetime "confirmed_at" t.datetime "confirmation_sent_at" - t.integer "failed_attempts", :default => 0 - t.string "unlock_token" - t.datetime "locked_at" t.string "authentication_token" t.datetime "created_at" t.datetime "updated_at" @@ -51,8 +48,6 @@ add_index "users", ["confirmation_token"], :name => "index_users_on_confirmation_token", :unique => true add_index "users", ["email"], :name => "index_users_on_email", :unique => true - add_index "users", ["identity_url"], :name => "index_users_on_identity_url", :unique => true add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true - add_index "users", ["unlock_token"], :name => "index_users_on_unlock_token", :unique => true end diff --git a/public/stylesheets/site.css b/public/stylesheets/site.css index 6f9223d..4989807 100644 --- a/public/stylesheets/site.css +++ b/public/stylesheets/site.css @@ -7,6 +7,18 @@ border-bottom: solid 1px #000; } +#header a { + text-decoration:none; +} + +#header a, +#header a:link, +#header a:visited, +#header a:hover { + color:#000000; + background:none; +} + #title { font-size: 3em; font-family:serif;