Changeset 281

Show
Ignore:
Timestamp:
02/23/06 08:01:24 (3 years ago)
Author:
snowblink
Message:

Merged rb_1.0 into trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • login_engine/trunk/app/controllers/user_controller.rb

    r201 r281  
    209209          end 
    210210        else 
    211           destroy(@user) 
     211          destroy(user) 
    212212        end 
    213213        return true 
  • login_engine/trunk/app/helpers/user_helper.rb

    r137 r281  
    3030<<-EOL 
    3131        <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> 
    3333          <td class="value">#{field}</td> 
    3434        </tr> 
     
    3636      else 
    3737<<-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> 
    3939        <tr><td class="value">#{field}</td></tr> 
    4040        EOL 
  • login_engine/trunk/app/views/user/edit.rhtml

    r61 r281  
    44  <%= error_messages_for 'user' %> 
    55 
    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 %> 
    1414 
    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' %> 
    1818 
    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 %> 
    2322</div> 
  • login_engine/trunk/db/migrate/001_initial_schema.rb

    r106 r281  
    11class InitialSchema < ActiveRecord::Migration 
    22  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. 
    35    create_table LoginEngine.config(:user_table), :force => true do |t| 
    46      t.column "login", :string, :limit => 80, :default => "", :null => false 
  • login_engine/trunk/init_engine.rb

    r201 r281  
    33require 'login_engine' 
    44 
    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' 
     5module ::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. 
     9end 
    810 
     11Engines.current.version = LoginEngine::Version 
     12 
     13# send the helpers and modules automatically....? 
    914#ApplicationController.send(:include, LoginEngine) 
    1015#ApplicationHelper.send(:include, LoginEngine) 
  • login_engine/trunk/lib/login_engine.rb

    r201 r281  
    5252    config :user_table, "user" 
    5353  end 
    54  
     54   
    5555  # controls whether or not email is used 
    5656  config :use_email_notification, true 
  • login_engine/trunk/lib/login_engine/authenticated_user.rb

    r192 r281  
    99      base.class_eval do 
    1010 
    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)) 
    1317 
    1418        attr_accessor :new_password 
  • login_engine/trunk/test/functional/user_controller_test.rb

    r128 r281  
    1010  # load the fixture into the developer-specified table using the custom 
    1111  # '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)) 
    1314   
    1415  def setup 
  • login_engine/trunk/test/unit/user_test.rb

    r107 r281  
    33 
    44  # 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)) 
    79  
    810  def setup