mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
closes #5352, xcache auth credentials
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7535 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
38565d7069
commit
d76b15ba39
1 changed files with 9 additions and 4 deletions
13
cake/libs/cache/xcache.php
vendored
13
cake/libs/cache/xcache.php
vendored
|
@ -131,8 +131,8 @@ class XcacheEngine extends CacheEngine {
|
||||||
*/
|
*/
|
||||||
function __auth($reverse = false) {
|
function __auth($reverse = false) {
|
||||||
static $backup = array();
|
static $backup = array();
|
||||||
$keys = array('PHP_AUTH_USER', 'PHP_AUTH_PW');
|
$keys = array('PHP_AUTH_USER' => 'user', 'PHP_AUTH_PW' => 'password');
|
||||||
foreach ($keys as $key) {
|
foreach ($keys as $key => $setting) {
|
||||||
if ($reverse) {
|
if ($reverse) {
|
||||||
if (isset($backup[$key])) {
|
if (isset($backup[$key])) {
|
||||||
$_SERVER[$key] = $backup[$key];
|
$_SERVER[$key] = $backup[$key];
|
||||||
|
@ -145,8 +145,13 @@ class XcacheEngine extends CacheEngine {
|
||||||
if (!empty($value)) {
|
if (!empty($value)) {
|
||||||
$backup[$key] = $value;
|
$backup[$key] = $value;
|
||||||
}
|
}
|
||||||
$varName = '__' . $key;
|
if (!empty($this->settings[$setting])) {
|
||||||
$_SERVER[$key] = $this->settings[$varName];
|
$_SERVER[$key] = $this->settings[$setting];
|
||||||
|
} else if (!empty($this->settings[$key])) {
|
||||||
|
$_SERVER[$key] = $this->settings[$key];
|
||||||
|
} else {
|
||||||
|
$_SERVER[$key] = $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue