Forum: Ruby on Rails Login generator ALWAYS says login unseccesfull

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Mohammad (Guest)
on 2006-05-05 02:19
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?
Ben R. (Guest)
on 2006-05-05 02:30
(Received via mailing list)
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 <removed_email_address@domain.invalid> wrote:
>   `activated` int(1) NOT NULL default '0',
>   `ds` int(3) NOT NULL default '0',
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
Ben R.
303-947-0446
http://www.benr75.com
Mohammad (Guest)
on 2006-05-05 02:38
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"}
  User 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]
Ben R. (Guest)
on 2006-05-05 02:42
(Received via mailing list)
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 <removed_email_address@domain.invalid> wrote:
> Rendering  within layouts/scaffold
>
--
Ben R.
303-947-0446
http://www.benr75.com
Mohammad (Guest)
on 2006-05-05 02:43
No no edits.
Ben R. (Guest)
on 2006-05-05 03:01
(Received via mailing list)
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 <removed_email_address@domain.invalid> wrote:
> No no edits.
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
Ben R.
303-947-0446
http://www.benr75.com
Mohammad (Guest)
on 2006-05-05 03:12
yup
This topic is locked and can not be replied to.