Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class LoginController < UserController
- layout "login-layout"
- def validate
- @users = User.find_all
- @auth = @params['user']
- @users.each do |user|
- if (user.username == @auth['username'] && user.password == @auth['password'])
- redirect_to(:controller => 'user', :action => 'list')
- else
- redirect_to(:controller => 'login', :action => 'auth_failed')
- end
- end
- end
- def index
- end
- def auth_failed
- end
- end
Add Comment
Please, Sign In to add comment