Hi,
I''m having some problems with the salted hash login generator. I
installed the login and localization generator gems. I applied the
generated DB script, added the following to my environment.rb:
require ''environments/user_environment''
require ''environments/localization_environment''
require ''localization''
Localization::load_localized_strings
My application.rb looks like this:
require ''user_system''
require ''localization''
class ApplicationController < ActionController::Base
include UserSystem
include Localization
helper :user
before_filter :login_required
end
And I''ve edited the relevent environment files. When trying to signup
for the first time, I just get returned to the signup page with no
error appearing in the log. The email that would be sent is displayed
in the log, but nothing is placed in the users table.
I did try following the verification link, and get the following error
in the log which imples User is not working properly:
NoMethodError (undefined method `[]'' for nil:NilClass):
app/controllers/user_controller.rb:8:in `login''
Which refers to this code:
5 def login
6 generate_blank
7 @user = User.new(@params[''user''])
8 if @session[''user'']
User.authenticate(@params[''user''][''login''],
@params[''user''][''password''])
9 flash[''notice''] = l(:user_login_succeeded)
10 redirect_back_or_default :action => ''welcome''
11 else
12 @login = @params[''user''][''login'']
13 flash.now[''message''] = l(:user_login_failed)
14 end
15 end
I tried running the unit tests and get the following faliures:
1) Failure:
test_auth(UserTest) [./test/unit/user_test.rb:8]:
<#<User:0x2338558
@attributes
{"salt"=>"7f8b036f9b647d46d22abdbfc8113f44a88f9889",
"role"=>nil,
"security_token"=>nil,
"id"=>"1000001",
"firstname"=>"",
"lastname"=>"",
"token_expiry"=>nil,
"deleted"=>nil,
"verified"=>"1",
"login"=>"bob",
"password"=>"",
"salted_password"=>"ef94c16f6c124a4e84cc215c164767bfa25f6e92",
"email"=>"bob-J0of1frlU80@public.gmane.org"}>>
expected but was
<nil>.
2) Failure:
test_passwordchange(UserTest) [./test/unit/user_test.rb:20]:
<#<User:0x221cb88
@attributes
{"salt"=>"2c689c879bb8f7597f6123e95a5a2ff27e9de974",
"role"=>nil,
"security_token"=>nil,
"id"=>"1000003",
"firstname"=>"",
"lastname"=>"",
"token_expiry"=>nil,
"deleted"=>nil,
"verified"=>"1",
"login"=>"longbob",
"password"=>"",
"salted_password"=>"cbc27b79e7bed99bfdfb01da7271d8a40321d684",
"email"=>"longbob-J0of1frlU80@public.gmane.org"},
@errors #<ActiveRecord::Errors:0x221958c @base=#<User:0x221cb88 ...>,
@errors={}>,
@new_password=false,
@password="nonbobpasswd",
@password_confirmation="nonbobpasswd">> expected but was
<nil>.
Does anyone have any ideas? I''m running on OSX 10.4, MySQL, and the
following gems:
actionmailer (0.9.0, 0.8.1)
Service layer for easy email delivery and testing.
actionpack (1.8.0, 1.7.0)
Web-flow and rendering framework putting the VC in MVC.
actionwebservice (0.7.0, 0.6.2)
Web service support for Action Pack.
activerecord (1.10.0, 1.9.1)
Implements the ActiveRecord pattern for ORM.
activesupport (1.0.4, 1.0.3)
Support and utility classes used by the Rails framework.
db_structure (1.0.2)
[Rails] Database utilities.
localization_generator (1.0.7)
[Rails] Localization generator.
rails (0.12.0, 0.11.1)
Web-application framework with template engine, control-flow layer,
and ORM.
rake (0.5.3)
Ruby based make-like utility.
salted_login_generator (1.0.6)
[Rails] Login generator with salted passwords.
sources (0.0.1)
This package provides download sources for remote gem installation
Thanks in advance,
--
sam
http://www.magpiebrain.com/
Hi All, I''m gettting a similar problem, only it''s displaying "Error creating account: confirmation email not sent", and I can''t even find that error message anywhere in the source ! Nothing is being created in the database either, so I presume it''s when it''s trying to do the insert ? Stew On 5/8/05, Sam Newman <sam.newman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi, > > I''m having some problems with the salted hash login generator. I > installed the login and localization generator gems. I applied the > generated DB script, added the following to my environment.rb: > > require ''environments/user_environment'' > require ''environments/localization_environment'' > require ''localization'' > Localization::load_localized_strings > > My application.rb looks like this: > > require ''user_system'' > require ''localization'' > > class ApplicationController < ActionController::Base > include UserSystem > include Localization > helper :user > before_filter :login_required > > end > > And I''ve edited the relevent environment files. When trying to signup > for the first time, I just get returned to the signup page with no > error appearing in the log. The email that would be sent is displayed > in the log, but nothing is placed in the users table. > > I did try following the verification link, and get the following error > in the log which imples User is not working properly: > > NoMethodError (undefined method `[]'' for nil:NilClass): > app/controllers/user_controller.rb:8:in `login'' > > Which refers to this code: > > 5 def login > 6 generate_blank > 7 @user = User.new(@params[''user'']) > 8 if @session[''user''] > User.authenticate(@params[''user''][''login''], > @params[''user''][''password'']) > 9 flash[''notice''] = l(:user_login_succeeded) > 10 redirect_back_or_default :action => ''welcome'' > 11 else > 12 @login = @params[''user''][''login''] > 13 flash.now[''message''] = l(:user_login_failed) > 14 end > 15 end > > I tried running the unit tests and get the following faliures: > > 1) Failure: > test_auth(UserTest) [./test/unit/user_test.rb:8]: > <#<User:0x2338558 > @attributes> {"salt"=>"7f8b036f9b647d46d22abdbfc8113f44a88f9889", > "role"=>nil, > "security_token"=>nil, > "id"=>"1000001", > "firstname"=>"", > "lastname"=>"", > "token_expiry"=>nil, > "deleted"=>nil, > "verified"=>"1", > "login"=>"bob", > "password"=>"", > "salted_password"=>"ef94c16f6c124a4e84cc215c164767bfa25f6e92", > "email"=>"bob-J0of1frlU80@public.gmane.org"}>> expected but was > <nil>. > > 2) Failure: > test_passwordchange(UserTest) [./test/unit/user_test.rb:20]: > <#<User:0x221cb88 > @attributes> {"salt"=>"2c689c879bb8f7597f6123e95a5a2ff27e9de974", > "role"=>nil, > "security_token"=>nil, > "id"=>"1000003", > "firstname"=>"", > "lastname"=>"", > "token_expiry"=>nil, > "deleted"=>nil, > "verified"=>"1", > "login"=>"longbob", > "password"=>"", > "salted_password"=>"cbc27b79e7bed99bfdfb01da7271d8a40321d684", > "email"=>"longbob-J0of1frlU80@public.gmane.org"}, > @errors> #<ActiveRecord::Errors:0x221958c @base=#<User:0x221cb88 ...>, @errors={}>, > @new_password=false, > @password="nonbobpasswd", > @password_confirmation="nonbobpasswd">> expected but was > <nil>. > > Does anyone have any ideas? I''m running on OSX 10.4, MySQL, and the > following gems: > > actionmailer (0.9.0, 0.8.1) > Service layer for easy email delivery and testing. > > actionpack (1.8.0, 1.7.0) > Web-flow and rendering framework putting the VC in MVC. > > actionwebservice (0.7.0, 0.6.2) > Web service support for Action Pack. > > activerecord (1.10.0, 1.9.1) > Implements the ActiveRecord pattern for ORM. > > activesupport (1.0.4, 1.0.3) > Support and utility classes used by the Rails framework. > > db_structure (1.0.2) > [Rails] Database utilities. > > localization_generator (1.0.7) > [Rails] Localization generator. > > rails (0.12.0, 0.11.1) > Web-application framework with template engine, control-flow layer, > and ORM. > > rake (0.5.3) > Ruby based make-like utility. > > salted_login_generator (1.0.6) > [Rails] Login generator with salted passwords. > > sources (0.0.1) > This package provides download sources for remote gem installation > > Thanks in advance, > > -- > sam > http://www.magpiebrain.com/ > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Sun, 2005-05-08 at 10:07, stew "stewbagz" mercer wrote:> Hi All, > > I''m gettting a similar problem, only it''s displaying "Error creating > account: confirmation email not sent", and I can''t even find that > error message anywhere in the source ! > > Nothing is being created in the database either, so I presume it''s > when it''s trying to do the insert ? > > StewI found that removing the "created_at", "updated_at" and "logged_in_at" fields in the database (I am using postgres), then it will work. I am using the version prior to the recent update, so I don''t know if this problem still exists. Brian
I created a simple unit test to try and work out what the problem is:
def test_save
user = User.new
user.salted_password = "tester"
user.password = "0123456789012345678901234567890123456789"
user.login="tester"
user.email="test-J0of1frlU80@public.gmane.org"
user.firstname="first"
user.lastname="last"
user.salt="0123456789012345678901234567890123456789"
puts "User has password: #{user.password}, login #{user.login}"
saved = user.save
user.errors.each_full{|err| puts err}
assert_equal(true, saved)
end
When I run this, I get the following error string:
User has password: 0123456789012345678901234567890123456789, login tester
Password is too long (max is 40 characters)
Password is too short (min is 5 characters)
Password can''t be empty
Which doesn''t make sense, as password has been set. The other tests do
seem to be able to save Users, so I''m not sure this is the root
problem - but if anyone can see what the problem in either the above
test or the original problem I''d apreciate it.
Anyway I''ll keep digging.
sam
On 5/8/05, Sam Newman <sam.newman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi,
>
> I''m having some problems with the salted hash login generator. I
> installed the login and localization generator gems. I applied the
> generated DB script, added the following to my environment.rb:
>
> require ''environments/user_environment''
> require ''environments/localization_environment''
> require ''localization''
> Localization::load_localized_strings
>
> My application.rb looks like this:
>
> require ''user_system''
> require ''localization''
>
> class ApplicationController < ActionController::Base
> include UserSystem
> include Localization
> helper :user
> before_filter :login_required
>
> end
>
> And I''ve edited the relevent environment files. When trying to
signup
> for the first time, I just get returned to the signup page with no
> error appearing in the log. The email that would be sent is displayed
> in the log, but nothing is placed in the users table.
>
> I did try following the verification link, and get the following error
> in the log which imples User is not working properly:
>
> NoMethodError (undefined method `[]'' for nil:NilClass):
> app/controllers/user_controller.rb:8:in `login''
>
> Which refers to this code:
>
> 5 def login
> 6 generate_blank
> 7 @user = User.new(@params[''user''])
> 8 if @session[''user''] >
User.authenticate(@params[''user''][''login''],
> @params[''user''][''password''])
> 9 flash[''notice''] = l(:user_login_succeeded)
> 10 redirect_back_or_default :action => ''welcome''
> 11 else
> 12 @login =
@params[''user''][''login'']
> 13 flash.now[''message''] = l(:user_login_failed)
> 14 end
> 15 end
>
> I tried running the unit tests and get the following faliures:
>
> 1) Failure:
> test_auth(UserTest) [./test/unit/user_test.rb:8]:
> <#<User:0x2338558
> @attributes>
{"salt"=>"7f8b036f9b647d46d22abdbfc8113f44a88f9889",
> "role"=>nil,
> "security_token"=>nil,
> "id"=>"1000001",
> "firstname"=>"",
> "lastname"=>"",
> "token_expiry"=>nil,
> "deleted"=>nil,
> "verified"=>"1",
> "login"=>"bob",
> "password"=>"",
>
"salted_password"=>"ef94c16f6c124a4e84cc215c164767bfa25f6e92",
>
"email"=>"bob-J0of1frlU80@public.gmane.org"}>>
expected but was
> <nil>.
>
> 2) Failure:
> test_passwordchange(UserTest) [./test/unit/user_test.rb:20]:
> <#<User:0x221cb88
> @attributes>
{"salt"=>"2c689c879bb8f7597f6123e95a5a2ff27e9de974",
> "role"=>nil,
> "security_token"=>nil,
> "id"=>"1000003",
> "firstname"=>"",
> "lastname"=>"",
> "token_expiry"=>nil,
> "deleted"=>nil,
> "verified"=>"1",
> "login"=>"longbob",
> "password"=>"",
>
"salted_password"=>"cbc27b79e7bed99bfdfb01da7271d8a40321d684",
> "email"=>"longbob-J0of1frlU80@public.gmane.org"},
> @errors> #<ActiveRecord::Errors:0x221958c
@base=#<User:0x221cb88 ...>, @errors={}>,
> @new_password=false,
> @password="nonbobpasswd",
> @password_confirmation="nonbobpasswd">> expected but was
> <nil>.
>
> Does anyone have any ideas? I''m running on OSX 10.4, MySQL, and
the
> following gems:
>
> actionmailer (0.9.0, 0.8.1)
> Service layer for easy email delivery and testing.
>
> actionpack (1.8.0, 1.7.0)
> Web-flow and rendering framework putting the VC in MVC.
>
> actionwebservice (0.7.0, 0.6.2)
> Web service support for Action Pack.
>
> activerecord (1.10.0, 1.9.1)
> Implements the ActiveRecord pattern for ORM.
>
> activesupport (1.0.4, 1.0.3)
> Support and utility classes used by the Rails framework.
>
> db_structure (1.0.2)
> [Rails] Database utilities.
>
> localization_generator (1.0.7)
> [Rails] Localization generator.
>
> rails (0.12.0, 0.11.1)
> Web-application framework with template engine, control-flow layer,
> and ORM.
>
> rake (0.5.3)
> Ruby based make-like utility.
>
> salted_login_generator (1.0.6)
> [Rails] Login generator with salted passwords.
>
> sources (0.0.1)
> This package provides download sources for remote gem installation
>
> Thanks in advance,
>
> --
> sam
> http://www.magpiebrain.com/
>
--
sam
http://www.magpiebrain.com/
Stew,
You probably have a configuration error with your ActionMailer
setup. You can re-raise the exception in the rescue clause in the
signup method to see what the actual error causing the exception is.
That localized string is in the lang/en.yaml file, and is represented
by the symbol is the rescue clause in the call to the ''l''
method.
In a future release, I''m going to fix this so that the exception
prints the actual message for the exception raised by ActionMailer.
Joe
On May 8, 2005, at 10:07 AM, stew stewbagz mercer wrote:
> Hi All,
>
> I''m gettting a similar problem, only it''s displaying
"Error
> creating account: confirmation email not sent", and I can''t
even
> find that error message anywhere in the source !
>
> Nothing is being created in the database either, so I presume it''s
> when it''s trying to do the insert ?
>
> Stew
>
>
>
>
> On 5/8/05, Sam Newman
<sam.newman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi,
>
> I''m having some problems with the salted hash login generator. I
> installed the login and localization generator gems. I applied the
> generated DB script, added the following to my environment.rb:
>
> require ''environments/user_environment''
> require ''environments/localization_environment''
> require ''localization''
> Localization::load_localized_strings
>
> My application.rb looks like this:
>
> require ''user_system''
> require ''localization''
>
> class ApplicationController < ActionController::Base
> include UserSystem
> include Localization
> helper :user
> before_filter :login_required
>
> end
>
> And I''ve edited the relevent environment files. When trying to
signup
> for the first time, I just get returned to the signup page with no
> error appearing in the log. The email that would be sent is displayed
> in the log, but nothing is placed in the users table.
>
> I did try following the verification link, and get the following error
> in the log which imples User is not working properly:
>
> NoMethodError (undefined method `[]'' for nil:NilClass):
> app/controllers/user_controller.rb:8:in `login''
>
> Which refers to this code:
>
> 5 def login
> 6 generate_blank
> 7 @user = User.new(@params[''user''])
> 8 if @session[''user''] > User.authenticate
(@params[''user''][''login''],
> @params[''user''][''password''])
> 9 flash[''notice''] = l(:user_login_succeeded)
> 10 redirect_back_or_default :action => ''welcome''
> 11 else
> 12 @login =
@params[''user''][''login'']
> 13 flash.now[''message''] = l(:user_login_failed)
> 14 end
> 15 end
>
> I tried running the unit tests and get the following faliures:
>
> 1) Failure:
> test_auth(UserTest) [./test/unit/user_test.rb:8]:
> <#<User:0x2338558
> @attributes>
{"salt"=>"7f8b036f9b647d46d22abdbfc8113f44a88f9889",
> "role"=>nil,
> "security_token"=>nil,
> "id"=>"1000001",
> "firstname"=>"",
> "lastname"=>"",
> "token_expiry"=>nil,
> "deleted"=>nil,
> "verified"=>"1",
> "login"=>"bob",
> "password"=>"",
>
"salted_password"=>"ef94c16f6c124a4e84cc215c164767bfa25f6e92",
>
"email"=>"bob-J0of1frlU80@public.gmane.org"}>>
expected but was
> <nil>.
>
> 2) Failure:
> test_passwordchange(UserTest) [./test/unit/user_test.rb:20]:
> <#<User:0x221cb88
> @attributes>
{"salt"=>"2c689c879bb8f7597f6123e95a5a2ff27e9de974",
> "role"=>nil,
> "security_token"=>nil,
> "id"=>"1000003",
> "firstname"=>"",
> "lastname"=>"",
> "token_expiry"=>nil,
> "deleted"=>nil,
> "verified"=>"1",
> "login"=>"longbob",
> "password"=>"",
>
"salted_password"=>"cbc27b79e7bed99bfdfb01da7271d8a40321d684",
> "email"=>"longbob-J0of1frlU80@public.gmane.org"},
> @errors> #<ActiveRecord::Errors:0x221958c @base=#<User:0x221cb88
...>,
> @errors={}>,
> @new_password=false,
> @password="nonbobpasswd",
> @password_confirmation="nonbobpasswd">> expected but was
> <nil>.
>
> Does anyone have any ideas? I''m running on OSX 10.4, MySQL, and
the
> following gems:
>
> actionmailer (0.9.0, 0.8.1)
> Service layer for easy email delivery and testing.
>
> actionpack (1.8.0, 1.7.0)
> Web-flow and rendering framework putting the VC in MVC.
>
> actionwebservice (0.7.0, 0.6.2 )
> Web service support for Action Pack.
>
> activerecord (1.10.0, 1.9.1)
> Implements the ActiveRecord pattern for ORM.
>
> activesupport (1.0.4, 1.0.3)
> Support and utility classes used by the Rails framework.
>
> db_structure (1.0.2)
> [Rails] Database utilities.
>
> localization_generator (1.0.7)
> [Rails] Localization generator.
>
> rails (0.12.0, 0.11.1)
> Web-application framework with template engine, control-flow layer,
> and ORM.
>
> rake (0.5.3)
> Ruby based make-like utility.
>
> salted_login_generator (1.0.6)
> [Rails] Login generator with salted passwords.
>
> sources (0.0.1)
> This package provides download sources for remote gem installation
>
> Thanks in advance,
>
> --
> sam
> http://www.magpiebrain.com/
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails
On 5/8/05, Brian Olsen <brian-PsW/4IK4rJfby3iVrkZq2A@public.gmane.org> wrote:> > On Sun, 2005-05-08 at 10:07, stew "stewbagz" mercer wrote: > > Hi All, > > > > I''m gettting a similar problem, only it''s displaying "Error creating > > account: confirmation email not sent", and I can''t even find that > > error message anywhere in the source ! > > > > Nothing is being created in the database either, so I presume it''s > > when it''s trying to do the insert ? > > > > Stew > > I found that removing the "created_at", "updated_at" and "logged_in_at" > fields in the database (I am using postgres), then it will work. I am > using the version prior to the recent update, so I don''t know if this > problem still exists. > > BrianI tried dropping those columns from the database, but no dice :( Stew _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Sam,
This test case is not going to work because of the way the
password hashing and validation is done. I forget why both the "too
long" and "too short" messages are seen. I recall seeing this
before,
and it may have been due to a bug in the within validation code, but
I''m not positive on that.
As for your original problem, let me take a few minutes and look
at your error log and see what I can find. Can you send me your DB
schema? Did you just basically use the supplied schema?
Joe
On May 8, 2005, at 11:26 AM, Sam Newman wrote:
> I created a simple unit test to try and work out what the problem is:
>
> def test_save
> user = User.new
> user.salted_password = "tester"
> user.password = "0123456789012345678901234567890123456789"
> user.login="tester"
> user.email="test-J0of1frlU80@public.gmane.org"
> user.firstname="first"
> user.lastname="last"
> user.salt="0123456789012345678901234567890123456789"
> puts "User has password: #{user.password}, login
#{user.login}"
> saved = user.save
> user.errors.each_full{|err| puts err}
> assert_equal(true, saved)
> end
>
> When I run this, I get the following error string:
>
> User has password: 0123456789012345678901234567890123456789, login
> tester
> Password is too long (max is 40 characters)
> Password is too short (min is 5 characters)
> Password can''t be empty
>
> Which doesn''t make sense, as password has been set. The other
tests do
> seem to be able to save Users, so I''m not sure this is the root
> problem - but if anyone can see what the problem in either the above
> test or the original problem I''d apreciate it.
>
> Anyway I''ll keep digging.
>
> sam
>
> On 5/8/05, Sam Newman
<sam.newman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>> Hi,
>>
>> I''m having some problems with the salted hash login generator.
I
>> installed the login and localization generator gems. I applied the
>> generated DB script, added the following to my environment.rb:
>>
>> require ''environments/user_environment''
>> require ''environments/localization_environment''
>> require ''localization''
>> Localization::load_localized_strings
>>
>> My application.rb looks like this:
>>
>> require ''user_system''
>> require ''localization''
>>
>> class ApplicationController < ActionController::Base
>> include UserSystem
>> include Localization
>> helper :user
>> before_filter :login_required
>>
>> end
>>
>> And I''ve edited the relevent environment files. When trying to
signup
>> for the first time, I just get returned to the signup page with no
>> error appearing in the log. The email that would be sent is displayed
>> in the log, but nothing is placed in the users table.
>>
>> I did try following the verification link, and get the following
>> error
>> in the log which imples User is not working properly:
>>
>> NoMethodError (undefined method `[]'' for nil:NilClass):
>> app/controllers/user_controller.rb:8:in `login''
>>
>> Which refers to this code:
>>
>> 5 def login
>> 6 generate_blank
>> 7 @user = User.new(@params[''user''])
>> 8 if @session[''user''] >>
User.authenticate(@params[''user''][''login''],
>> @params[''user''][''password''])
>> 9 flash[''notice''] = l(:user_login_succeeded)
>> 10 redirect_back_or_default :action =>
''welcome''
>> 11 else
>> 12 @login =
@params[''user''][''login'']
>> 13 flash.now[''message''] = l(:user_login_failed)
>> 14 end
>> 15 end
>>
>> I tried running the unit tests and get the following faliures:
>>
>> 1) Failure:
>> test_auth(UserTest) [./test/unit/user_test.rb:8]:
>> <#<User:0x2338558
>> @attributes>>
{"salt"=>"7f8b036f9b647d46d22abdbfc8113f44a88f9889",
>> "role"=>nil,
>> "security_token"=>nil,
>> "id"=>"1000001",
>> "firstname"=>"",
>> "lastname"=>"",
>> "token_expiry"=>nil,
>> "deleted"=>nil,
>> "verified"=>"1",
>> "login"=>"bob",
>> "password"=>"",
>>
"salted_password"=>"ef94c16f6c124a4e84cc215c164767bfa25f6e92",
>>
"email"=>"bob-J0of1frlU80@public.gmane.org"}>>
expected but was
>> <nil>.
>>
>> 2) Failure:
>> test_passwordchange(UserTest) [./test/unit/user_test.rb:20]:
>> <#<User:0x221cb88
>> @attributes>>
{"salt"=>"2c689c879bb8f7597f6123e95a5a2ff27e9de974",
>> "role"=>nil,
>> "security_token"=>nil,
>> "id"=>"1000003",
>> "firstname"=>"",
>> "lastname"=>"",
>> "token_expiry"=>nil,
>> "deleted"=>nil,
>> "verified"=>"1",
>> "login"=>"longbob",
>> "password"=>"",
>>
"salted_password"=>"cbc27b79e7bed99bfdfb01da7271d8a40321d684",
>>
"email"=>"longbob-J0of1frlU80@public.gmane.org"},
>> @errors>> #<ActiveRecord::Errors:0x221958c
@base=#<User:0x221cb88 ...>,
>> @errors={}>,
>> @new_password=false,
>> @password="nonbobpasswd",
>> @password_confirmation="nonbobpasswd">> expected but
was
>> <nil>.
>>
>> Does anyone have any ideas? I''m running on OSX 10.4, MySQL,
and the
>> following gems:
>>
>> actionmailer (0.9.0, 0.8.1)
>> Service layer for easy email delivery and testing.
>>
>> actionpack (1.8.0, 1.7.0)
>> Web-flow and rendering framework putting the VC in MVC.
>>
>> actionwebservice (0.7.0, 0.6.2)
>> Web service support for Action Pack.
>>
>> activerecord (1.10.0, 1.9.1)
>> Implements the ActiveRecord pattern for ORM.
>>
>> activesupport (1.0.4, 1.0.3)
>> Support and utility classes used by the Rails framework.
>>
>> db_structure (1.0.2)
>> [Rails] Database utilities.
>>
>> localization_generator (1.0.7)
>> [Rails] Localization generator.
>>
>> rails (0.12.0, 0.11.1)
>> Web-application framework with template engine, control-flow
>> layer,
>> and ORM.
>>
>> rake (0.5.3)
>> Ruby based make-like utility.
>>
>> salted_login_generator (1.0.6)
>> [Rails] Login generator with salted passwords.
>>
>> sources (0.0.1)
>> This package provides download sources for remote gem
>> installation
>>
>> Thanks in advance,
>>
>> --
>> sam
>> http://www.magpiebrain.com/
>>
>>
>
>
> --
> sam
> http://www.magpiebrain.com/
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
I managed to fix the unit test problem by putting in a deleted value into the test fixture: bob: id: 1000001 login: bob salted_password: ef94c16f6c124a4e84cc215c164767bfa25f6e92 # atest salt: 7f8b036f9b647d46d22abdbfc8113f44a88f9889 email: bob-J0of1frlU80@public.gmane.org verified: 1 deleted: 0 # fix longbob: id: 1000003 login: longbob salted_password: c841391e1d29100a4920de7a8fbb4b0fd180c6c0 # alongtest salt: c068e3671780f16898c0a8295ae8d82cc59713e2 email: longbob-J0of1frlU80@public.gmane.org verified: 1 deleted: 0 # fix Still working on my problems and the functional test faliures...> On 5/8/05, Sam Newman <sam.newman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi, > > > > I''m having some problems with the salted hash login generator. I > > installed the login and localization generator gems. I applied the > > generated DB script, added the following to my environment.rb: > > > > require ''environments/user_environment'' > > require ''environments/localization_environment'' > > require ''localization'' > > Localization::load_localized_strings > > > > My application.rb looks like this: > > > > require ''user_system'' > > require ''localization'' > > > > class ApplicationController < ActionController::Base > > include UserSystem > > include Localization > > helper :user > > before_filter :login_required > > > > end > > > > And I''ve edited the relevent environment files. When trying to signup > > for the first time, I just get returned to the signup page with no > > error appearing in the log. The email that would be sent is displayed > > in the log, but nothing is placed in the users table. > > > > I did try following the verification link, and get the following error > > in the log which imples User is not working properly: > > > > NoMethodError (undefined method `[]'' for nil:NilClass): > > app/controllers/user_controller.rb:8:in `login'' > > > > Which refers to this code: > > > > 5 def login > > 6 generate_blank > > 7 @user = User.new(@params[''user'']) > > 8 if @session[''user''] > > User.authenticate(@params[''user''][''login''], > > @params[''user''][''password'']) > > 9 flash[''notice''] = l(:user_login_succeeded) > > 10 redirect_back_or_default :action => ''welcome'' > > 11 else > > 12 @login = @params[''user''][''login''] > > 13 flash.now[''message''] = l(:user_login_failed) > > 14 end > > 15 end > > > > I tried running the unit tests and get the following faliures: > > > > 1) Failure: > > test_auth(UserTest) [./test/unit/user_test.rb:8]: > > <#<User:0x2338558 > > @attributes> > {"salt"=>"7f8b036f9b647d46d22abdbfc8113f44a88f9889", > > "role"=>nil, > > "security_token"=>nil, > > "id"=>"1000001", > > "firstname"=>"", > > "lastname"=>"", > > "token_expiry"=>nil, > > "deleted"=>nil, > > "verified"=>"1", > > "login"=>"bob", > > "password"=>"", > > "salted_password"=>"ef94c16f6c124a4e84cc215c164767bfa25f6e92", > > "email"=>"bob-J0of1frlU80@public.gmane.org"}>> expected but was > > <nil>. > > > > 2) Failure: > > test_passwordchange(UserTest) [./test/unit/user_test.rb:20]: > > <#<User:0x221cb88 > > @attributes> > {"salt"=>"2c689c879bb8f7597f6123e95a5a2ff27e9de974", > > "role"=>nil, > > "security_token"=>nil, > > "id"=>"1000003", > > "firstname"=>"", > > "lastname"=>"", > > "token_expiry"=>nil, > > "deleted"=>nil, > > "verified"=>"1", > > "login"=>"longbob", > > "password"=>"", > > "salted_password"=>"cbc27b79e7bed99bfdfb01da7271d8a40321d684", > > "email"=>"longbob-J0of1frlU80@public.gmane.org"}, > > @errors> > #<ActiveRecord::Errors:0x221958c @base=#<User:0x221cb88 ...>, @errors={}>, > > @new_password=false, > > @password="nonbobpasswd", > > @password_confirmation="nonbobpasswd">> expected but was > > <nil>. > > > > Does anyone have any ideas? I''m running on OSX 10.4, MySQL, and the > > following gems: > > > > actionmailer (0.9.0, 0.8.1) > > Service layer for easy email delivery and testing. > > > > actionpack (1.8.0, 1.7.0) > > Web-flow and rendering framework putting the VC in MVC. > > > > actionwebservice (0.7.0, 0.6.2) > > Web service support for Action Pack. > > > > activerecord (1.10.0, 1.9.1) > > Implements the ActiveRecord pattern for ORM. > > > > activesupport (1.0.4, 1.0.3) > > Support and utility classes used by the Rails framework. > > > > db_structure (1.0.2) > > [Rails] Database utilities. > > > > localization_generator (1.0.7) > > [Rails] Localization generator. > > > > rails (0.12.0, 0.11.1) > > Web-application framework with template engine, control-flow layer, > > and ORM. > > > > rake (0.5.3) > > Ruby based make-like utility. > > > > salted_login_generator (1.0.6) > > [Rails] Login generator with salted passwords. > > > > sources (0.0.1) > > This package provides download sources for remote gem installation > > > > Thanks in advance, > > > > -- > > sam > > http://www.magpiebrain.com/ > > > > -- > sam > http://www.magpiebrain.com/ >-- sam http://www.magpiebrain.com/
Sam,
The schema you sent me should have the line:
`deleted` int(11) default 0
instead of:
`deleted` int(11) default NULL
I just looked at the gem, and it appears to have the correct
line in it. Still looking at your other problem...
Joe
On May 8, 2005, at 12:07 PM, Sam Newman wrote:
> I managed to fix the unit test problem by putting in a deleted value
> into the test fixture:
>
> bob:
> id: 1000001
> login: bob
> salted_password: ef94c16f6c124a4e84cc215c164767bfa25f6e92 # atest
> salt: 7f8b036f9b647d46d22abdbfc8113f44a88f9889
> email: bob-J0of1frlU80@public.gmane.org
> verified: 1
> deleted: 0 # fix
>
> longbob:
> id: 1000003
> login: longbob
> salted_password: c841391e1d29100a4920de7a8fbb4b0fd180c6c0 #
> alongtest
> salt: c068e3671780f16898c0a8295ae8d82cc59713e2
> email: longbob-J0of1frlU80@public.gmane.org
> verified: 1
> deleted: 0 # fix
>
> Still working on my problems and the functional test faliures...
>
>
>> On 5/8/05, Sam Newman
<sam.newman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>
>>> Hi,
>>>
>>> I''m having some problems with the salted hash login
generator. I
>>> installed the login and localization generator gems. I applied the
>>> generated DB script, added the following to my environment.rb:
>>>
>>> require ''environments/user_environment''
>>> require ''environments/localization_environment''
>>> require ''localization''
>>> Localization::load_localized_strings
>>>
>>> My application.rb looks like this:
>>>
>>> require ''user_system''
>>> require ''localization''
>>>
>>> class ApplicationController < ActionController::Base
>>> include UserSystem
>>> include Localization
>>> helper :user
>>> before_filter :login_required
>>>
>>> end
>>>
>>> And I''ve edited the relevent environment files. When
trying to
>>> signup
>>> for the first time, I just get returned to the signup page with no
>>> error appearing in the log. The email that would be sent is
>>> displayed
>>> in the log, but nothing is placed in the users table.
>>>
>>> I did try following the verification link, and get the following
>>> error
>>> in the log which imples User is not working properly:
>>>
>>> NoMethodError (undefined method `[]'' for nil:NilClass):
>>> app/controllers/user_controller.rb:8:in `login''
>>>
>>> Which refers to this code:
>>>
>>> 5 def login
>>> 6 generate_blank
>>> 7 @user = User.new(@params[''user''])
>>> 8 if @session[''user''] >>>
User.authenticate(@params[''user''][''login''],
>>> @params[''user''][''password''])
>>> 9 flash[''notice''] =
l(:user_login_succeeded)
>>> 10 redirect_back_or_default :action =>
''welcome''
>>> 11 else
>>> 12 @login =
@params[''user''][''login'']
>>> 13 flash.now[''message''] =
l(:user_login_failed)
>>> 14 end
>>> 15 end
>>>
>>> I tried running the unit tests and get the following faliures:
>>>
>>> 1) Failure:
>>> test_auth(UserTest) [./test/unit/user_test.rb:8]:
>>> <#<User:0x2338558
>>> @attributes>>>
{"salt"=>"7f8b036f9b647d46d22abdbfc8113f44a88f9889",
>>> "role"=>nil,
>>> "security_token"=>nil,
>>> "id"=>"1000001",
>>> "firstname"=>"",
>>> "lastname"=>"",
>>> "token_expiry"=>nil,
>>> "deleted"=>nil,
>>> "verified"=>"1",
>>> "login"=>"bob",
>>> "password"=>"",
>>>
"salted_password"=>"ef94c16f6c124a4e84cc215c164767bfa25f6e92",
>>>
"email"=>"bob-J0of1frlU80@public.gmane.org"}>>
expected but was
>>> <nil>.
>>>
>>> 2) Failure:
>>> test_passwordchange(UserTest) [./test/unit/user_test.rb:20]:
>>> <#<User:0x221cb88
>>> @attributes>>>
{"salt"=>"2c689c879bb8f7597f6123e95a5a2ff27e9de974",
>>> "role"=>nil,
>>> "security_token"=>nil,
>>> "id"=>"1000003",
>>> "firstname"=>"",
>>> "lastname"=>"",
>>> "token_expiry"=>nil,
>>> "deleted"=>nil,
>>> "verified"=>"1",
>>> "login"=>"longbob",
>>> "password"=>"",
>>>
"salted_password"=>"cbc27b79e7bed99bfdfb01da7271d8a40321d684",
>>>
"email"=>"longbob-J0of1frlU80@public.gmane.org"},
>>> @errors>>> #<ActiveRecord::Errors:0x221958c
@base=#<User:0x221cb88 ...>,
>>> @errors={}>,
>>> @new_password=false,
>>> @password="nonbobpasswd",
>>> @password_confirmation="nonbobpasswd">> expected
but was
>>> <nil>.
>>>
>>> Does anyone have any ideas? I''m running on OSX 10.4,
MySQL, and the
>>> following gems:
>>>
>>> actionmailer (0.9.0, 0.8.1)
>>> Service layer for easy email delivery and testing.
>>>
>>> actionpack (1.8.0, 1.7.0)
>>> Web-flow and rendering framework putting the VC in MVC.
>>>
>>> actionwebservice (0.7.0, 0.6.2)
>>> Web service support for Action Pack.
>>>
>>> activerecord (1.10.0, 1.9.1)
>>> Implements the ActiveRecord pattern for ORM.
>>>
>>> activesupport (1.0.4, 1.0.3)
>>> Support and utility classes used by the Rails framework.
>>>
>>> db_structure (1.0.2)
>>> [Rails] Database utilities.
>>>
>>> localization_generator (1.0.7)
>>> [Rails] Localization generator.
>>>
>>> rails (0.12.0, 0.11.1)
>>> Web-application framework with template engine, control-flow
>>> layer,
>>> and ORM.
>>>
>>> rake (0.5.3)
>>> Ruby based make-like utility.
>>>
>>> salted_login_generator (1.0.6)
>>> [Rails] Login generator with salted passwords.
>>>
>>> sources (0.0.1)
>>> This package provides download sources for remote gem
>>> installation
>>>
>>> Thanks in advance,
>>>
>>> --
>>> sam
>>> http://www.magpiebrain.com/
>>>
>>>
>>
>> --
>> sam
>> http://www.magpiebrain.com/
>>
>>
>
>
> --
> sam
> http://www.magpiebrain.com/
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
Also, did you make any modifications to any of the view template files? My guess is that it is complaining about the @params[''user''] [...] fields, and that can happen if you changed the names in the view without editing the controller as well. Joe On May 8, 2005, at 12:07 PM, Sam Newman wrote:> I managed to fix the unit test problem by putting in a deleted value > into the test fixture: > > bob: > id: 1000001 > login: bob > salted_password: ef94c16f6c124a4e84cc215c164767bfa25f6e92 # atest > salt: 7f8b036f9b647d46d22abdbfc8113f44a88f9889 > email: bob-J0of1frlU80@public.gmane.org > verified: 1 > deleted: 0 # fix > > longbob: > id: 1000003 > login: longbob > salted_password: c841391e1d29100a4920de7a8fbb4b0fd180c6c0 # > alongtest > salt: c068e3671780f16898c0a8295ae8d82cc59713e2 > email: longbob-J0of1frlU80@public.gmane.org > verified: 1 > deleted: 0 # fix > > Still working on my problems and the functional test faliures... > > >> On 5/8/05, Sam Newman <sam.newman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> Hi, >>> >>> I''m having some problems with the salted hash login generator. I >>> installed the login and localization generator gems. I applied the >>> generated DB script, added the following to my environment.rb: >>> >>> require ''environments/user_environment'' >>> require ''environments/localization_environment'' >>> require ''localization'' >>> Localization::load_localized_strings >>> >>> My application.rb looks like this: >>> >>> require ''user_system'' >>> require ''localization'' >>> >>> class ApplicationController < ActionController::Base >>> include UserSystem >>> include Localization >>> helper :user >>> before_filter :login_required >>> >>> end >>> >>> And I''ve edited the relevent environment files. When trying to >>> signup >>> for the first time, I just get returned to the signup page with no >>> error appearing in the log. The email that would be sent is >>> displayed >>> in the log, but nothing is placed in the users table. >>> >>> I did try following the verification link, and get the following >>> error >>> in the log which imples User is not working properly: >>> >>> NoMethodError (undefined method `[]'' for nil:NilClass): >>> app/controllers/user_controller.rb:8:in `login'' >>> >>> Which refers to this code: >>> >>> 5 def login >>> 6 generate_blank >>> 7 @user = User.new(@params[''user'']) >>> 8 if @session[''user''] >>> User.authenticate(@params[''user''][''login''], >>> @params[''user''][''password'']) >>> 9 flash[''notice''] = l(:user_login_succeeded) >>> 10 redirect_back_or_default :action => ''welcome'' >>> 11 else >>> 12 @login = @params[''user''][''login''] >>> 13 flash.now[''message''] = l(:user_login_failed) >>> 14 end >>> 15 end >>> >>> I tried running the unit tests and get the following faliures: >>> >>> 1) Failure: >>> test_auth(UserTest) [./test/unit/user_test.rb:8]: >>> <#<User:0x2338558 >>> @attributes>>> {"salt"=>"7f8b036f9b647d46d22abdbfc8113f44a88f9889", >>> "role"=>nil, >>> "security_token"=>nil, >>> "id"=>"1000001", >>> "firstname"=>"", >>> "lastname"=>"", >>> "token_expiry"=>nil, >>> "deleted"=>nil, >>> "verified"=>"1", >>> "login"=>"bob", >>> "password"=>"", >>> "salted_password"=>"ef94c16f6c124a4e84cc215c164767bfa25f6e92", >>> "email"=>"bob-J0of1frlU80@public.gmane.org"}>> expected but was >>> <nil>. >>> >>> 2) Failure: >>> test_passwordchange(UserTest) [./test/unit/user_test.rb:20]: >>> <#<User:0x221cb88 >>> @attributes>>> {"salt"=>"2c689c879bb8f7597f6123e95a5a2ff27e9de974", >>> "role"=>nil, >>> "security_token"=>nil, >>> "id"=>"1000003", >>> "firstname"=>"", >>> "lastname"=>"", >>> "token_expiry"=>nil, >>> "deleted"=>nil, >>> "verified"=>"1", >>> "login"=>"longbob", >>> "password"=>"", >>> "salted_password"=>"cbc27b79e7bed99bfdfb01da7271d8a40321d684", >>> "email"=>"longbob-J0of1frlU80@public.gmane.org"}, >>> @errors>>> #<ActiveRecord::Errors:0x221958c @base=#<User:0x221cb88 ...>, >>> @errors={}>, >>> @new_password=false, >>> @password="nonbobpasswd", >>> @password_confirmation="nonbobpasswd">> expected but was >>> <nil>. >>> >>> Does anyone have any ideas? I''m running on OSX 10.4, MySQL, and the >>> following gems: >>> >>> actionmailer (0.9.0, 0.8.1) >>> Service layer for easy email delivery and testing. >>> >>> actionpack (1.8.0, 1.7.0) >>> Web-flow and rendering framework putting the VC in MVC. >>> >>> actionwebservice (0.7.0, 0.6.2) >>> Web service support for Action Pack. >>> >>> activerecord (1.10.0, 1.9.1) >>> Implements the ActiveRecord pattern for ORM. >>> >>> activesupport (1.0.4, 1.0.3) >>> Support and utility classes used by the Rails framework. >>> >>> db_structure (1.0.2) >>> [Rails] Database utilities. >>> >>> localization_generator (1.0.7) >>> [Rails] Localization generator. >>> >>> rails (0.12.0, 0.11.1) >>> Web-application framework with template engine, control-flow >>> layer, >>> and ORM. >>> >>> rake (0.5.3) >>> Ruby based make-like utility. >>> >>> salted_login_generator (1.0.6) >>> [Rails] Login generator with salted passwords. >>> >>> sources (0.0.1) >>> This package provides download sources for remote gem >>> installation >>> >>> Thanks in advance, >>> >>> -- >>> sam >>> http://www.magpiebrain.com/ >>> >>> >> >> -- >> sam >> http://www.magpiebrain.com/ >> >> > > > -- > sam > http://www.magpiebrain.com/ > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >