Hey I just ran this "ruby script/generate login loging_in" here is my SQL: CREATE TABLE `users` ( `id` int(11) NOT NULL auto_increment, `user_name` varchar(80) default NULL, `login` varchar(120) NOT NULL default '''', `last_update` timestamp NOT NULL default ''0000-00-00 00:00:00'', `last_attack` timestamp NOT NULL default ''0000-00-00 00:00:00'', `password` varchar(40) default NULL, `points` int(30) NOT NULL default ''0'', `activated` int(1) NOT NULL default ''0'', `a_key` int(6) NOT NULL default ''0'', `email` varchar(100) NOT NULL default '''', `xw` int(100) NOT NULL default ''0'', `w` int(100) NOT NULL default ''0'', `m` int(100) NOT NULL default ''0'', `l` int(100) NOT NULL default ''0'', `xl` int(100) NOT NULL default ''0'', `s` int(100) NOT NULL default ''0'', `ss` int(100) NOT NULL default ''0'', `created_on` timestamp NOT NULL default ''0000-00-00 00:00:00'', `ds` int(3) NOT NULL default ''0'', `dm` int(3) NOT NULL default ''0'', `dl` int(3) NOT NULL default ''0'', `dss` int(3) NOT NULL default ''0'', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; I don''t know why it dosn''t work for some reasson any one know why? -- Posted via http://www.ruby-forum.com/.
Ben Reubenstein
2006-May-04 22:29 UTC
[Rails] Login generator ALWAYS says login unseccesfull
The schema of your table isn''t all that helpful. Are you getting an error message? What does your development.log say? ~ Ben On 5/4/06, Mohammad <name.goes.here44@gmail.com> wrote:> Hey I just ran this "ruby script/generate login loging_in" here is my > SQL: > CREATE TABLE `users` ( > `id` int(11) NOT NULL auto_increment, > `user_name` varchar(80) default NULL, > `login` varchar(120) NOT NULL default '''', > `last_update` timestamp NOT NULL default ''0000-00-00 00:00:00'', > `last_attack` timestamp NOT NULL default ''0000-00-00 00:00:00'', > `password` varchar(40) default NULL, > `points` int(30) NOT NULL default ''0'', > `activated` int(1) NOT NULL default ''0'', > `a_key` int(6) NOT NULL default ''0'', > `email` varchar(100) NOT NULL default '''', > `xw` int(100) NOT NULL default ''0'', > `w` int(100) NOT NULL default ''0'', > `m` int(100) NOT NULL default ''0'', > `l` int(100) NOT NULL default ''0'', > `xl` int(100) NOT NULL default ''0'', > `s` int(100) NOT NULL default ''0'', > `ss` int(100) NOT NULL default ''0'', > `created_on` timestamp NOT NULL default ''0000-00-00 00:00:00'', > `ds` int(3) NOT NULL default ''0'', > `dm` int(3) NOT NULL default ''0'', > `dl` int(3) NOT NULL default ''0'', > `dss` int(3) NOT NULL default ''0'', > PRIMARY KEY (`id`) > ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; > I don''t know why it dosn''t work for some reasson any one know why? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Ben Reubenstein 303-947-0446 http://www.benr75.com
No error messages, here is the log: Processing LogingInController#login (for 127.0.0.1 at 2006-05-04 17:11:30) [POST] Session ID: ad46b855212634e8c02524588dc654d7 Parameters: {"user_login"=>"admin", "action"=>"login", "controller"=>"loging_in", "user_password"=>"secret", "login"=>"Login \302\273"} [4;35;1mUser Load (0.000000) SELECT * FROM users WHERE (login = ''admin'' AND password = ''3042a0c5cf8d4d2b5900d2a2ad869fb679870dac'') LIMIT 1 Rendering within layouts/scaffold Rendering loging_in/login Completed in 0.02000 (50 reqs/sec) | Rendering: 0.01000 (50%) | DB: 0.00000 (0%) | 200 OK [http://127.0.0.1/loging_in/login] -- Posted via http://www.ruby-forum.com/.
Ben Reubenstein
2006-May-04 22:41 UTC
[Rails] Re: Login generator ALWAYS says login unseccesfull
SELECT * FROM users WHERE (login = ''admin'' AND password ''3042a0c5cf8d4d2b5900d2a2ad869fb679870dac'') Hmm... Are you writing your own sql for this? Login generator should just select out the User with the corresponding login and then use some methods in the Model for checking the password. ~ Ben On 5/4/06, Mohammad <name.goes.here44@gmail.com> wrote:> No error messages, here is the log: > Processing LogingInController#login (for 127.0.0.1 at 2006-05-04 > 17:11:30) [POST] > Session ID: ad46b855212634e8c02524588dc654d7 > Parameters: {"user_login"=>"admin", "action"=>"login", > "controller"=>"loging_in", "user_password"=>"secret", "login"=>"Login > \302\273"} > [4;35;1mUser Load (0.000000) SELECT * FROM users WHERE > (login = ''admin'' AND password > ''3042a0c5cf8d4d2b5900d2a2ad869fb679870dac'') LIMIT 1 > Rendering within layouts/scaffold > Rendering loging_in/login > Completed in 0.02000 (50 reqs/sec) | Rendering: 0.01000 (50%) | DB: > 0.00000 (0%) | 200 OK [http://127.0.0.1/loging_in/login] > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Ben Reubenstein 303-947-0446 http://www.benr75.com
Mohammad
2006-May-04 22:43 UTC
[Rails] Re: Re: Login generator ALWAYS says login unseccesfull
No no edits. -- Posted via http://www.ruby-forum.com/.
Ben Reubenstein
2006-May-04 22:59 UTC
[Rails] Re: Re: Login generator ALWAYS says login unseccesfull
Do you have a User that matches the SQL where clause? If you don''t the login will always fail as no User is returned. WHERE (login = ''admin'' AND password ''3042a0c5cf8d4d2b5900d2a2ad869fb679870dac'') On 5/4/06, Mohammad <name.goes.here44@gmail.com> wrote:> No no edits. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Ben Reubenstein 303-947-0446 http://www.benr75.com