mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fixing class loading for authentication clasess in HttpSocket, also allowing the use of plugin authentication classes
This commit is contained in:
parent
b314149efd
commit
0cb08a09dc
1 changed files with 10 additions and 4 deletions
|
@ -530,8 +530,11 @@ class HttpSocket extends CakeSocket {
|
|||
return;
|
||||
}
|
||||
$method = key($this->_auth);
|
||||
$authClass = Inflector::camelize($method) . 'Authentication';
|
||||
if (!App::import('Lib', 'http/' . $authClass)) {
|
||||
list($plugin, $authClass) = pluginSplit($method, true);
|
||||
$authClass = Inflector::camelize($authClass) . 'Authentication';
|
||||
App::uses($authClass, $plugin . 'Network/Http');
|
||||
|
||||
if (!class_exists($authClass)) {
|
||||
throw new SocketException(__('Unknown authentication method.'));
|
||||
}
|
||||
if (!method_exists($authClass, 'authentication')) {
|
||||
|
@ -556,8 +559,11 @@ class HttpSocket extends CakeSocket {
|
|||
if (empty($this->_proxy['method']) || !isset($this->_proxy['user'], $this->_proxy['pass'])) {
|
||||
return;
|
||||
}
|
||||
$authClass = Inflector::camelize($this->_proxy['method']) . 'Authentication';
|
||||
if (!App::import('Lib', 'http/' . $authClass)) {
|
||||
list($plugin, $authClass) = pluginSplit($this->_proxy['method'], true);
|
||||
$authClass = Inflector::camelize($authClass) . 'Authentication';
|
||||
App::uses($authClass, $plugin. 'Network/Http');
|
||||
|
||||
if (!class_exists($authClass)) {
|
||||
throw new SocketException(__('Unknown authentication method for proxy.'));
|
||||
}
|
||||
if (!method_exists($authClass, 'proxyAuthentication')) {
|
||||
|
|
Loading…
Reference in a new issue