mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-09 12:02:24 +09:00
SSL 로그인시 http에서 시도할 경우 발생하는 cross domain 오류 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6769 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
616942c522
commit
c6e637e9e8
4 changed files with 49 additions and 6 deletions
|
|
@ -187,6 +187,8 @@
|
||||||
$message = $oModule->getMessage();
|
$message = $oModule->getMessage();
|
||||||
$redirect_url = $oModule->get('redirect_url');
|
$redirect_url = $oModule->get('redirect_url');
|
||||||
$request_uri = Context::get('xeRequestURI');
|
$request_uri = Context::get('xeRequestURI');
|
||||||
|
$request_url = Context::get('xeVirtualRequestUrl');
|
||||||
|
if(substr($request_url,-1)!='/') $request_url .= '/';
|
||||||
|
|
||||||
if($error === 0) {
|
if($error === 0) {
|
||||||
if($message != 'success') $output->message = $message;
|
if($message != 'success') $output->message = $message;
|
||||||
|
|
@ -199,8 +201,8 @@
|
||||||
$html = '<script type="text/javascript">'."\n";
|
$html = '<script type="text/javascript">'."\n";
|
||||||
if($output->message) $html .= 'alert("'.$output->message.'");'."\n";
|
if($output->message) $html .= 'alert("'.$output->message.'");'."\n";
|
||||||
if($output->url) {
|
if($output->url) {
|
||||||
$output->url = preg_replace('/#(.+)$/i','',$output->url);
|
$url = preg_replace('/#(.+)$/i','',$output->url);
|
||||||
$html .= 'top.location.href = "'.$output->url.'";'."\n";
|
$html .= 'location.href = "'.$request_url.'common/tpl/redirect.html?redirect_url='.urlencode($url).'";'."\n";
|
||||||
}
|
}
|
||||||
$html .= '</script>'."\n";
|
$html .= '</script>'."\n";
|
||||||
return $html;
|
return $html;
|
||||||
|
|
|
||||||
|
|
@ -99,8 +99,20 @@ function xml_handlerRequest(callBackFunc, xmlObj, callBackFunc2, response_tags,
|
||||||
var action = this.params['act'];
|
var action = this.params['act'];
|
||||||
for(i=0;i<ssl_actions.length;i++) {
|
for(i=0;i<ssl_actions.length;i++) {
|
||||||
if(ssl_actions[i]==action) {
|
if(ssl_actions[i]==action) {
|
||||||
this.xml_path = this.xml_path.replace(/^http:\/\//i,'https://');
|
var url = request_uri;
|
||||||
break;
|
if(typeof(default_url)!='undefined' && default_url) url = default_url;
|
||||||
|
var port = 443;
|
||||||
|
if(typeof(https_port)!='undefined' && https_port != 443) port = https_port;
|
||||||
|
var _u1 = xCreateElement('a');
|
||||||
|
_u1.href = url;
|
||||||
|
var targetUrl = '';
|
||||||
|
if(port == 443) targetUrl = 'https://';
|
||||||
|
else targetUrl = 'http://';
|
||||||
|
targetUrl += _u1.hostname;
|
||||||
|
if(port != 443) targetUrl += ':'+port;
|
||||||
|
targetUrl += _u1.pathname;
|
||||||
|
targetUrl = targetUrl.replace(/\/$/,'');
|
||||||
|
this.xml_path = targetUrl + '/index.php';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -142,9 +154,15 @@ function xml_handlerRequest(callBackFunc, xmlObj, callBackFunc2, response_tags,
|
||||||
var j = xCreateElement('input');
|
var j = xCreateElement('input');
|
||||||
j.type = 'hidden';
|
j.type = 'hidden';
|
||||||
j.name = 'xeRequestURI';
|
j.name = 'xeRequestURI';
|
||||||
j.value = location.href;
|
j.value = location.href.replace(/#(.*)$/i,'');
|
||||||
fo.appendChild(j);
|
fo.appendChild(j);
|
||||||
|
|
||||||
|
var k = xCreateElement('input');
|
||||||
|
k.type = 'hidden';
|
||||||
|
k.name = 'xeVirtualRequestUrl';
|
||||||
|
k.value = request_uri;
|
||||||
|
fo.appendChild(k);
|
||||||
|
|
||||||
for (var key in this.params) {
|
for (var key in this.params) {
|
||||||
if(!this.params.hasOwnProperty(key)) continue;
|
if(!this.params.hasOwnProperty(key)) continue;
|
||||||
var i = xCreateElement('input');
|
var i = xCreateElement('input');
|
||||||
|
|
|
||||||
|
|
@ -57,9 +57,11 @@
|
||||||
var current_mid = "{$mid}";
|
var current_mid = "{$mid}";
|
||||||
var waiting_message = "{$lang->msg_call_server}";
|
var waiting_message = "{$lang->msg_call_server}";
|
||||||
var ssl_actions = new Array(<!--@if(count($ssl_actions))-->"{implode('","',$ssl_actions)}"<!--@end-->);
|
var ssl_actions = new Array(<!--@if(count($ssl_actions))-->"{implode('","',$ssl_actions)}"<!--@end-->);
|
||||||
|
var default_url = "{Context::getDefaultUrl()}";
|
||||||
<!--@if(Context::get("_http_port"))-->var http_port = {Context::get("_http_port")};<!--@end-->
|
<!--@if(Context::get("_http_port"))-->var http_port = {Context::get("_http_port")};<!--@end-->
|
||||||
<!--@if(Context::get("_https_port"))-->var https_port = {Context::get("_https_port")};<!--@end-->
|
<!--@if(Context::get("_https_port"))-->var https_port = {Context::get("_https_port")};<!--@end-->
|
||||||
<!--@if(Context::get("_use_ssl") && Context::get("_use_ssl") == "always")-->var enforce_ssl = true;<!--@end-->
|
<!--@if(Context::get("_use_ssl") && Context::get("_use_ssl") == "always")-->var enforce_ssl = true;<!--@end-->
|
||||||
|
|
||||||
//]]></script>
|
//]]></script>
|
||||||
|
|
||||||
{Context::getHtmlHeader()}
|
{Context::getHtmlHeader()}
|
||||||
|
|
|
||||||
21
common/tpl/redirect.html
Normal file
21
common/tpl/redirect.html
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
<!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" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var idx = location.href.indexOf('?');
|
||||||
|
var url = top.location.href;
|
||||||
|
if(idx > -1 ) {
|
||||||
|
var query_string = location.href.substr(idx+1, location.href.length);
|
||||||
|
var args = {};
|
||||||
|
query_string.replace(/([^=]+)=([^&]*)(&|$)/g, function() { args[arguments[1]] = arguments[2]; });
|
||||||
|
|
||||||
|
url = args['redirect_url'];
|
||||||
|
if(typeof(q)=="undefined" || !q) url = top.location.href.replace(/#(.*)$/i,'');
|
||||||
|
}
|
||||||
|
top.location.href = url;
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue