Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class LoginController < ApplicationController
- def index
- if request.post? then
- username = params[:user][:name]
- password = params[:user][:password]
- servername = params[:user][:servername]
- begin
- mail = Net::POP3.new(servername)
- mail.auth_only(username, password)
- rescue Net::POPAuthenticationError => @error
- end
- if @error then
- render :text => "login wrong"
- #redirect_to(:action => "index")
- else
- #params[:user][:loggedin] = 'true'
- redirect_to(:controller => 'inbox')
- end
- else
- #reset_session
- #render :text => "What the heck is this doing here?"
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement