aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/auth_bytemark.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-06-17 17:31:10 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-06-17 17:31:10 +0100
commit0b83323a3bccff72da4aadd8f38d0305a5fdcca4 (patch)
treefbeaa85359183885261aacff56a65aa006c472dd /lib/mauve/auth_bytemark.rb
parenta2fc458d4c1bc6027760546653cb153e775576ce (diff)
* Bytemark auth fixed.
* Some hot fixes.
Diffstat (limited to 'lib/mauve/auth_bytemark.rb')
-rw-r--r--lib/mauve/auth_bytemark.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/mauve/auth_bytemark.rb b/lib/mauve/auth_bytemark.rb
index 52fa610..2273c36 100644
--- a/lib/mauve/auth_bytemark.rb
+++ b/lib/mauve/auth_bytemark.rb
@@ -35,15 +35,19 @@ class AuthBytemark
raise ArgumentError.new("Password must be a string, not a #{password.class}") if String != password.class
raise ArgumentError.new("Login or/and password is/are empty.") if login.empty? || password.empty?
- return false if ENV['RACK_ENV'].to_s == "development"
-
client = XMLRPC::Client.new(@srv,"/",@port,nil,nil,nil,nil,true,@timeout).proxy("bytemark.auth")
begin
challenge = client.getChallengeForUser(login)
response = Digest::SHA1.new.update(challenge).update(password).hexdigest
client.login(login, response)
+ return true
+ rescue XMLRPC::FaultException => fault
+ Mauve::Server.instance.logger.warn "Fault code is #{fault.faultCode} stating #{fault.faultString}"
+ return false
rescue Exception => ex
+ Mauve::Server.instance.logger.warn "Caught #{ex.to_s} whilst trying to loging for #{login}"
+ Mauve::Server.instance.logger.debug ex.backtrace.join("\n")
return false
end
end