묻고답하기

 

 

늅입니다.

 

그러니까 간단하게

복잡한거 다생략하고

외부컨테이너에서 기존 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 남기남
일등고구마 화일첨부가 안 되네요 [1] 2008.10.31 by 백성찬
개돌 파일 첨부 문제 수정 관련 질문 [2] 2008.10.31 by 개돌
박서영824 관리자 페이지가 안 떠요 ㅜ [5] 2008.10.31 by 박서영824
개돌 첨부파일 썸네일이 안나오네요 [1] 2008.10.31 by 백성찬
Eris ● 최근게시물, 카운터 등 위치에 대해 [2] 2008.10.31 by hOZooinfo
kangho 답변채택기능 추가.... [1] 2008.10.31 by 느까끼
TizTom 웹페이지 안에 제로보드 게시판을 넣고 싶습니다. [1] 2008.10.31 by 느까끼
노을사랑 정말 갑갑합니다 [1] 2008.10.31 by 느까끼
kangho 메일인증 내용이......  
댄디짱 게시판의 파일첨부기능 오류 [1] 2008.11.01 by 백성찬
비스무리 상단2차메뉴가 Log Out시 비활성화???  
Badboy 홈페이지 기본 페이지 index.html [1] 2008.11.01 by 백성찬
휘잉 [해결][이미지첨부] 로그인 화면이 어긋납니다. [6] file 2008.11.01 by 휘잉
휘잉 메뉴이동이 안되고 listorder값을 입력하라고 하네요.. [3] file 2008.11.01 by 백성찬
나진짜 메일인증 재 발송  
huksley db선택하고 다음눌르면 이런에러가..... [3] file 2008.11.01 by 애니맥스
あきら XE레이아웃 메뉴얼 위치변경 문의 [2] 2008.11.01 by あきら
박성우167 XE버젼 에서도 [1] 2008.11.01 by 백성찬
박서영824 회원가입 새창으로 띄우기  
셀군 외부페이지관련 [1] 2008.11.01 by 느까끼
돌풍 Fatal error file  
souffle [질문]혹시 제로보드 영문판이 따로 있는지요..? [6] 2008.11.21 by 토리세상
참악동 이런 식으로 구성 하려면 어찌 해야 하나요? [4] file 2008.11.01 by 참악동
QT [회원가입 폼] 정보 기입 쉽게 안돼요.  
이수형639 로고 이미지가 보이고 안보이고 이상해요 ㅠㅠ 고수님들 봐주세요 [2] 2008.11.01 by 이수형639
행운아 제로보드 저작권 표시부분 감추는 방법 없나요 [2] 2008.11.01 by 행운아
PPoZZak ''이 댓글을...'' 이거 삭제하고픈데요 [2] file 2008.11.01 by PPoZZak
박성우167 스킨을 업테이트했는데 이런 메세지가 떠요 [2] 2008.11.01 by 성우
&d 게시판 상단 내용 글색상 변경 [2] file 2008.11.01 by &d
오타왕자 첨부화일 클릭오류 관련 질문드립니다. [2] 2008.11.01 by 일등고구마