5
This:
$localhost = preg_match("/localhost/i", XOOPS_ROOT_PATH);
$_127_0_0_1 = preg_match("/127.0.0.1/i", XOOPS_ROOT_PATH);
if ($localhost || $_127_0_0_1) {
if (!isset($xoopsConfig['admin_warnings_enable']) || $xoopsConfig['admin_warnings_enable']) {
if (is_dir(XOOPS_ROOT_PATH . '/install/')) {
xoops_error(sprintf(_AD_WARNINGINSTALL, XOOPS_ROOT_PATH . '/install/'));
echo '
';
}
if (is_writable(XOOPS_ROOT_PATH . '/mainfile.php')) {
xoops_error(sprintf(_AD_WARNINGWRITEABLE, XOOPS_ROOT_PATH . '/mainfile.php'));
echo '
';
}
// ###### Output warn messages for correct functionality ######
if (! is_writable(XOOPS_CACHE_PATH)) {
xoops_error(sprintf(_AD_WARNINGNOTWRITEABLE, XOOPS_CACHE_PATH));
echo '
';
}
if (! is_writable(XOOPS_UPLOAD_PATH)) {
xoops_error(sprintf(_AD_WARNINGNOTWRITEABLE, XOOPS_UPLOAD_PATH));
echo '
';
}
if (! is_writable(XOOPS_COMPILE_PATH)) {
xoops_error(sprintf(_AD_WARNINGNOTWRITEABLE, XOOPS_COMPILE_PATH));
echo '
';
}
//www fits inside www_private, lets add a trailing slash to make sure it doesn't
if (strpos(XOOPS_PATH . '/', XOOPS_ROOT_PATH . '/') !== false || strpos(XOOPS_PATH . '/', $_SERVER['DOCUMENT_ROOT'] . '/') !== false) {
xoops_error(sprintf(_AD_WARNINGXOOPSLIBINSIDE, XOOPS_PATH));
echo '
';
}
if (strpos(XOOPS_VAR_PATH . '/', XOOPS_ROOT_PATH . '/') !== false || strpos(XOOPS_VAR_PATH . '/', $_SERVER['DOCUMENT_ROOT'] . '/') !== false) {
xoops_error(sprintf(_AD_WARNINGXOOPSLIBINSIDE, XOOPS_VAR_PATH));
echo '
';
}
}
}
works locally, I have't tried remote