Example #1
0
function ioncube_test()
{
    global $lC_Language;
    $status = "";
    $instructions = "";
    $status_class = "red";
    if (extension_loaded('ionCube Loader')) {
        $ioncube_loader_version = ioncube_loader_version_array();
        $status .= $lC_Language->get('ioncube_installed_version') . $ioncube_loader_version['version'];
        $status_icon = "<img src=\"templates/img/icons/tick.gif\" border=\"0\" width=\"16\" height=\"16\" class=\"small-margin-bottom\">";
        if ($ioncube_loader_version['major'] == 4 && $ioncube_loader_version['minor'] < 4 && $ioncube_loader_version['revision'] < 1) {
            $status_icon = "<img src=\"templates/img/icons/cross.gif\" border=\"0\" width=\"16\" height=\"16\" class=\"small-margin-bottom\">";
            $instructions .= $lC_Language->get('ioncube_update_needed');
            $status_class = "red";
            $ok = FALSE;
        } else {
            $instructions .= $lC_Language->get('ioncube_no_additional_config');
            $status_class = "green";
            $ok = TRUE;
        }
    } else {
        $status .= $lC_Language->get('text_not_installed');
        $status_icon = "<img src=\"templates/img/icons/cross.gif\" border=\"0\" width=\"16\" height=\"16\" class=\"small-margin-bottom\">";
        $instructions .= $lC_Language->get('ioncube_not_installed_instructions');
        $ok = FALSE;
    }
    $txt = "{$status_icon}\n         <b><font color=\"{$status_class}\">ionCube Loader</font></b><br /> \n         <b>" . $lC_Language->get('text_status') . "</b> {$status}<br /> \n         <b>" . $lC_Language->get('text_instructions') . "</b> {$instructions}";
    $check = array('txt' => $txt, 'ok' => $ok);
    return $check;
}
Example #2
0
/**
 * Test Ioncube version
 * 
 * @return array
 */
function ioncube_version_tester()
{
    $test = array('status' => 'OK', 'problem' => '', 'solution' => 'No additional configuration required.');
    if (!ioncube_tester()) {
        $test = array('status' => 'ERROR', 'problem' => '', 'solution' => 'Warning: Ioncube is not installed. The professional modules will not be enabled.');
        return $test;
    }
    if (extension_loaded('ionCube Loader')) {
        $ioncube_loader_version = ioncube_loader_version_array();
        if ($ioncube_loader_version['major'] < 4 || $ioncube_loader_version['major'] == 4 && $ioncube_loader_version['minor'] < 6) {
            $test = array('status' => 'ERROR', 'problem' => 'Installed: version ' . $ioncube_loader_version['version'], 'solution' => 'Ioncube loader is installed but needs to be updated. Group-Office will only work reliably with ioncube loader version 4.6 or later. The most recent version of the loader can be found <a href="http://www.ioncube.com/loaders.php" target="_blank">here</a>.');
        } else {
            $test = array('status' => 'OK', 'problem' => 'Installed: version ' . $ioncube_loader_version['version'], 'solution' => 'No additional configuration required.');
        }
    } else {
        $sys_info = ic_system_info();
        if ($sys_info['THREAD_SAFE'] && !$sys_info['CGI_CLI']) {
            $test = array('status' => 'ERROR', 'problem' => 'Your PHP install appears to have threading support and run-time loading is only possible on threaded web servers if using the CGI, FastCGI or CLI interface.', 'solution' => 'To run encoded files please install the Loader in the php.ini file.');
            return $test;
        }
        if ($sys_info['DEBUG_BUILD']) {
            $test = array('status' => 'ERROR', 'problem' => 'Your PHP installation appears to be built with debugging support enabled and this is incompatible with ionCube Loaders. Debugging support in PHP produces slower execution, is not recommended for production builds and was probably a mistake.', 'solution' => 'You should rebuild PHP without the --enable-debug option.');
            return $test;
        }
        if (ini_get('safe_mode')) {
            $test = array('status' => 'ERROR', 'problem' => 'PHP safe mode is enabled and run time loading will not be possible.', 'solution' => 'To run encoded files please install the Loader in the php.ini file. Instructions can be found <a href="http://www.ioncube.com/loader_installation.php" target="_blank">here</a>. Alternatively contact your hosting provider or system administrator and ask them to enable safe mode for your account.');
            return $test;
        }
        $test = array('status' => 'ERROR', 'problem' => '', 'solution' => 'Warning: Ioncube is not installed. The professional modules will not be enabled.');
    }
    return $test;
}