묻고답하기

 

 

늅입니다.

 

그러니까 간단하게

복잡한거 다생략하고

외부컨테이너에서 기존 xe의 로그인을 인식하는 member.controller 파일을 바꾼

임의의 파일로 값을 전송해서 그곳에서 그 값을 읽고 로그인처리하는

 

어떻게 수정하나요..?

 

 

 

 function procMemberLogin($user_id = null, $password = null, $keep_signed = null) {
   // Variables
   if(!$user_id) $user_id = Context::get('user_id'+ ');
   $user_id = trim($user_id);

   if(!$password) $password = Context::get('password');
   $password = trim($password);

   if(!$keep_signed) $keep_signed = Context::get('keep_signed');
   // Return an error when id and password doesn't exist
   if(!$user_id) return new Object(-1,'null_user_id');
   if(!$password) return new Object(-1,'null_password');

   $output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false);
   if (!$output->toBool()) return $output;

   $oModuleModel = &getModel('module');
   $config = $oModuleModel->getModuleConfig('member');

   // Check change_password_date
   $limit_date = $config->change_password_date;

   // Check if change_password_date is set
   if ($limit_date > 0) {
    $oMemberModel = &getModel('member');
    //$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
    if ($this->memberInfo->change_password_date < date ('YmdHis', strtotime ('-' . $limit_date . ' day'+ '))) {
     $this->setRedirectUrl(getNotEncodedUrl('','vid',Context::get('vid'),'mid',Context::get('mid'),'act','dispMemberModifyPassword'));
    }
   }

   if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
    
    if(!$config->after_login_url) {
     $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', ''+ ');
    } else {
     $returnUrl = $config->after_login_url;
    }

    $this->setRedirectUrl($returnUrl);
    return;
   }

   return $output;
        }

        /**
         * @brief Login by openid
         **/
        function procMemberOpenIDLogin($validator = "procMemberOpenIDValidate") {
            $oModuleModel = &getModel('module');
            $config = $oModuleModel->getModuleConfig('member');
            if($config->enable_openid != 'Y') $this->stop('msg_invalid_request');

            if(!defined('Auth_OpenID_RAND_SOURCE') && !file_exists("/dev/urandom"))
            {
                define('Auth_OpenID_RAND_SOURCE', null);
            }

            set_include_path(_XE_PATH_."modules/member/php-openid-1.2.3");
            require_once('Auth/OpenID.php');
            require_once('Auth/OpenID/Consumer.php');
            require_once('Auth/OpenID/XEStore.php');
            $store = new Auth_OpenID_XEStore();
            $consumer = new Auth_OpenID_Consumer($store);

            $user_id = Context::get('user_id');
            if (!$user_id) $user_id = Context::get('openid');
            $auth_request = $consumer->begin($user_id);
            $auth_request->addExtensionArg('sreg', 'required', 'email');
            $auth_request->addExtensionArg('sreg', 'optional', 'dob');
            if(!$auth_request)
            {
                return new Object(-1, "association failed");
            }

            $trust_root = 'http://'.$_SERVER["HTTP_HOST"];
            $referer_url = Context::get('referer_url');
            if (!$referer_url) $referer_url = $_SERVER['HTTP_REFERER'];
            if (!$referer_url)
                $referer_url = htmlspecialchars_decode(getRequestUri(RELEASE_SSL));
            $goto = urlencode($referer_url);
            $ApprovedURL = Context::getRequestUri(RELEASE_SSL) . "?module=member&act=" . $validator. "&goto=" . $goto;
            $redirect_url = $auth_request->redirectURL($trust_root, $ApprovedURL);
            $this->add("redirect_url", $redirect_url);
            if (Context::getRequestMethod() == 'POST')
                header("location:" . $redirect_url);
        }

        function getLegacyUserIDsFromOpenID($openid_identity) {
            //  Issue 17515512: workaround
            $result = array();
            $uri_matches = array();
            preg_match(Auth_OpenID_getURIPattern(), $openid_identity, $uri_matches);

            if (count($uri_matches) < 9) {
                for ($i = count($uri_matches); $i <= 9; $i++) {
                    $uri_matches[] = '';
                }
            }

            $scheme = $uri_matches[2];
            $authority = $uri_matches[4];
            $path = $uri_matches[5];
            $query = $uri_matches[6];
            $fragment = $uri_matches[8];

            if ($scheme === null) $scheme = '';
            if ($authority === null) $authority = '';
            if ($path === null) $path = '';
            if ($query === null) $query = '';
            if ($fragment === null) $fragment = '';

            if ($scheme == 'http' or $scheme == '')
                $scheme_part = '';
            else
                $scheme_part = $scheme."://";


            if ($path == '' || $path == '/') {
                $result[] = $scheme_part.$authority.''.$query.$fragment;
                $result[] = $scheme_part.$authority.'/'.$query.$fragment;
            }
            else {
                $result[] = $scheme_part.$authority.$path.$query.$fragment;
            }

            return $result;
        }

        /**
         * @brief openid authentication check
         **/
        function procMemberOpenIDValidate() {
            set_include_path(_XE_PATH_."modules/member/php-openid-1.2.3");
            require_once('Auth/OpenID.php');
            require_once('Auth/OpenID/Consumer.php');
            require_once('Auth/OpenID/XEStore.php');
            require_once('Auth/OpenID/URINorm.php');

            $store = new Auth_OpenID_XEStore();
            $consumer = new Auth_OpenID_Consumer($store);
            $response = $consumer->complete($_GET);
   switch($response->status) {
    case Auth_OpenID_CANCEL :
     // Handle if user authentication is canceled
     return $this->stop('authorization_canceled');
    case Auth_OpenID_FAILURE :
     // Handle if user authentication is failed due to a certain problem (for example, openid doesn't exist) (there is no authentication required deunga openid ..)
     return $this->stop('invalid_authorization');
    case Auth_OpenID_SUCCESS :
     // Authentication success!
     break;
    default:
     return $this->stop('invalid_authorization');
   }
            // Authentication success
            $oMemberModel = &getModel('member');
            // Get zeroboard ID which is corresponded to the openID ID.
            $login_success = false;
            $assoc_member_info = null;
            $openid_identity = $response->signed_args["openid.identity"];
            $args->openid = $openid_identity;
            $output = executeQuery('member.getMemberSrlByOpenID', $args);

            if ($output->toBool() && $output->data && !is_array($output->data)) {
                $member_srl = $output->data->member_srl;
    $columnList = array('member_srl', 'user_id');
                $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
                if ($member_info) {
                    $assoc_member_info = $member_info;
                }
            }

            $user_id_candidates = $this->getLegacyUserIDsFromOpenID($openid_identity);
            $default_user_id = $user_id_candidates[0];

            if ($assoc_member_info != null) {
                $user_id_candidates = array_merge(array($assoc_member_info->user_id), $user_id_candidates);
            }
            $sreg = $response->extensionResponse('sreg');

            foreach($user_id_candidates as $user_id) {
                $args->user_id = $args->nick_name = $user_id;
                // Get basic information
                $args->email_address = $sreg['email'];
                $args->user_name = $sreg['fullname'];
                if(!$args->user_name) list($args->user_name) = explode('@', $args->email_address);
                $args->birthday = str_replace('-','',$sreg['dob']);
                // Attempts self-authentication
                $output = $this->doLogin($args->user_id);

                if ($output->toBool()) {
                    if ($assoc_member_info == null) {
                        $logged_info = Context::get('logged_info');
                        $args->member_srl = $logged_info->member_srl;
                        $args->openid = $openid_identity;
                        executeQuery('member.addOpenIDToMember', $args);
                    }
                    $login_success = true;
                    break;
                }
            }

 

 

 

 

 

막막한거압니다.

 

예전에 zb4에서는 수정이 간단했는데

이건 뭐..

 

쿼리에서 값을받아오고 대조하고

로그인여부와 IP,member_srl 다른 쿼리값을 echo로 외부컨테이너로 전송시키려면

 

어떻게수정해야하나요? ㅜㅜㅜ

글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
stylix 1.5.x 버전대에서 "로그인 유지"가 전혀 안됩니다.  
지니쭈니 외부페이지  file  
장지원507 확장변수를 이용하여 확장변수 사용유무 조절하기 file  
울라탱 deleteModule trigger 관련  
mskiller 메인 화면에 각 게시판의 제목을 출력하는 방법 좀 알려주세요 [3] 2012.02.02 by 송동우
kimcp 젭속통계가 올라 가지 않습니다. [2] 2012.02.02 by 우냠냠냠
행복하소서 도와주세요.. [4] file 2012.02.02 by 황비
beginner 게시판 글 작성시 점선 테두리 제거 방법 [1] file 2012.02.02 by 송동우
쿨키드 xe.1.5.1.5. 업데이트후 홈페이지 접속 불가능 [1] 2012.02.02 by KANTSOFT
마법의가을 카페xe관련 질문입니다. 카페회원들간의 포인트랭킹을 출력하고싶습니다.  
우냠냠냠 송동우님 질문드립니다. [2] 2012.02.02 by 송동우
흑묘백묘 업 7Mbps 정도면 서버돌릴만 한지요? [6] 2012.02.02 by natura
포토올/wow XE 1.4.5.10에서 1.5.1.4로 업데이트 후 관리자 로그인 안됌.ㅜㅜ해결책?? [2] 2012.02.02 by 송동우
범선 다시한번 질문 ㅠㅠ... [1] 2012.02.02 by 송동우
느림에의미 이메일인증 설정시 회원 사용중지로 체크되는 현상 정상? [1] 2012.02.02 by 백성찬
acsl 두가지 문제가 있습니다. (첨부파일, content위젯) [1] 2012.02.02 by 송동우
샤로우 에디터 문제 어디서 풀어야 할까요? (이미지 본문삽입시 2개가 올라가는 문제) [2] file 2012.02.02 by 진아아빠
배나온슈퍼맨 이 스크립트 실행을... file  
whitemind 게시판 확장변수 질문드립니다.  
오는구름 너무 초보라... 답변이 이해되지 않아요. 도와주세요 고수님 [1] 2012.02.02 by 메디안
밸우~ 디자인을 제 맘데로 바꾸고싶은데요.. [1] 2012.02.02 by 송동우
배기홍601 언어별 내용이 달라집니다 [1] 2012.02.02 by 송동우
kjkyu0401 모바일에선 다른 메인을 사용하고 싶습니다. [1] 2012.02.02 by 카르마
whitemind 게시판을 이용해서 회원정보를 저장해서 관리하고 싶은데요..  
노튼 설문에 참여하면 포인트를 줄 수 없나요? [1] 2012.02.02 by 송동우
자막바다 외부(빈)페이지에서 접속자 카운터만 불러오려면 어떻게 해야 하나요?? [1] 2012.02.02 by 송동우
범선 회원가입정보이용질문 [1] 2012.02.02 by 송동우
zukno Call to undefined method Object::executeQuery() [1] 2012.02.02 by CMD
바람의매 포인트 완전 초기화 하는법좀 알려주세요 [1] 2012.02.02 by 송동우
SeunghyunLee 가입인증, id/pw찾기 메일이 하나도 안먹힙니다. [2] 2012.02.02 by ForHanbi