clean up debug code and get new user correct

This commit is contained in:
Erik Ordway 2009-12-30 10:48:41 -08:00 committed by Eric Allen
parent 5b431ef50a
commit 901af95c69
5 changed files with 15 additions and 11 deletions

View file

@ -42,6 +42,8 @@ class ApplicationController < ActionController::Base
extend ActionView::Helpers::SanitizeHelper::ClassMethods
helper_method :format_date, :markdown
I18n.locale = Tracks::Config.locale
# By default, sets the charset to UTF-8 if it isn't already set
def set_charset
headers["Content-Type"] ||= "text/html; charset=UTF-8"
@ -276,8 +278,7 @@ class ApplicationController < ActionController::Base
def set_time_zone
Time.zone = current_user.prefs.time_zone if logged_in?
locale = params[:locale] || 'en-US'
I18n.locale = locale
I18n.locale = Tracks::Config.locale
end
def set_zindex_counter

View file

@ -9,8 +9,6 @@
<%= render_flash %>
<h3>Please log in to use Tracks:</h3>
<p>auth method <%=cookies[:preferred_auth]%></p></p>
<p>cas user<%=session[:cas_user]%></p></p>
<% if show_database_form %>
<div id="database_auth_form" style="display:<%=(@prefered_auth.eql?('database')) ? "block" : "none"%>">
<% form_tag :action=> 'login' do %>

View file

@ -1,23 +1,22 @@
<div title="Account signup" id="signupform" class="form">
<% form_tag :action=> "create" do %>
<%= error_messages_for 'user' %><br/>
<%#= error_messages_for 'user' %><br/>
<%= render_flash %>
<h3><%= @heading -%></h3>
<table>
<table>
<%if Tracks::Config.auth_schemes.include?('cas') && session[:cas_user]%>
<tr>
<td><label for="user_login">With your CAS username:</label></td>
<td> "<%= session[:cas_user]%>" </td>
</tr>
<tr style="display:none">
<td><%= session[:cas_user]%>" <%= text_field "user", "login", :size => 20, :value => session[:cas_user], :readonly => true %> </td>
<td><%= password_field "user", "password", :size => 20 , :value => "fakebecauseweusecas" %></td>
<td><%= password_field "user", "password_confirmation", :size => 20, :value => "fakebecauseweusecas" %></td>
<td>
<%= hidden_field "user", "login", :value => session[:cas_user] %>
<%= hidden_field "user", "password", :value => session[:cas_user] %>
<%= hidden_field "user", "password_confirmation", :value => session[:cas_user] %>
<%= hidden_field"user", "auth_type", :value => "cas" %></td>
</tr>
<%else%>
<tr>

View file

@ -25,6 +25,7 @@ authentication_schemes:
# You''ll probably want to change this to the time zone of the computer where Tracks is running
# run rake time:zones:local have Rails suggest time zone names on your system
time_zone: "UTC"
locale: 'en-US'
# setting this to true will make the cookies only available over HTTPS

View file

@ -23,5 +23,10 @@ module Tracks
auth_schemes.first
end
end
def self.locale
SITE_CONFIG['locale'] || 'en-US'
end
end
end