Merge branch 'feature/install.https' into develop

This commit is contained in:
akasima 2014-07-30 10:01:17 +09:00
commit bbd0a6a9bf
8 changed files with 32 additions and 19 deletions

View file

@ -388,26 +388,26 @@ class installController extends install
FileHandler::writeFile(_XE_PATH_.$checkFilePath, trim($checkString));
$scheme = $_SERVER['REQUEST_SCHEME'];
$hostname = $_SERVER['SERVER_NAME'];
$port = $_SERVER['SERVER_PORT'];
$str_port = '';
if($port)
{
$str_port = ':' . $port;
}
$query = "/JUST/CHECK/REWRITE/" . $checkFilePath;
$currentPath = str_replace($_SERVER['DOCUMENT_ROOT'], "", _XE_PATH_);
if($currentPath != "")
{
$query = $currentPath . $query;
$fp = @fsockopen($hostname, $port, $errno, $errstr, 5);
if(!$fp) return false;
fputs($fp, "GET {$query} HTTP/1.0\r\n");
fputs($fp, "Host: {$hostname}\r\n\r\n");
$buff = '';
while(!feof($fp)) {
$str = fgets($fp, 1024);
if(trim($str)=='') $start = true;
if($start) $buff .= $str;
}
fclose($fp);
$requestUrl = sprintf('%s://%s%s%s', $scheme, $hostname, $str_port, $query);
$requestConfig = array();
$requestConfig['ssl_verify_peer'] = false;
$buff = FileHandler::getRemoteResource($requestUrl, null, 10, 'POST', 'application/x-www-form-urlencoded', array(), array(), array(), $requestConfig);
FileHandler::removeFile(_XE_PATH_.$checkFilePath);

View file

@ -124,6 +124,19 @@ class installView extends install
$title = sprintf(Context::getLang('input_dbinfo_by_dbtype'), Context::get('db_type'));
Context::set('title', $title);
$error_return_url = getNotEncodedUrl('', 'act', Context::get('act'), 'db_type', Context::get('db_type'));
if($_SERVER['HTTPS'] == 'on')
{
// Error occured when using https protocol at "ModuleHandler::init() '
$parsedUrl = parse_url($error_return_url);
$error_return_url = '';
if(isset($parsedUrl['path'])) $error_return_url .= $parsedUrl['path'];
if(isset($parsedUrl['query'])) $error_return_url .= '?' . $parsedUrl['query'];
if(isset($parsedUrl['fragment'])) $error_return_url .= '?' . $parsedUrl['fragment'];
}
Context::set('error_return_url', $error_return_url);
$this->setTemplateFile($tpl_filename);
}

View file

@ -7,7 +7,7 @@
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form rule="cubrid" action="./" method="post" class="x_form-horizontal">
<input type="hidden" value="{getUrl('', 'act', $act, 'db_type', $db_type)}" name="error_return_url">
<input type="hidden" value="{$error_return_url}" name="error_return_url">
<input type="hidden" name="act" value="procCubridDBSetting" />
<input type="hidden" name="db_type" value="{$db_type}" />
<h2>{$title}</h2>

View file

@ -7,7 +7,7 @@
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form rule="mssql" action="./" method="post" class="x_form-horizontal">
<input type="hidden" value="{getUrl('', 'act', $act, 'db_type', $db_type)}" name="error_return_url">
<input type="hidden" value="{$error_return_url}" name="error_return_url">
<input type="hidden" name="act" value="procMssqlDBSetting" />
<input type="hidden" name="db_type" value="{$db_type}" />
<h2>{$title}</h2>

View file

@ -7,7 +7,7 @@
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form rule="mysql" action="./" method="post" class="x_form-horizontal">
<input type="hidden" value="{getUrl('', 'act', $act, 'db_type', $db_type)}" name="error_return_url">
<input type="hidden" value="{$error_return_url}" name="error_return_url">
<input type="hidden" name="act" value="procMysqlDBSetting" />
<input type="hidden" name="db_type" value="{$db_type}" />
<h2>{$title}</h2>

View file

@ -7,7 +7,7 @@
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form rule="mysql" action="./" method="post" class="x_form-horizontal">
<input type="hidden" value="{getUrl('', 'act', $act, 'db_type', $db_type)}" name="error_return_url">
<input type="hidden" value="{$error_return_url}" name="error_return_url">
<input type="hidden" name="act" value="procMysqlDBSetting" />
<input type="hidden" name="db_type" value="{$db_type}" />
<h2>{$title}</h2>

View file

@ -7,7 +7,7 @@
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form rule="mysql" action="./" method="post" class="x_form-horizontal">
<input type="hidden" value="{getUrl('', 'act', $act, 'db_type', $db_type)}" name="error_return_url">
<input type="hidden" value="{$error_return_url}" name="error_return_url">
<input type="hidden" name="act" value="procMysqlDBSetting" />
<input type="hidden" name="db_type" value="{$db_type}" />
<h2>{$title}</h2>

View file

@ -7,7 +7,7 @@
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form rule="mysql" action="./" method="post" class="x_form-horizontal">
<input type="hidden" value="{getUrl('', 'act', $act, 'db_type', $db_type)}" name="error_return_url">
<input type="hidden" value="{$error_return_url}" name="error_return_url">
<input type="hidden" name="act" value="procMysqlDBSetting" />
<input type="hidden" name="db_type" value="{$db_type}" />
<h2>{$title}</h2>