Throw exception when authentication class dont support authentication/proxyAuthentication method.

This commit is contained in:
Juan Basso 2010-12-01 13:49:03 -02:00
parent b9010b05f2
commit 64dcca61ef

View file

@ -475,6 +475,9 @@ class HttpSocket extends CakeSocket {
if (!App::import('Lib', 'http/' . $authClass)) {
throw new Exception(__('Unknown authentication method.'));
}
if (!method_exists($authClass, 'authentication')) {
throw new Exception(sprintf(__('The %s do not support authentication.'), $authClass));
}
call_user_func("$authClass::authentication", $this);
}
@ -497,6 +500,9 @@ class HttpSocket extends CakeSocket {
if (!App::import('Lib', 'http/' . $authClass)) {
throw new Exception(__('Unknown authentication method for proxy.'));
}
if (!method_exists($authClass, 'proxyAuthentication')) {
throw new Exception(sprintf(__('The %s do not support proxy authentication.'), $authClass));
}
call_user_func("$authClass::proxyAuthentication", $this);
}