Exemplo n.º 1
0
<?php

require_once realpath(__DIR__ . DIRECTORY_SEPARATOR . 'install.php');
use nzedb\Install;
$page = new InstallPage();
$page->title = "OpenSSL Setup";
$cfg = new Install();
if (!$cfg->isInitialized()) {
    header("Location: index.php");
    die;
}
$cfg = $cfg->getSession();
if ($page->isPostBack()) {
    $cfg->doCheck = true;
    $cfg->nZEDb_SSL_CAFILE = trim($_POST['cafile']);
    $cfg->nZEDb_SSL_CAPATH = trim($_POST['capath']);
    $cfg->nZEDb_SSL_VERIFY_PEER = isset($_POST['verifypeer']) ? trim($_POST['verifypeer']) == '1' ? true : false : false;
    $cfg->nZEDb_SSL_VERIFY_HOST = isset($_POST['verifyhost']) ? trim($_POST['verifyhost']) == '1' ? true : false : false;
    $cfg->nZEDb_SSL_ALLOW_SELF_SIGNED = isset($_POST['allowselfsigned']) ? trim($_POST['allowselfsigned']) == '1' ? true : false : false;
    // If the user doesn't want to verify peer, disable everything.
    if (!$cfg->nZEDb_SSL_VERIFY_PEER) {
        $cfg->nZEDb_SSL_ALLOW_SELF_SIGNED = true;
        $cfg->nZEDb_SSL_VERIFY_HOST = false;
        $cfg->nZEDb_SSL_CAFILE = $cfg->nZEDb_SSL_CAPATH = '';
    }
    // If both paths are empty, disable everything.
    if (!$cfg->nZEDb_SSL_CAPATH && !$cfg->nZEDb_SSL_CAFILE) {
        $cfg->nZEDb_SSL_VERIFY_PEER = $cfg->nZEDb_SSL_VERIFY_HOST = false;
        $cfg->nZEDb_SSL_ALLOW_SELF_SIGNED = true;
        $cfg->nZEDb_SSL_CAFILE = $cfg->nZEDb_SSL_CAPATH = '';
    }
Exemplo n.º 2
0
<?php

@session_start();
require_once realpath(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'smarty.php');
use nzedb\Install;
$page_title = "Welcome";
$cfg = new Install();
if ($cfg->isLocked()) {
    $cfg->error = true;
}
$cfg->cacheCheck = is_writable(SMARTY_DIR . 'templates_c');
if ($cfg->cacheCheck === false) {
    $cfg->error = true;
}
if (!$cfg->error) {
    $cfg->setSession();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<title>
		<?php 
echo $page_title;
?>
	</title>
	<link href="./templates/install.css" rel="stylesheet" type="text/css" media="screen" />
	<link rel="shortcut icon" type="image/ico" href="../themes_shared/images/favicon.ico"/>
</head>
<body>
Exemplo n.º 3
0
<?php

/**
 * Remember!! Keeps these files simple until after the requirements checks are met.
 * No point having a check for PHP version if we can't get to that page because of higher version
 * requirements.
 */
require_once realpath(__DIR__ . DIRECTORY_SEPARATOR . 'install.php');
use nzedb\Install;
$page = new InstallPage();
$page->title = "Preflight Checklist";
$cfg = new Install();
if (!$cfg->isInitialized()) {
    header("Location: index.php");
    die;
}
$cfg->setSession();
$cfg = $cfg->getSession();
// Start checks.
$cfg->sessionsPathPermissions = true;
$sessionPath = session_save_path();
$sessionPath = empty($sessionPath) ? sys_get_temp_dir() : $sessionPath;
$page->smarty->assign('sessionsSavePath', $sessionPath);
if (!is_readable($sessionPath) || !is_writable($sessionPath)) {
    $cfg->error = true;
    $cfg->sessionsPathPermissions = false;
}
$cfg->iconvCheck = function_exists('iconv');
if ($cfg->iconvCheck === false) {
    $cfg->error = true;
}