Ticket #1427: login.patch

File login.patch, 1.5 KB (added by Thomas Wood, 10 years ago)

patch to api06 branch to boost session cookie expiry to 1 week in future if opted for on login

  • app/controllers/user_controller.rb

     
    132132      pass = params[:user][:password]
    133133      user = User.authenticate(:username => email_or_display_name, :password => pass)
    134134      if user
     135        if params[:user][:remember]
     136          ActionController::Base.session_options[:session_expires] = 1.week.from_now
     137        end
    135138        session[:user] = user.id
    136139        if params[:referer]
    137140          redirect_to params[:referer]
  • app/views/user/login.rhtml

     
    77<table>
    88  <tr><td class="fieldName">Email Address or username:</td><td><%= text_field('user', 'email',{:size => 50, :maxlength => 255}) %></td></tr>
    99  <tr><td class="fieldName">Password:</td><td><%= password_field('user', 'password',{:size => 28, :maxlength => 255}) %> <span class="minorNote">(<%= link_to 'Lost your password?', :controller => 'user', :action => 'lost_password' %>)</span></td></tr>
     10  <tr><td class="fieldName">Remember me?</td><td><%= check_box('user', 'remember', {:checked => 'checked'}) %></td></tr>
    1011  <tr><td colspan=2>&nbsp;<!--vertical spacer--></td></tr>
    1112  <tr><td></td><td align="right"><%= submit_tag 'Login' %></td></tr>
    1213</table>