Changeset 281
- Timestamp:
- 02/23/06 08:01:24 (3 years ago)
- Files:
-
- login_engine/trunk/CHANGELOG (copied) (copied from login_engine/branches/rb_1.0/CHANGELOG)
- login_engine/trunk/app/controllers/user_controller.rb (modified) (1 diff)
- login_engine/trunk/app/helpers/user_helper.rb (modified) (2 diffs)
- login_engine/trunk/app/views/user/edit.rhtml (modified) (1 diff)
- login_engine/trunk/db/migrate/001_initial_schema.rb (modified) (1 diff)
- login_engine/trunk/init_engine.rb (modified) (1 diff)
- login_engine/trunk/lib/login_engine.rb (modified) (1 diff)
- login_engine/trunk/lib/login_engine/authenticated_user.rb (modified) (1 diff)
- login_engine/trunk/test/functional/user_controller_test.rb (modified) (1 diff)
- login_engine/trunk/test/unit/user_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
login_engine/trunk/app/controllers/user_controller.rb
r201 r281 209 209 end 210 210 else 211 destroy( @user)211 destroy(user) 212 212 end 213 213 return true login_engine/trunk/app/helpers/user_helper.rb
r137 r281 30 30 <<-EOL 31 31 <tr class="two_columns"> 32 <td class="prompt"><label >#{prompt}:</label></td>32 <td class="prompt"><label for="#{form_name}_#{field_name}">#{prompt}:</label></td> 33 33 <td class="value">#{field}</td> 34 34 </tr> … … 36 36 else 37 37 <<-EOL 38 <tr><td class="prompt"><label >#{prompt}:</label></td></tr>38 <tr><td class="prompt"><label for="#{form_name}_#{field_name}">#{prompt}:</label></td></tr> 39 39 <tr><td class="value">#{field}</td></tr> 40 40 EOL login_engine/trunk/app/views/user/edit.rhtml
r61 r281 4 4 <%= error_messages_for 'user' %> 5 5 6 <%= start_form_tag :action => 'edit' %>7 <%= render_partial 'edit', :user => @user, :submit => true %>8 <%= end_form_tag %>9 <br/>10 <%= start_form_tag :action => 'change_password' %>11 <%= hidden_field_tag "back_to", "edit" %>12 <%= render_partial 'password', :submit => true %>13 <%= end_form_tag %>6 <%= start_form_tag :action => 'edit' %> 7 <%= render_partial 'edit', :user => @user, :submit => true %> 8 <%= end_form_tag %> 9 <br/> 10 <%= start_form_tag :action => 'change_password' %> 11 <%= hidden_field_tag "back_to", "edit" %> 12 <%= render_partial 'password', :submit => true %> 13 <%= end_form_tag %> 14 14 15 <%= start_form_tag :action => 'delete' %>16 <div class="user_delete">17 <%= hidden_field 'user', 'form', :value => 'delete' %>15 <%= start_form_tag :action => 'delete' %> 16 <div class="user_delete"> 17 <%= hidden_field 'user', 'form', :value => 'delete' %> 18 18 19 <%= form_input :submit_button, 'Delete Account' %> 20 </div> 21 <%= end_form_tag %> 22 </div> 19 <%= form_input :submit_button, 'Delete Account' %> 20 </div> 21 <%= end_form_tag %> 23 22 </div> login_engine/trunk/db/migrate/001_initial_schema.rb
r106 r281 1 1 class InitialSchema < ActiveRecord::Migration 2 2 def self.up 3 # NOTE that we don't need to wrap the table name here, since Migrations 4 # will do it whether we want it to or not. 3 5 create_table LoginEngine.config(:user_table), :force => true do |t| 4 6 t.column "login", :string, :limit => 80, :default => "", :null => false login_engine/trunk/init_engine.rb
r201 r281 3 3 require 'login_engine' 4 4 5 # TODO: why do I have to include these here, when including them in login_engine.rb should be sufficient? 6 #require 'authenticated_user' 7 #require 'authenticated_system' 5 module ::LoginEngine::Version 6 Major = 1 # change implies compatibility breaking with previous versions 7 Minor = 0 # change implies backwards-compatible change to API 8 Release = 1 # incremented with bug-fixes, updates, etc. 9 end 8 10 11 Engines.current.version = LoginEngine::Version 12 13 # send the helpers and modules automatically....? 9 14 #ApplicationController.send(:include, LoginEngine) 10 15 #ApplicationHelper.send(:include, LoginEngine) login_engine/trunk/lib/login_engine.rb
r201 r281 52 52 config :user_table, "user" 53 53 end 54 54 55 55 # controls whether or not email is used 56 56 config :use_email_notification, true login_engine/trunk/lib/login_engine/authenticated_user.rb
r192 r281 9 9 base.class_eval do 10 10 11 # use the table name given 12 set_table_name LoginEngine.config(:user_table) 11 # use the table name given. NOTE that this will wrap the table name 12 # using the set prefix/suffix. TODO: this behaviour isn't ideal, but it 13 # is necessary since migrations will ALWAYS wrap using the prefix/suffix. 14 # To explicitly and COMPLETELY set a unique table name, create a version 15 # of the User model in your own application and use set_table_name there. 16 set_table_name wrapped_table_name(LoginEngine.config(:user_table)) 13 17 14 18 attr_accessor :new_password login_engine/trunk/test/functional/user_controller_test.rb
r128 r281 10 10 # load the fixture into the developer-specified table using the custom 11 11 # 'fixture' method. 12 fixture :users, :table_name => LoginEngine.config(:user_table), :class_name => "User" 12 fixture :users, :class_name => "User", 13 :table_name => ActiveRecord::Base.wrapped_table_name(LoginEngine.config(:user_table)) 13 14 14 15 def setup login_engine/trunk/test/unit/user_test.rb
r107 r281 3 3 4 4 # load the fixture into the developer-specified table using the custom 5 # 'fixture' method. 6 fixture :users, :table_name => LoginEngine.config(:user_table), :class_name => "User" 5 # 'fixture' method. Note that it is necessary at the moment to explicitly 6 # wrap the table name. TODO: determine the table name from the Class object. 7 fixture :users, :class_name => "User", 8 :table_name => ActiveRecord::Base.wrapped_table_name(LoginEngine.config(:user_table)) 7 9 8 10 def setup
