Commit ade6642ede47ccc3f785c5ff5b7d2151625d52fb
authentication, I think it is best to remove restful authentication plugin from vendor/plugins, but it will be there for a while
| |   |
| 3 | 3 | |
| 4 | 4 | class ApplicationController < ActionController::Base |
| 5 | 5 | include AuthenticatedSystem |
|
| before_filter :login_required |
| 6 | 8 | |
| 7 | 9 | helper :all # include all helpers, all the time |
| 8 | 10 | |
| 9 | 11 | # See ActionController::RequestForgeryProtection for details |
| 10 | 12 | # Uncomment the :secret if you're not using the cookie session store |
| 11 | 13 | # protect_from_forgery :secret => '78176fd716a1af43463c18f52d7203bf' |
| |
|
| 13 | 15 | end |
| |   |
| 28 | 28 | flash[:notice] = "You have been logged out." |
| 29 | 29 | redirect_back_or_default('/') |
| 30 | 30 | end |
|
| def authorized? |
| true |
| end |
| 31 | 35 | end |
| |   |
| 24 | 24 | end |
| 25 | 25 | end |
| 26 | 26 | |
| def authorized? |
| true |
| end |
|
| 27 | 31 | end |
| |   |
| <% form_tag session_path do -%> |
| <p><label for="login">Login</label><br/> |
| <%= text_field_tag 'login' %></p> |
| <% window 'login', "Autenticação" do %> |
| <% form_tag session_path do %> |
| <p><label for="login">Login</label><br/> |
| <%= text_field_tag 'login' %></p> |
| 4 | 5 | |
| <p><label for="password">Password</label><br/> |
| <%= password_field_tag 'password' %></p> |
| <p><label for="password">Senha</label><br/> |
| <%= password_field_tag 'password' %></p> |
| 7 | 8 | |
| <!-- Uncomment this if you want this functionality |
| <p><label for="remember_me">Remember me:</label> |
| <%= check_box_tag 'remember_me' %></p> |
| --> |
| <p><label for="remember_me">Manter Logado:</label> |
| <%= check_box_tag 'remember_me' %></p> |
| 12 | 11 | |
| <p><%= submit_tag 'Log in' %></p> |
| <% end -%> |
| <p><%= submit_tag 'Log in' %></p> |
| <% end %> |
| <% end %> |
| |   |
| <% window 'user', 'Novo Usuário' do %> |
| 1 | 2 | <%= error_messages_for :user %> |
| <% form_for :user, :url => users_path do |f| -%> |
| <% form_for :user, :url => users_path do |f| %> |
| 3 | 4 | <p><label for="login">Login</label><br/> |
| 4 | 5 | <%= f.text_field :login %></p> |
| 5 | 6 | |
| … | … | |
| 14 | 14 | <%= f.password_field :password_confirmation %></p> |
| 15 | 15 | |
| 16 | 16 | <p><%= submit_tag 'Sign up' %></p> |
| <% end -%> |
| <% end %> |
| <% end %> |
| |   |
| 12 | 12 | |
| 13 | 13 | |
| 14 | 14 | end |
| User.create :password => 'teste', :login => 'admin', :email => 'admin@planejamento.com.br', :password_confirmation => 'teste' |
| 15 | 16 | end |
| 16 | 17 | |
| 17 | 18 | def self.down |
| |   |
| 9 | 9 | # |
| 10 | 10 | # It's strongly recommended to check this file into your version control system. |
| 11 | 11 | |
| ActiveRecord::Schema.define(:version => 9) do |
| ActiveRecord::Schema.define(:version => 10) do |
| 13 | 13 | |
| 14 | 14 | create_table "movements", :force => true do |t| |
| 15 | 15 | t.text "description" |
| … | … | |
| 51 | 51 | end |
| 52 | 52 | |
| 53 | 53 | add_index "scheduled_profits", ["month", "day"], :name => "index_scheduled_profits_on_month_and_day" |
|
| create_table "users", :force => true do |t| |
| t.string "login" |
| t.string "email" |
| t.string "crypted_password", :limit => 40 |
| t.string "salt", :limit => 40 |
| t.datetime "created_at" |
| t.datetime "updated_at" |
| t.string "remember_token" |
| t.datetime "remember_token_expires_at" |
| end |
| 54 | 65 | |
| 55 | 66 | end |