Ejemplo n.º 1
0
function list_loader_errors($errors = array(), $warnings = array(), $suggest_restart = true)
{
    $default = get_default_address();
    $retry_message = '';
    if (empty($errors)) {
        $errors = ini_loader_errors();
        if (empty($warnings)) {
            $warnings = ini_loader_warnings();
        }
    }
    if (!empty($errors)) {
        $try_again = '<a href="#" onClick="window.location.href=window.location.href">重试</a>';
        echo '<div class="alert">';
        if (count($errors) > 1) {
            echo '安装过程中出现以下问题:';
            $retry_message = "请解决这些问题并{$try_again。}";
        } else {
            echo '安装过程中出现以下问题:';
            $retry_message = "请解决这些问题并{$try_again。}";
        }
        if (array_key_exists(ERROR_INI_USER_CANNOT_CREATE, $errors)) {
            $retry_message = '';
        }
        echo make_list($errors, "ul");
        echo '</div>';
        if (!empty($warnings)) {
            echo '<div class="warning">';
            echo '同时请注意:';
            echo make_list($warnings, "ul");
            echo '</div>';
        }
    } elseif (!empty($warnings)) {
        echo '<div class="warning">';
        echo '注意下面潜在的问题:';
        echo make_list($warnings, "ul");
        echo '</div>';
    } elseif ($suggest_restart) {
        if (SERVER_SHARED == find_server_type()) {
            echo "<p>请联系管理员安装ionCube Loader。</p>";
        } else {
            if (selinux_is_enabled()) {
                echo "<p>好像服务器上的SElinux已经开启。 使用root 运行命令 <code>restorecon [full path to loader file]</code>能够解决该问题。如果没有解决,请参照 <a target=\"_blank\" href=\"http://www.cuteshift.com/57/install-ioncube-loader-while-selinux-enabled/\">http://www.cuteshift.com/57/install-ioncube-loader-while-selinux-enabled/</a> ,安装 ionCube Loader。</p>";
            } elseif (grsecurity_is_enabled()) {
                echo "<p>好像服务器上的 grsecurity 已经开启。 运行命令 <code>execstack -c [full path to loader file]</code> ,并重启服务器。</p>";
            } else {
                $sysinfo = get_sysinfo();
                $ss = $sysinfo['SS'];
                if (!$sysinfo['CGI_CLI'] || is_ms_windows()) {
                    echo "<p>请检查 {$ss} 服务器已经重启。</p>";
                }
            }
        }
    }
    echo '<div>';
    echo $retry_message;
    echo " 你可能需要下面的帮助:";
    echo make_list(help_resources($errors), "ul");
    echo '<a href="' . $default . '">点击这里重新开始向导</a>。</div>';
}
Ejemplo n.º 2
0
function list_loader_errors($errors = array(), $warnings = array(), $suggest_restart = true)
{
    $default = get_default_address();
    $retry_message = '';
    if (empty($errors)) {
        $errors = ini_loader_errors();
        if (empty($warnings)) {
            $warnings = ini_loader_warnings();
        }
    }
    if (!empty($errors)) {
        $try_again = '<a href="#" onClick="window.location.href=window.location.href">try again</a>';
        echo '<div class="alert">';
        if (count($errors) > 1) {
            echo 'The following problems have been found with the ionCube Loader installation:';
            $retry_message = "Please correct those errors and {$try_again}.";
        } else {
            echo 'The following problem has been found with the ionCube Loader installation:';
            $retry_message = "Please correct that error and {$try_again}.";
        }
        if (array_key_exists(ERROR_INI_USER_CANNOT_CREATE, $errors)) {
            $retry_message = '';
        }
        echo make_list($errors, "ul");
        echo '</div>';
        if (!empty($warnings)) {
            echo '<div class="warning">';
            echo 'Please also note the following:';
            echo make_list($warnings, "ul");
            echo '</div>';
        }
    } elseif (!empty($warnings)) {
        echo '<div class="warning">';
        echo 'There are the following potential problems:';
        echo make_list($warnings, "ul");
        echo '</div>';
    } elseif ($suggest_restart) {
        if (SERVER_SHARED == find_server_type()) {
            echo "<p>Please contact your server administrator about installing the ionCube Loader.</p>";
        } else {
            if (selinux_is_enabled()) {
                echo "<p>It appears that SELinux is enabled on your server. This might be solved by running the command <code>restorecon [full path to loader file]</code> as root. If that does not solve the problem then please follow the instructions at <a target=\"_blank\" href=\"http://www.cuteshift.com/57/install-ioncube-loader-while-selinux-enabled/\">http://www.cuteshift.com/57/install-ioncube-loader-while-selinux-enabled/</a> for installing the ionCube Loader when SELinux is enabled.</p>";
            } elseif (grsecurity_is_enabled()) {
                echo "<p>It appears that grsecurity is enabled on your server. Please run the command, <code>execstack -c [full path to loader file]</code> and then restart your web server.</p>";
            } else {
                $sysinfo = get_sysinfo();
                $ss = $sysinfo['SS'];
                if (!$sysinfo['CGI_CLI'] || is_ms_windows()) {
                    echo "<p>Please check that the {$ss} web server software has been restarted.</p>";
                }
            }
        }
    }
    echo '<div>';
    echo $retry_message;
    echo " You may wish to view the following for further help:";
    echo make_list(help_resources($errors), "ul");
    echo '<a href="' . $default . '">Click here to go back to the start of the Loader Wizard</a>.</div>';
}
Ejemplo n.º 3
0
function list_loader_errors($errors = array(),$warnings = array(),$suggest_restart = true)
{
    $self = get_self();
    $retry_message = '';
   
    if (empty($errors)) {
        $errors = ini_loader_errors();
        if (empty($warnings)) {
            $warnings = ini_loader_warnings();
        }
    }
    if (!empty($errors)) {
        $try_again = '<a href="#" onClick="window.location.href=window.location.href">try again</a>';
        echo '<div class="alert">';
        if (count($errors) > 1) {
            echo 'The following problems have been found with the ionCube Loader installation:';
            $retry_message = "Please correct those errors and $try_again.";
        } else {
            echo 'The following problem has been found with the ionCube Loader installation:';
            $retry_message = "Please correct that error and $try_again.";
        }
        echo make_list($errors,"ul");
        echo '</div>';
        if (!empty($warnings)) {
            echo '<div class="alert">';
            echo 'There are also the following potential problems:';
            echo make_list($warnings,"ul");
            echo '</div>';
        }
    } elseif (!empty($warnings)) {
        echo '<div class="alert">';
        echo 'There are the following potential problems:';
        echo make_list($warnings,"ul");
        echo '</div>';
    } elseif ($suggest_restart) {
        $sysinfo = get_sysinfo();
        $ss = $sysinfo['SS'];
        if (!$sysinfo['CGI_CLI'] || is_ms_windows()) {
            echo "<p>Please check that the $ss web server software has been restarted.</p>";
        }
    }
    echo '<div>';
    echo $retry_message;
    echo " You may wish to view the following for further help:";
    echo make_list(help_resources($errors),"ul");
    echo '<a href="' . $self . '">Click here to go back to the start of the Loader Wizard</a>.</div>';
}