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:
gwoo 2008-08-29 16:51:00 +00:00
parent 38565d7069
commit d76b15ba39

View file

@ -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;
}
} }
} }
} }