vendor/plugins/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/xforge/xforge_base.rb
# Logs in and returns a Session
Logs in and returns a Session
Logs in and returns a Session
def login(user_name, password)
          url = "/account/login.php"
          data = [
            "return_to=",
            "login=Login",
            "form_loginname=#{user_name}",
            "form_pw=#{password}"
          ].join("&")
          http = Net::HTTP.new(@host, 80)
          login_response, body = http.start do |http|
            http.post(url, data, DEFAULT_POST_OPTIONS)
          end
          cookie = login_response["set-cookie"]
          unless cookie
            raise "Login failed.\nURL:#{url}\nParams:#{data}\nResponse:#{login_response.to_hash.inspect}"
          end
          Session.new(@host, self, cookie)
        end
def login ( user_name , password ) url = "/account/login.php" data = [ "return_to=" , "login=Login" , "form_loginname=#{user_name}" , "form_pw=#{password}" ] . join ( "&" ) http = Net :: HTTP . new ( @host , 80 ) login_response , body = http . start do | http | http . post ( url , data , DEFAULT_POST_OPTIONS ) end cookie = login_response [ "set-cookie" ] unless cookie raise "Login failed.\nURL:#{url}\nParams:#{data}\nResponse:#{login_response.to_hash.inspect}" end Session . new ( @host , self , cookie ) end
Logs in and returns a Session
Logs in and returns a Session
user_name
<not_specific>
password
<not_specific>