Commit ade6642ede47ccc3f785c5ff5b7d2151625d52fb

authentication, I think it is best to remove restful authentication plugin from vendor/plugins, but it will be there for a while
  
33
44class ApplicationController < ActionController::Base
55 include AuthenticatedSystem
6
7 before_filter :login_required
68
79 helper :all # include all helpers, all the time
810
911 # See ActionController::RequestForgeryProtection for details
1012 # Uncomment the :secret if you're not using the cookie session store
1113 # protect_from_forgery :secret => '78176fd716a1af43463c18f52d7203bf'
12
14
1315end
  
2828 flash[:notice] = "You have been logged out."
2929 redirect_back_or_default('/')
3030 end
31
32 def authorized?
33 true
34 end
3135end
  
2424 end
2525 end
2626
27 def authorized?
28 true
29 end
30
2731end
  
1<% form_tag session_path do -%>
2<p><label for="login">Login</label><br/>
3<%= text_field_tag 'login' %></p>
1<% window 'login', "Autenticação" do %>
2 <% form_tag session_path do %>
3 <p><label for="login">Login</label><br/>
4 <%= text_field_tag 'login' %></p>
45
5<p><label for="password">Password</label><br/>
6<%= password_field_tag 'password' %></p>
6 <p><label for="password">Senha</label><br/>
7 <%= password_field_tag 'password' %></p>
78
8<!-- Uncomment this if you want this functionality
9<p><label for="remember_me">Remember me:</label>
10<%= check_box_tag 'remember_me' %></p>
11-->
9 <p><label for="remember_me">Manter Logado:</label>
10 <%= check_box_tag 'remember_me' %></p>
1211
13<p><%= submit_tag 'Log in' %></p>
14<% end -%>
12 <p><%= submit_tag 'Log in' %></p>
13 <% end %>
14<% end %>
  
1<% window 'user', 'Novo Usuário' do %>
12<%= error_messages_for :user %>
2<% form_for :user, :url => users_path do |f| -%>
3<% form_for :user, :url => users_path do |f| %>
34<p><label for="login">Login</label><br/>
45<%= f.text_field :login %></p>
56
1414<%= f.password_field :password_confirmation %></p>
1515
1616<p><%= submit_tag 'Sign up' %></p>
17<% end -%>
17<% end %>
18<% end %>
  
1212
1313
1414 end
15 User.create :password => 'teste', :login => 'admin', :email => 'admin@planejamento.com.br', :password_confirmation => 'teste'
1516 end
1617
1718 def self.down
db/schema.rb
(12 / 1)
  
99#
1010# It's strongly recommended to check this file into your version control system.
1111
12ActiveRecord::Schema.define(:version => 9) do
12ActiveRecord::Schema.define(:version => 10) do
1313
1414 create_table "movements", :force => true do |t|
1515 t.text "description"
5151 end
5252
5353 add_index "scheduled_profits", ["month", "day"], :name => "index_scheduled_profits_on_month_and_day"
54
55 create_table "users", :force => true do |t|
56 t.string "login"
57 t.string "email"
58 t.string "crypted_password", :limit => 40
59 t.string "salt", :limit => 40
60 t.datetime "created_at"
61 t.datetime "updated_at"
62 t.string "remember_token"
63 t.datetime "remember_token_expires_at"
64 end
5465
5566end