From 89090a5cb90b2544471a940a4f13caec2ff2dc19 Mon Sep 17 00:00:00 2001 From: zero Date: Wed, 16 Apr 2008 06:27:41 +0000 Subject: [PATCH] =?UTF-8?q?#447=20Member=EB=AA=A8=EB=93=88=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EB=A1=9C=EA=B7=B8=EC=9D=B8/=ED=9A=8C=EC=9B=90?= =?UTF-8?q?=EA=B0=80=EC=9E=85/=EC=A0=95=EB=B3=B4-=EB=B9=84=EB=B0=80?= =?UTF-8?q?=EB=B2=88=ED=98=B8=20=EC=88=98=EC=A0=95=EB=93=B1=20=EB=B9=84?= =?UTF-8?q?=EB=B0=80=EB=B2=88=ED=98=B8=20=EA=B4=80=EB=A0=A8=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=EC=9D=98=20=EC=A0=84=EC=86=A1=EC=97=90=20=EB=8C=80?= =?UTF-8?q?=ED=95=B4=20SSL=EC=82=AC=EC=9A=A9=EC=9D=84=20=EC=84=A4=EC=A0=95?= =?UTF-8?q?=ED=95=A0=20=EC=88=98=20=EC=9E=88=EB=8F=84=EB=A1=9D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD.=20=EB=8B=A8=20=EC=84=9C=EB=B2=84=EC=97=90=EC=84=9C?= =?UTF-8?q?=20SSL=EC=A7=80=EC=9B=90=EC=9D=B4=20=EB=90=98=EC=96=B4=EC=95=BC?= =?UTF-8?q?=20=ED=95=98=EB=A9=B0=20=ED=98=84=EC=9E=AC=20=EA=B8=B0=EB=B3=B8?= =?UTF-8?q?=ED=8F=AC=ED=8A=B8=EC=97=90=20=EB=8C=80=ED=95=B4=EC=84=9C?= =?UTF-8?q?=EB=A7=8C=20=EA=B0=9C=EB=B0=9C=20=EC=99=84=EB=A3=8C=EB=90=98?= =?UTF-8?q?=EC=97=88=EC=9D=8C.=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EC=9C=84?= =?UTF-8?q?=EC=A0=AF=EC=9D=98=20=EA=B2=BD=EC=9A=B0=20=EA=B8=B0=EB=B3=B8=20?= =?UTF-8?q?=EC=9C=84=EC=A0=AF=EC=97=90=20=EB=8C=80=ED=95=B4=20=EB=B3=B4?= =?UTF-8?q?=EC=95=88=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=EC=9D=84=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4109 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/context/Context.class.php | 88 +++++++++++++---- classes/display/DisplayHandler.class.php | 3 +- classes/module/ModuleHandler.class.php | 8 ++ common/js/common.js | 22 ++++- common/js/xml_handler.js | 44 ++++++--- common/tpl/common_layout.html | 8 +- modules/member/lang/en.lang.php | 5 +- modules/member/lang/es.lang.php | 3 + modules/member/lang/jp.lang.php | 3 + modules/member/lang/ko.lang.php | 3 + modules/member/lang/ru.lang.php | 3 + modules/member/lang/zh-CN.lang.php | 3 + modules/member/member.admin.controller.php | 3 +- modules/member/member.class.php | 24 +++++ modules/member/member.controller.php | 2 +- modules/member/skins/default/signup_form.html | 2 +- modules/member/tpl/member_config.html | 7 ++ widgets/login_info/login_info.class.php | 7 ++ .../login_info/skins/default/css/default.css | 92 ++++++++++-------- .../default/images/default/logout_btn.gif | Bin 0 -> 929 bytes .../skins/default/images/none_ssl.png | Bin 0 -> 1152 bytes .../login_info/skins/default/images/ssl.png | Bin 0 -> 1171 bytes widgets/login_info/skins/default/js/login.js | 22 +++-- .../login_info/skins/default/login_form.html | 70 +++++++------ .../login_info/skins/default/login_info.html | 16 +-- .../skins/xe_official/css/black.css | 7 ++ .../skins/xe_official/css/default.css | 7 ++ .../skins/xe_official/css/white.css | 7 ++ .../skins/xe_official/images/none_ssl.png | Bin 0 -> 1152 bytes .../skins/xe_official/images/ssl.png | Bin 0 -> 1171 bytes .../login_info/skins/xe_official/js/login.js | 6 -- .../skins/xe_official/login_form.html | 8 +- 32 files changed, 345 insertions(+), 128 deletions(-) create mode 100644 widgets/login_info/skins/default/images/default/logout_btn.gif create mode 100644 widgets/login_info/skins/default/images/none_ssl.png create mode 100644 widgets/login_info/skins/default/images/ssl.png create mode 100644 widgets/login_info/skins/xe_official/images/none_ssl.png create mode 100644 widgets/login_info/skins/xe_official/images/ssl.png diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 0498cb5ac..77f3bf9d9 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -10,6 +10,10 @@ * php5 쓰고 싶당.. ㅡ.ㅜ **/ + define('FOLLOW_REQUEST_SSL',0); + define('ENFORCE_SSL',1); + define('RELEASE_SSL',2); + class Context { var $request_method = 'GET'; ///< @brief GET/POST/XMLRPC 중 어떤 방식으로 요청이 왔는지에 대한 값이 세팅. GET/POST/XML 3가지가 있음 @@ -19,8 +23,8 @@ var $db_info = NULL; ///< @brief DB 정보 + var $ssl_actions = array(); ///< @brief ssl로 전송해야 할 action등록 (common/js/xml_handler.js에서 ajax통신시 활용) var $js_files = array(); ///< @brief display시에 사용하게 되는 js files의 목록 - var $css_files = array(); ///< @brief display시에 사용하게 되는 css files의 목록 var $html_header = NULL; ///< @brief display시에 사용하게 되는 ..내의 스크립트코드 @@ -129,9 +133,6 @@ if(file_exists('./.htaccess')&&$this->db_info->use_rewrite == 'Y') $this->allow_rewrite = true; else $this->allow_rewrite = false; - // 상대 경로 설정 - $this->path = $this->getRequestUri(); - // 기본 JS/CSS 등록 $this->addJsFile("./common/js/x.js"); $this->addJsFile("./common/js/common.js"); @@ -148,7 +149,7 @@ if(!$val) continue; $url .= ($url?'&':'').$key.'='.$val; } - Context::set('current_url',sprintf('%s?%s',$this->path, $url)); + Context::set('current_url',sprintf('%s?%s', $this->getRequestUri(), $url)); } else { Context::set('current_url',$this->getUrl()); } @@ -576,33 +577,36 @@ $var_count = count($get_vars); if(!$var_count) return ''; + if($get_vars['act'] && $this->isExistsSSLAction($get_vars['act'])) $path = $this->getRequestUri(ENFORCE_SSL); + else $path = $this->getRequestUri(RELEASE_SSL); + // rewrite모듈을 사용하고 인자의 값이 4개 이하일 경우 if($this->allow_rewrite && $var_count < 4) { $var_keys = array_keys($get_vars); if($var_count == 1) { - if($var_keys[0]=='mid') return $this->path.$get_vars['mid']; - elseif($var_keys[0]=='document_srl') return $this->path.$get_vars['document_srl']; + if($var_keys[0]=='mid') return $path.$get_vars['mid']; + elseif($var_keys[0]=='document_srl') return $path.$get_vars['document_srl']; } elseif($var_count == 2) { asort($var_keys); $target = implode('.',$var_keys); - if($target=='act.mid' && !preg_match('/([A-Z]+)/',$get_vars['act'])) return sprintf('%s%s/%s',$this->path,$get_vars['mid'],$get_vars['act']); - elseif($target=='document_srl.mid') return sprintf('%s%s/%s',$this->path,$get_vars['mid'],$get_vars['document_srl']); - elseif($target=='act.document_srl') return sprintf('%s%s/%s',$this->path,$get_vars['document_srl'],$get_vars['act']); - elseif($target=='mid.page') return sprintf('%s%s/page/%s',$this->path,$get_vars['mid'],$get_vars['page']); - elseif($target=='category.mid') return sprintf('%s%s/category/%s',$this->path,$get_vars['mid'],$get_vars['category']); + if($target=='act.mid' && !preg_match('/([A-Z]+)/',$get_vars['act'])) return sprintf('%s%s/%s',$path,$get_vars['mid'],$get_vars['act']); + elseif($target=='document_srl.mid') return sprintf('%s%s/%s',$path,$get_vars['mid'],$get_vars['document_srl']); + elseif($target=='act.document_srl') return sprintf('%s%s/%s',$path,$get_vars['document_srl'],$get_vars['act']); + elseif($target=='mid.page') return sprintf('%s%s/page/%s',$path,$get_vars['mid'],$get_vars['page']); + elseif($target=='category.mid') return sprintf('%s%s/category/%s',$path,$get_vars['mid'],$get_vars['category']); } elseif($var_count == 3) { asort($var_keys); $target = implode('.',$var_keys); if($target=='act.document_srl.key') { - return sprintf('%s%s/%s/%s',$this->path,$get_vars['document_srl'],$get_vars['key'],$get_vars['act']); + return sprintf('%s%s/%s/%s',$path,$get_vars['document_srl'],$get_vars['key'],$get_vars['act']); } elseif($target=='category.mid.page') { - return sprintf('%s%s/category/%s/page/%s',$this->path,$get_vars['mid'],$get_vars['category'],$get_vars['page']); + return sprintf('%s%s/category/%s/page/%s',$path,$get_vars['mid'],$get_vars['category'],$get_vars['page']); } elseif($target=='mid.search_keyword.search_target' && $get_vars['search_target']=='tag') { - return sprintf('%s%s/tag/%s',$this->path,$get_vars['mid'],str_replace(' ','-',$get_vars['search_keyword'])); + return sprintf('%s%s/tag/%s',$path,$get_vars['mid'],str_replace(' ','-',$get_vars['search_keyword'])); } elseif($target=='mid.search_keyword.search_target' && $get_vars['search_target']=='regdate') { - if(strlen($get_vars['search_keyword'])==8) return sprintf('%s%s/%04d/%02d/%02d',$this->path,$get_vars['mid'],substr($get_vars['search_keyword'],0,4),substr($get_vars['search_keyword'],4,2),substr($get_vars['search_keyword'],6,2)); - elseif(strlen($get_vars['search_keyword'])==6) return sprintf('%s%s/%04d/%02d',$this->path,$get_vars['mid'],substr($get_vars['search_keyword'],0,4),substr($get_vars['search_keyword'],4,2)); + if(strlen($get_vars['search_keyword'])==8) return sprintf('%s%s/%04d/%02d/%02d',$path,$get_vars['mid'],substr($get_vars['search_keyword'],0,4),substr($get_vars['search_keyword'],4,2),substr($get_vars['search_keyword'],6,2)); + elseif(strlen($get_vars['search_keyword'])==6) return sprintf('%s%s/%04d/%02d',$path,$get_vars['mid'],substr($get_vars['search_keyword'],0,4),substr($get_vars['search_keyword'],4,2)); } } } @@ -613,14 +617,26 @@ $url .= ($url?'&':'').$key.'='.urlencode($val); } - return $this->path.'?'.htmlspecialchars($url); + return $path.'?'.htmlspecialchars($url); } /** * @brief 요청이 들어온 URL에서 argument를 제거하여 return **/ - function getRequestUri() { - return sprintf("http://%s%s",$_SERVER['HTTP_HOST'], getScriptPath()); + function getRequestUri($ssl_mode = FOLLOW_REQUEST_SSL) { + switch($ssl_mode) { + case FOLLOW_REQUEST_SSL : + if($_SERVER['HTTPS']=='on') $use_ssl = true; + else $use_ssl = false; + break; + case ENFORCE_SSL : + $use_ssl = true; + break; + case RELEASE_SSL : + $use_ssl = false; + break; + } + return sprintf("%s://%s%s",$use_ssl?'HTTPS':'HTTP',$_SERVER['HTTP_HOST'], getScriptPath()); } /** @@ -711,6 +727,38 @@ return clone($this->get_vars); } + /** + * @brief SSL로 인증되어야 할 action이 있을 경우 등록 + * common/js/xml_handler.js에서 이 action들에 대해서 https로 전송되도록 함 + **/ + function addSSLAction($action) { + $oContext = &Context::getInstance(); + return $oContext->_addSSLAction($action); + } + + function _addSSLAction($action) { + if(in_array($action, $this->ssl_actions)) return; + $this->ssl_actions[] = $action; + } + + function getSSLActions() { + $oContext = &Context::getInstance(); + return $oContext->_getSSLActions(); + } + + function _getSSLActions() { + return $this->ssl_actions; + } + + function isExistsSSLAction($action) { + $oContext = &Context::getInstance(); + return $oContext->_isExistsSSLAction($action); + } + + function _isExistsSSLAction($action) { + return in_array($action, $this->ssl_actions); + } + /** * @brief js file을 추가 **/ diff --git a/classes/display/DisplayHandler.class.php b/classes/display/DisplayHandler.class.php index dbcae7c14..256716f32 100644 --- a/classes/display/DisplayHandler.class.php +++ b/classes/display/DisplayHandler.class.php @@ -45,14 +45,13 @@ $layout_file = $oModule->getLayoutFile(); $edited_layout_file = $oModule->getEditedLayoutFile(); } - if(!$layout_path) $layout_path = './common/tpl/'; if(!$layout_file) $layout_file = 'default_layout.html'; - $zbxe_final_content = $oTemplate->compile($layout_path, $layout_file, $edited_layout_file); if(__DEBUG__==3) $GLOBALS['__layout_compile_elapsed__'] = getMicroTime()-$start; + // 각 위젯, 에디터 컴포넌트의 코드 변경 if(__DEBUG__==3) $start = getMicroTime(); diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index 62b5f65c6..979207b5b 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -334,12 +334,20 @@ $oModule->setModule($module); $oModule->setModulePath($class_path); + // 요청된 module에 constructor가 있으면 실행 + if(!isset($GLOBALS['_called_constructor'][$module])) { + $GLOBALS['_called_constructor'][$module] = true; + if(@method_exists($oModule, $module)) $oModule->{$module}(); + } + // GLOBALS 변수에 생성된 객체 저장 $GLOBALS['_loaded_module'][$module][$type][$kind] = $oModule; } if(__DEBUG__==3) $GLOBALS['__elapsed_class_load__'] += getMicroTime() - $start_time; + // init method가 있으면 실행 + // 객체 리턴 return $GLOBALS['_loaded_module'][$module][$type][$kind]; } diff --git a/common/js/common.js b/common/js/common.js index 7aac19292..b9c9a5b67 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -48,7 +48,17 @@ String.prototype.setQuery = function(key, val) { } else { if(val.toString().trim()) uri = uri+"?"+key+"="+val; } - //uri = uri.replace(request_uri+'?',request_uri+'index.php?'); + + uri = uri.replace(/^https:\/\//i,'http://'); + if(typeof(ssl_actions)!='undefined' && typeof(ssl_actions.length)!='undefined' && uri.getQuery('act')) { + var act = uri.getQuery('act'); + for(i=0;i\n" for (var key in this.params) { - if(!this.params.hasOwnProperty(key)) continue; + if(!this.params.hasOwnProperty(key)) continue; var val = this.params[key]; rd += "<"+key+">\n"; } @@ -103,12 +94,43 @@ function xml_handlerRequest(callBackFunc, xmlObj, callBackFunc2, response_tags, rd += "\n" + "\n"; + // ssl action + if(typeof(ssl_actions)!='undefined' && typeof(ssl_actions.length)!='undefined' && typeof(this.params['act'])!='undefined' && /^https:\/\//i.test(location.href) ) { + var action = this.params['act']; + for(i=0;i + @@ -17,6 +17,7 @@ {Context::getBrowserTitle()} +{@ $js_files = Context::getJsFile() } + +{@ $css_files = Context::getCssFile() } + +{@ $ssl_actions = Context::getSSLActions() } {Context::getHtmlHeader()} diff --git a/modules/member/lang/en.lang.php b/modules/member/lang/en.lang.php index 0680de2e3..fc005483c 100644 --- a/modules/member/lang/en.lang.php +++ b/modules/member/lang/en.lang.php @@ -45,6 +45,8 @@ $lang->signature_max_height = 'Max Signature Height'; $lang->enable_openid = 'Enable OpenID'; $lang->enable_join = 'Allow Member Join'; + $lang->enable_ssl = 'Enable SSL'; + $lang->security_sign_in = 'Sign in using enhanced security'; $lang->limit_day = 'Temporary Limit Date'; $lang->limit_date = 'Limit Date'; $lang->after_login_url = 'URL after Login'; @@ -64,7 +66,7 @@ $lang->webmaster_email = "Webmaster's Email"; $lang->about_keep_signed = 'Though the browser is closed, you might be kept signed.\n\nIf you use this feature at the shared computer, your personal information might be accessed by others, thus do not use this feature at the shared computer. '; - $lang->about_webmaster_name = "Please input webmaster's name which will be used for certification mails or other site administration. (default : webmaster)"; + $lang->about_webmaster_name = "Please input webmaster's name which will be used for certification mails or other site administration. (default : webmaster)"; $lang->about_webmaster_email = "Please input webmaster's email address."; $lang->search_target_list = array( @@ -184,6 +186,7 @@ $lang->about_enable_openid = 'Allow users to sign up as OpenID'; $lang->about_enable_join = 'Allow users to sign up'; + $lang->about_enable_ssl = '서버에서 SSL지원이 될 경우 회원가입/정보수정/로그인등의 개인정보가 서버로 보내질때 SSL(https)를 이용하도록 할 수 있습니다'; $lang->about_limit_day = 'You can limit certification date after sign up'; $lang->about_limit_date = 'User cannot login until assigned date'; $lang->about_after_login_url = 'You can set URL after login. Blank means current page.'; diff --git a/modules/member/lang/es.lang.php b/modules/member/lang/es.lang.php index 1e9febe2f..c09802c44 100644 --- a/modules/member/lang/es.lang.php +++ b/modules/member/lang/es.lang.php @@ -44,6 +44,8 @@ $lang->image_mark_max_height = 'Altura Máxima'; $lang->enable_openid = 'Activar OpenID'; $lang->enable_join = 'Permitir el registro del usuario'; + $lang->enable_ssl = 'Activar SSL'; + $lang->security_sign_in = 'Sign in using enhanced security'; $lang->limit_day = 'Límite de la fecha temporal'; $lang->limit_date = 'Límite de fecha'; $lang->after_login_url = 'URL después del inicio de sesión'; @@ -181,6 +183,7 @@ $lang->about_enable_openid = 'Selecciona esta opción si activado OpenID'; $lang->about_enable_join = 'Debe seleccionar esta opción para permitir el registro de los usuarios'; + $lang->about_enable_ssl = '서버에서 SSL지원이 될 경우 회원가입/정보수정/로그인등의 개인정보가 서버로 보내질때 SSL(https)를 이용하도록 할 수 있습니다'; $lang->about_limit_day = 'Usted puede limitar la fecha de la certificación luego de registrar'; $lang->about_limit_date = 'Usuario no podra conectarse hasta la fecha indicada'; $lang->about_after_login_url = '로그인 후 이동할 URL을 정하실 수 있습니다. 비어 있으면 해당 페이지가 유지됩니다.'; diff --git a/modules/member/lang/jp.lang.php b/modules/member/lang/jp.lang.php index f00f7adfc..9a04eadb3 100644 --- a/modules/member/lang/jp.lang.php +++ b/modules/member/lang/jp.lang.php @@ -45,6 +45,8 @@ $lang->signature_max_height = '署名欄の高さの制限'; $lang->enable_openid = 'OpenID使用'; $lang->enable_join = '会員加入を許可する'; + $lang->enable_ssl = 'SSL使用'; + $lang->security_sign_in = 'Sign in using enhanced security'; $lang->limit_day = '臨時制限日'; $lang->limit_date = '制限日'; $lang->after_login_url = 'ログイン後表示するページのURL'; @@ -184,6 +186,7 @@ $lang->about_enable_openid = 'OpenIDをサポートする際にチェックを入れます。'; $lang->about_enable_join = 'チェックを入れないとユーザが会員に加入できません。'; + $lang->about_enable_ssl = '서버에서 SSL지원이 될 경우 회원가입/정보수정/로그인등의 개인정보가 서버로 보내질때 SSL(https)를 이용하도록 할 수 있습니다'; $lang->about_limit_day = '会員加入後一定の期間中、認証制限を行うことができます。'; $lang->about_limit_date = '指定された期間まで該当ユーザはログインできなくします。'; $lang->about_after_login_url = 'ログイン後表示されるページのURLを指定できます。指定のない場合、現在のページが維持されます。'; diff --git a/modules/member/lang/ko.lang.php b/modules/member/lang/ko.lang.php index 1b666c463..03aca5dd8 100644 --- a/modules/member/lang/ko.lang.php +++ b/modules/member/lang/ko.lang.php @@ -45,6 +45,8 @@ $lang->signature_max_height = '서명 높이 제한'; $lang->enable_openid = 'OpenID 지원'; $lang->enable_join = '회원 가입 허가'; + $lang->enable_ssl = 'SSL 기능 사용'; + $lang->security_sign_in = '보안로그인 사용'; $lang->limit_day = '임시 제한 일자'; $lang->limit_date = '제한일'; $lang->after_login_url = '로그인 후 이동할 URL'; @@ -184,6 +186,7 @@ $lang->about_enable_openid = 'OpenID 지원을 할 경우 체크하시면 됩니다'; $lang->about_enable_join = '체크를 하셔야 사용자들이 회원가입을 할 수 있습니다'; + $lang->about_enable_ssl = '서버에서 SSL지원이 될 경우 회원가입/정보수정/로그인등의 개인정보가 서버로 보내질때 SSL(https)를 이용하도록 할 수 있습니다'; $lang->about_limit_day = '회원 가입후 정해진 일자동안 인증 제한을 할 수 있습니다'; $lang->about_limit_date = '지정된 일자까지 해당 사용자는 로그인을 할 수 없습니다'; $lang->about_after_login_url = '로그인 후 이동할 URL을 정하실 수 있습니다. 비어 있으면 해당 페이지가 유지됩니다.'; diff --git a/modules/member/lang/ru.lang.php b/modules/member/lang/ru.lang.php index 8ec51fda2..ce81d2886 100644 --- a/modules/member/lang/ru.lang.php +++ b/modules/member/lang/ru.lang.php @@ -44,6 +44,8 @@ $lang->image_mark_max_height = 'Макс. высота'; $lang->enable_openid = 'Включить открытый ID (OpenID)'; $lang->enable_join = 'Позволить пользователям регистрироваться'; + $lang->enable_ssl = 'SSL 기능 사용'; + $lang->security_sign_in = 'Sign in using enhanced security'; $lang->limit_day = 'Временный лимит даты'; $lang->limit_date = 'Дата лимита'; $lang->after_login_url = '로그인 후 이동할 URL'; @@ -181,6 +183,7 @@ $lang->about_enable_openid = 'Позволить пользователям регистрироваться как OpenID'; $lang->about_enable_join = 'Позволить пользователям регистрироваться'; + $lang->about_enable_ssl = '서버에서 SSL지원이 될 경우 회원가입/정보수정/로그인등의 개인정보가 서버로 보내질때 SSL(https)를 이용하도록 할 수 있습니다'; $lang->about_limit_day = 'Вы можете ограничить дату сертификации после регистрации'; $lang->about_limit_date = 'Пользователь не может войти до указанной даты'; $lang->about_after_login_url = '로그인 후 이동할 URL을 정하실 수 있습니다. 비어 있으면 해당 페이지가 유지됩니다.'; diff --git a/modules/member/lang/zh-CN.lang.php b/modules/member/lang/zh-CN.lang.php index 494e3240b..d0277b72b 100644 --- a/modules/member/lang/zh-CN.lang.php +++ b/modules/member/lang/zh-CN.lang.php @@ -45,6 +45,8 @@ $lang->signature_max_height = '签名高度限制'; $lang->enable_openid = '支持OpenID'; $lang->enable_join = '允许会员注册'; + $lang->enable_ssl = 'SSL 기능 사용'; + $lang->security_sign_in = 'Sign in using enhanced security'; $lang->limit_day = '认证限制'; $lang->limit_date = '限制日期'; $lang->after_login_url = '登录后页面转向'; @@ -184,6 +186,7 @@ $lang->about_enable_openid = '要想网站支持OpenID时请勾选此项。'; $lang->about_enable_join = '选择此项后用户才可以注册。'; + $lang->about_enable_ssl = '서버에서 SSL지원이 될 경우 회원가입/정보수정/로그인등의 개인정보가 서버로 보내질때 SSL(https)를 이용하도록 할 수 있습니다'; $lang->about_limit_day = '注册会员后的认证有效期限。'; $lang->about_limit_date = '直到指定日期该用户不能登录。'; $lang->about_after_login_url = '可以指定登录后的页面转向url(留空为当前页面)。'; diff --git a/modules/member/member.admin.controller.php b/modules/member/member.admin.controller.php index 1d9a9887e..c41b547ab 100644 --- a/modules/member/member.admin.controller.php +++ b/modules/member/member.admin.controller.php @@ -83,10 +83,11 @@ **/ function procMemberAdminInsertConfig() { // 기본 정보를 받음 - $args = Context::gets('webmaster_name','webmaster_email','skin','colorset','enable_openid','enable_join','limit_day','after_login_url','after_logout_url','redirect_url','agreement','profile_image','profile_image_max_width','profile_image_max_height','image_name','image_mark', 'image_name_max_width', 'image_name_max_height','image_mark_max_width','image_mark_max_height','signature_max_height','editor_skin'); + $args = Context::gets('webmaster_name','webmaster_email','skin','colorset','enable_openid','enable_join','enable_ssl','limit_day','after_login_url','after_logout_url','redirect_url','agreement','profile_image','profile_image_max_width','profile_image_max_height','image_name','image_mark', 'image_name_max_width', 'image_name_max_height','image_mark_max_width','image_mark_max_height','signature_max_height','editor_skin'); if(!$args->skin) $args->skin = "default"; if(!$args->colorset) $args->colorset = "white"; if($args->enable_join!='Y') $args->enable_join = 'N'; + if($args->enable_ssl!='Y') $args->enable_ssl = 'N'; if($args->enable_openid!='Y') $args->enable_openid= 'N'; if($args->profile_image !='Y') $args->profile_image = 'N'; if($args->image_name!='Y') $args->image_name = 'N'; diff --git a/modules/member/member.class.php b/modules/member/member.class.php index 3a15de02d..dbf8f829f 100644 --- a/modules/member/member.class.php +++ b/modules/member/member.class.php @@ -7,6 +7,30 @@ class member extends ModuleObject { + /** + * @brief constructor + **/ + function member() { + if(!Context::isInstalled()) return; + + $oModuleModel = &getModel('module'); + $member_config = $oModuleModel->getModuleConfig('member'); + + // SSL 사용시 회원가입/정보/비밀번호등과 관련된 action에 대해 SSL 전송하도록 지정 + if($member_config->enable_ssl == 'Y') { + Context::addSSLAction('dispMemberLoginForm'); + Context::addSSLAction('dispMemberModifyPassword'); + Context::addSSLAction('dispMemberSignUpForm'); + Context::addSSLAction('dispMemberModifyInfo'); + Context::addSSLAction('dispMemberOpenIDLogin'); + Context::addSSLAction('procMemberLogin'); + Context::addSSLAction('procMemberModifyPassword'); + Context::addSSLAction('procMemberInsert'); + Context::addSSLAction('procMemberModifyInfo'); + Context::addSSLAction('procMemberOpenIDLogin'); + } + } + /** * @brief 설치시 추가 작업이 필요할시 구현 **/ diff --git a/modules/member/member.controller.php b/modules/member/member.controller.php index 6a9726116..c0415e1dd 100644 --- a/modules/member/member.controller.php +++ b/modules/member/member.controller.php @@ -66,7 +66,7 @@ $this->setError(-1); $this->setMessage($error['description']); } else { - $openid->SetApprovedURL( sprintf('%s?module=member&act=procMemberOpenIDValidate', Context::getRequestUri()) ); + $openid->SetApprovedURL( sprintf('%s?module=member&act=procMemberOpenIDValidate', Context::getRequestUri(RELEASE_SSL)) ); $url = $openid->GetRedirectURL(); $this->add('redirect_url', $url); } diff --git a/modules/member/skins/default/signup_form.html b/modules/member/skins/default/signup_form.html index e5751eadd..65c63749c 100644 --- a/modules/member/skins/default/signup_form.html +++ b/modules/member/skins/default/signup_form.html @@ -15,7 +15,7 @@
-

{$lang->msg_new_member}

+

{$lang->cmd_signup}

diff --git a/modules/member/tpl/member_config.html b/modules/member/tpl/member_config.html index d30ef4241..d605c1df0 100644 --- a/modules/member/tpl/member_config.html +++ b/modules/member/tpl/member_config.html @@ -37,6 +37,13 @@ {$lang->about_enable_join} + + {$lang->enable_ssl} + + enable_ssl=='Y')-->checked="checked" class="checkbox" /> + {$lang->about_enable_ssl} + + {$lang->limit_day} diff --git a/widgets/login_info/login_info.class.php b/widgets/login_info/login_info.class.php index 8fe336b34..92324d60b 100644 --- a/widgets/login_info/login_info.class.php +++ b/widgets/login_info/login_info.class.php @@ -29,6 +29,13 @@ $this->member_config = $oModuleModel->getModuleConfig('member'); Context::set('member_config', $this->member_config); + // ssl 사용시 현재 https접속상태인지에 대한 flag및 https url 생성 + $ssl_mode = false; + if($this->member_config->enable_ssl == 'Y') { + if(preg_match('/^https:\/\//i',Context::getRequestUri())) $ssl_mode = true; + } + Context::set('ssl_mode',$ssl_mode); + // 템플릿 컴파일 $oTemplate = &TemplateHandler::getInstance(); return $oTemplate->compile($tpl_path, $tpl_file); diff --git a/widgets/login_info/skins/default/css/default.css b/widgets/login_info/skins/default/css/default.css index 85df3265c..597c82d9d 100644 --- a/widgets/login_info/skins/default/css/default.css +++ b/widgets/login_info/skins/default/css/default.css @@ -1,46 +1,60 @@ -.fc_01 { color:#797771; } -.fc_02 { color:#9A9893; } +.default_login { color:#797771;} +.openid_login { display:none; } -.box_login { border:solid 3px #D5D8DB; background:#FFFFFE; margin-bottom:10px;} +/* login form */ +.default_login form { position:relative; } +.default_login .form_field { padding:5px 60px 5px 5px; white-space:nowrap; overflow:hidden; height:45px; } -.box_login .user_info { padding:5px 0 0 5px; height:22px; } +.default_login .form_field .openIDTitle { width:99%; white-space:nowrap; overflow:hidden; background:url("../images/openid_login_bg.gif") no-repeat left top; padding:1px 0 0 18px; margin-bottom:8px; color:#888888; font-weight:bold; } +.default_login .form_field .openIDTitle input { margin:0; padding:0; height:14px; } +.default_login .form_field input.input { display:block; width:99%; background-color: #ffffff; border:1px solid; border-color:#a6a6a6 #d8d8d8 #d8d8d8 #a6a6a6; padding:2px; height:14px; color:#666666; margin:2px 0 2px 0;} -.box_login .hr_dot_01 { background:url(../images/default/hr_dot_01.gif) repeat-x; height:2px; overflow:hidden; clear:both; margin:6px; } -.box_login .item { background:url(../images/default/bul_01.gif) no-repeat 5px 5px; height:16px; padding:3px 0px 0px 20px; margin-left:5px; margin-top:2px; } -.box_login .item a { color:#666666; text-decoration:none; } -.box_login .item { font-size:11px; letter-spacing:-1px; margin-right:10px; padding:3px 0px 0px 20px; white-space:nowrap; } -.box_login .profile { width:70px; float:left; background:url(../images/default/icon_profile.gif) no-repeat left; } -.box_login .message { width:70px; float:left; background:url(../images/default/icon_note.gif) no-repeat left; } -.box_login .friend { float:left; background:url(../images/default/icon_friend.gif) no-repeat left; } -.box_login .administrative { float:left; background:url(../images/default/icon_key.gif) no-repeat left; margin-right:0px; } -.box_login .administrative a { color:#D80D0F; } -.box_login .lastlogin { clear:both; padding-bottom:5px;} +.default_login input.submit { width:45px; height:45px; background:url(../images/default/login_btn_submit.gif) no-repeat; border:none; margin:0; cursor:pointer; position:absolute; right:5px; top:5px; } -.box_login .form_field { float:left; margin:9px 9px 0 9px; _margin:3px 3px 0 3px; height:55px; } -.box_login .form_field div { margin-top:2px; margin-bottom:3px; } -.box_login input.submit { width:45px; height:45px; background:url(../images/default/login_btn_submit.gif) no-repeat; border:none; margin:9px 0 0 0; _margin:5px 0 0 0; cursor:pointer; } -.box_login .input { width:140px; background-color: #ffffff; border:1px solid; border-color:#a6a6a6 #d8d8d8 #d8d8d8 #a6a6a6; padding:2px; height:14px; margin:0px; cursor:text; color:#666666;} -.box_login ul { margin:0; padding:0; } -.box_login ul.option { clear:both; height:20px; margin:0 0 0 9px;} -.box_login ul.option li { float:left; list-style:none;} -.box_login ul.option li a.btn { background:url(../images/default/bul_01.gif) no-repeat left; padding-left:10px; margin-left:14px; } -.box_login .checkbox { width:15px; height:15px; margin:-1px 0px 0px -1px; margin-right:2px; } -.box_login .clear { clear:both; } -.box_login ul { margin:0; padding:0; } -.box_login ul.extra_option { clear:both; height:40px; } -.box_login ul.extra_option li a {text-decoration:none;} -.box_login ul.extra_option li a.btn { background:url(../images/default/bul_01.gif) no-repeat left; padding-left:10px; margin-left:10px; } +.default_login form p.securitySignIn { clear:both; padding:0 0 0 18px; margin:4px 0 4px 7px; } +.default_login form p.noneSSL { background:url("../images/none_ssl.png") no-repeat left top; } +.default_login form p.SSL { background:url("../images/ssl.png") no-repeat left top; } +.default_login form p.noneSSL a { color:#BF6801; text-decoration:none; } +.default_login form p.SSL a { color:#9CAC74; text-decoration:none; } -.openid_login { clear:both; height:38px; border:3px solid #D5D8DB; background-color:#FFFFFF; margin:0 0 10px 0; } -.openid_login .openid_user_id { width:110px; _width:100px; background: url(../images/openid_login_bg.gif) left no-repeat; background-color: #ffffff; background-position: 0 50%; padding:3px 3px 3px 18px; border:1px solid; border-color:#a6a6a6 #d8d8d8 #d8d8d8 #a6a6a6; height:16px; line-height:1em; vertical-align:middle; margin-bottom:.5em; color:#666666;} +.default_login p { padding:0; margin:0 0 0 5px; } -.openid_login .wButtonTypeA { display:block; cursor:pointer; background:url(../images/default/buttonTypeACenter.gif) repeat-x left center; line-height:100%; overflow:visible; color:#3f4040; margin:0 1px; white-space:nowrap;border:0px;} -.openid_login .wButtonTypeA:hover { text-decoration:none;} -.openid_login .wButtonTypeA img { vertical-align:middle;} -.openid_login .wButtonTypeA input { border:none; cursor:pointer; background:url(../images/default/buttonTypeACenter.gif) repeat-x left center; line-height:100%; overflow:visible; color:#3f4040; margin:0 1px; white-space:nowrap;border:0px; vertical-align:middle; } -.openid_login .wButtonTypeA .leftCap { width:2px; height:24px; background:url(../images/default/buttonTypeALeft.gif) no-repeat; margin:0 .3em 0 0; position:relative; left:-1px;} -.openid_login .wButtonTypeA .rightCap { width:2px; height:24px; background:url(../images/default/buttonTypeARight.gif) no-repeat; margin:0 -1px 0 .4em;} -.openid_login .wButtonTypeA .icon { margin:0 .2em;} -.openid_login .wButtonWrite ul { text-align:center; clear:both; display:block; margin:0; padding:0; } -.openid_login .wButtonWrite li { margin-top:.5em; float:left; margin-left:.3em; list-style:none;} +.default_login .checkbox { width:15px; height:15px; margin:-1px 0px 0px -1px; margin-right:2px; } +.default_login .clear { clear:both; } + +.default_login ul.extra_option { margin:5px 0 0 0; padding:0; clear:both; height:40px; } +.default_login ul.extra_option li { background:url(../images/default/bul_01.gif) no-repeat 7px 3px; padding-left:20px; margin-left:5px; margin-bottom:3px;} +.default_login ul.extra_option li a {text-decoration:none; color:#666666;} + + +.default_openid_login { display:none; clear:both; height:38px; border:3px solid #D5D8DB; background-color:#FFFFFF; margin:0 0 10px 0; } +.default_openid_login .openid_user_id { width:110px; _width:100px; background: url(../images/openid_login_bg.gif) left no-repeat; background-color: #ffffff; background-position: 0 50%; padding:3px 3px 3px 18px; border:1px solid; border-color:#a6a6a6 #d8d8d8 #d8d8d8 #a6a6a6; height:16px; line-height:1em; vertical-align:middle; margin-bottom:.5em; color:#666666;} + +.default_openid_login .wButtonTypeA { display:block; cursor:pointer; background:url(../images/default/buttonTypeACenter.gif) repeat-x left center; line-height:100%; overflow:visible; color:#3f4040; margin:0 1px; white-space:nowrap;border:0px;} +.default_openid_login .wButtonTypeA:hover { text-decoration:none;} +.default_openid_login .wButtonTypeA img { vertical-align:middle;} +.default_openid_login .wButtonTypeA input { border:none; cursor:pointer; background:url(../images/default/buttonTypeACenter.gif) repeat-x left center; line-height:100%; overflow:visible; color:#3f4040; margin:0 1px; white-space:nowrap;border:0px; vertical-align:middle; } +.default_openid_login .wButtonTypeA .leftCap { width:2px; height:24px; background:url(../images/default/buttonTypeALeft.gif) no-repeat; margin:0 .3em 0 0; position:relative; left:-1px;} +.default_openid_login .wButtonTypeA .rightCap { width:2px; height:24px; background:url(../images/default/buttonTypeARight.gif) no-repeat; margin:0 -1px 0 .4em;} +.default_openid_login .wButtonTypeA .icon { margin:0 .2em;} +.default_openid_login .wButtonWrite ul { text-align:center; clear:both; display:block; margin:0; padding:0; } +.default_openid_login .wButtonWrite li { margin-top:.5em; float:left; margin-left:.3em; list-style:none;} + + +/* logged info */ +.default_login .loginUser { position:relative; padding:5px; } +.default_login .loginUser .userNickName { margin-right:50px; white-space:nowrap; overflow:hidden; } +.default_login .loginUser .logoutButton { position:absolute; right:5px; top:5px; } + +.default_login .hr_dot_01 { background:url(../images/default/hr_dot_01.gif) repeat-x; height:2px; overflow:hidden; clear:both; margin:6px; } + +.default_login .item { background:url(../images/default/bul_01.gif) no-repeat 5px 5px; height:16px; padding:3px 0px 0px 20px; margin-left:5px; margin-top:2px; } +.default_login .item a { color:#666666; text-decoration:none; } +.default_login .item { font-size:11px; letter-spacing:-1px; margin-right:10px; padding:3px 0px 0px 20px; white-space:nowrap; } +.default_login .profile { width:70px; float:left; background:url(../images/default/icon_profile.gif) no-repeat left; } +.default_login .message { width:70px; float:left; background:url(../images/default/icon_note.gif) no-repeat left; } +.default_login .friend { float:left; background:url(../images/default/icon_friend.gif) no-repeat left; } +.default_login .administrative { float:left; background:url(../images/default/icon_key.gif) no-repeat left; margin-right:0px; } +.default_login .administrative a { color:#D80D0F; } +.default_login .lastlogin { clear:both; padding:5px; white-space:wrap; font-size:8pt; } diff --git a/widgets/login_info/skins/default/images/default/logout_btn.gif b/widgets/login_info/skins/default/images/default/logout_btn.gif new file mode 100644 index 0000000000000000000000000000000000000000..fb036508430720fa52b08ef0b8f9e3825633cb6a GIT binary patch literal 929 zcmchU+fP$>0Dyn(X|Xh}EmRJ)nrJJQ>PqmEDNL4~R;zKwq!?;Xb!Nw9CRLNEiP;|4 z7CN9YS_YadUO)|oRUfKGAyu%YR_a(&&@wRkq87wt54Puib+A8T-}{&E;oH4uS7XzW z22cs+y?|jTnkG4(6-5CjOB}}%WQn3lmZJ$0XE}zX2wvbw5+}%_An*i*lN8Rdlq3p* zz_BbXE+Pp8Q4&O6k_3vvd7h&dEuLjrM&LP;CPa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