Wenn ich das richtig verstehe, muss ich die adminfuncs.php ändern bei function XH_isAccessProtected($path)?!
Momentan
Code: Select all
function XH_isAccessProtected($path)
{
global $sn;
$host = $_SERVER['HTTP_HOST'];
$stream = fsockopen($host, $_SERVER['SERVER_PORT'], $errno, $errstr, 5);
if ($stream) {
stream_set_timeout($stream, 5);
$root = preg_replace('/index\.php$/', '', $sn);
$request = "HEAD {$root}{$path} HTTP/1.1\r\nHost: $host\r\n"
. "User-Agent: CMSimple_XH\r\n\r\n";
fwrite($stream, $request);
$response = fread($stream, 12);
fclose($stream);
$status = substr($response, 9);
return $status[0] == '4' || $status[0] == '5';
} else {
return false;
}
}
Soll
Code: Select all
function XH_isAccessProtected($path)
{
$url = preg_replace('/index\.php$/', '', CMSIMPLE_URL) . $path;
if (extension_loaded('curl')) {
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_NOBODY, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 5);
if (curl_exec($curl)) {
$status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
curl_close($curl);
return $status >= 400 && $status < 500;
}
curl_close($curl);
}
$defaultContext = stream_context_set_default(
array('http' => array('method' => 'HEAD', 'timeout' => 5))
);
Sehe ich das richtig?
Alternativ soll laut Olape eine .user.ini mit allow_url_fopen = On möglich sein.
Habe ich erstellt und ins Verzeichnis /html kopiert.
php.info zeigt weiterhin allow_url_fopen Off
Dann ins Verzeichnis /html/content kopiert.
php.info zeigt weiterhin allow_url_fopen Off
adminfuncs.php muss ich noch probieren, oder was ratet ihr?
Edit: Gemacht, aber führt zu fatal error.
lg,
Ralf