Guest User

Untitled

a guest
Apr 27th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.15 KB | None | 0 0
  1. Processing UsersController#create (for 127.0.0.1 at 2008-06-07 14:15:47) [POST]
  2. Session ID: BAh7CjoNcGFzc3dvcmQiCXRlc3Q6DGNzcmZfaWQiJTRiZDcxODIzODM2Nzkz
  3. ZTJiMTdmMzRmZDI3YTQxMTUwOgluYW1lIgl0ZXN0Ogl1c2VyMCIKZmxhc2hJ
  4. QzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVz
  5. ZWR7AA==--5258677647f42a7646d9a016d4cefa80c11a8822
  6. Parameters: {"user"=>{"name"=>"test", "password"=>"[FILTERED]"}, "commit"=>"Soumettre", "action"=>"create", "authenticity_token"=>"89bd777f695665d47f0649ebaa02b765edb61daa", "controller"=>"users"}
  7. User Load (0.000462) SELECT * FROM "users" WHERE ("users"."name" = 'test') LIMIT 1
  8.  
  9.  
  10. NameError (undefined local variable or method `password' for #<UsersController:0xb6aa7920>):
  11. /app/controllers/application.rb:34:in `authorized?'
  12. /app/controllers/users_controller.rb:21:in `create'
  13. /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `send'
  14. /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `perform_action_without_filters'
  15. /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:580:in `call_filters'
  16. /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in `perform_action_without_benchmark'
  17. /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
  18. /usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
  19. /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
  20. /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in `perform_action_without_caching'
  21. /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in `perform_action'
  22. /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
  23. /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in `cache'
  24. /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:in `perform_action'
  25. /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `send'
  26. /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `process_without_filters'
  27. /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in `process_without_session_management_support'
  28. /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in `sass_old_process'
  29. /usr/lib/ruby/gems/1.8/gems/haml-2.0.0/lib/sass/plugin/rails.rb:19:in `process'
  30. /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in `process'
  31. /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in `handle_request'
  32. /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch'
  33. /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize'
  34. /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch'
  35. /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi'
  36. /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch'
  37. /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:76:in `process'
  38. /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in `synchronize'
  39. /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in `process'
  40. /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client'
  41. /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'
  42. /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client'
  43. /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
  44. /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize'
  45. /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'
  46. /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
  47. /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize'
  48. /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'
  49. /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'
  50. /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:282:in `run'
  51. /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in `each'
  52. /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in `run'
  53. /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run'
  54. /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/command.rb:212:in `run'
  55. /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
  56. /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in `load'
  57. /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in `load'
  58. /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in'
  59. /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in `load'
  60. /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/servers/mongrel.rb:64
  61. /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
  62. /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
  63. /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
  64. /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in'
  65. /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
  66. /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39
  67. /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
  68. /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
  69. script/server:3
  70.  
  71. Rendering /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/templates/rescues/layout.erb (internal_server_error)
  72.  
  73. ## Controller method (users)
  74. class UsersController < ApplicationController
  75.  
  76. def index
  77. @user = User.new
  78. redirect_to new_users_path
  79. end
  80.  
  81. def show
  82. @user = User.new
  83. end
  84.  
  85. def edit
  86. end
  87.  
  88. def new
  89. end
  90.  
  91. def create
  92. session[:name] = params[:user][:name]
  93. session[:password] = params[:user][:password]
  94. if authorized?
  95. end
  96. redirect_to categories_path
  97. end
  98.  
  99. def update
  100. end
  101.  
  102. def destroy
  103. end
  104.  
  105. end
  106.  
  107. ## Application controller
  108. def authorize
  109. unless authorized?
  110. flash[:notice] = "Accès non autorisé"
  111. redirect_to categories_path
  112. false
  113. end
  114. end
  115.  
  116. def authorized?
  117. @user = User.find_by_name(session[:name])
  118. @user.password == password
  119. end
  120.  
  121. ## View (show.html.haml, the form action)
  122. - form_for @user do |f|
  123. = f.text_field :name
  124. = f.text_field :password
  125. = submit_tag "Soumettre"
  126. - if authorized?
  127. vroum
Add Comment
Please, Sign In to add comment