묻고답하기

 

 

늅입니다.

 

그러니까 간단하게

복잡한거 다생략하고

외부컨테이너에서 기존 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 남기남
mskiller XE를 처음 실행할 때 설치조건확인에서 안넘어갑니다. [2] file 2012.01.31 by mskiller
94DT 글쓸때 제목 어떻게 고정시키죠 ㅜㅜ [2] 2012.01.31 by snows96
인형의기사 메일인증 다시 보내기? [1] 2012.01.31 by snows96
이드13 브라우저 크기조절에 따른 위젯 이동 문제.. [1] file 2012.01.31 by 이드13
LANDC 1.4~에서 1.5로 업데이트후 페이지수정이 안되요. [2] 2012.01.31 by snows96
IT맨 XE (ver. 1.5.1.4) 에서 안되는것 모음. 아시는분 없나요?  
sbshs77 XE 지식인 모듈에서 기본 포인트를 0으로 바꾸는 방법. [1] 2012.01.31 by 미식가
자작인간 회원 관리에서 가입폼에 로그인계정이 선택이 안돼요!ㅠ file  
CHZy db.class.php on line 420 에러...  
LANDC ....Help me 제발.... 페이지 수정이 먹통이 됐어요.  
눈과비 상품 미리보기 에러발생 file  
디키리스 썸네임 출력문의  
김상윤702 글쓰기란에 글양식이 미리 써져있게 할려면 어케 해야되나요?  
영무니 1.5.1.4 업데이트 후 문제 발생입니다.  
whitemind 모바일에서 화면이 PC버전이랑 겹쳐버리는 현상이 있습니다.  
제이메이크 한국에서 접속하면 한국어페이지, 일본에서 접속하면 일본어 페이지 뜨게끔!! [1] 2012.01.31 by Goos
민우민성 XE contact us에 관한 질문입니다.  
GreenReds 캘린더 공유를 위한 서비스를 추천해주세요....  
샤로우 한글은 도데체 어디에 짱박힌건가요? ㅎㅎ [2] 2012.01.31 by snows96
스포츠365 핸드폰으로 모바일 PC버젼으로 접속시 [1] 2012.01.31 by snows96
남자 데이터 이전 후 회원 [1] 2012.01.31 by snows96
오락실주인 네이버 신디케이션 질문요 ^^ [1] file 2012.01.31 by snows96
쿵푸팬더 레이아웃 상에 위젯 코드가 사라집니다. file  
IT맨 Content 위젯> 대상 모듈 > 사이트 찾기 윗젯 설치가 안됨  
데미안+ <ul> <li> 마우스오버 CSS 좀 알려주세요... [1] 2012.01.31 by 브레인630
개발해보쟈 룰셋 때문에 폼필터는 사라지나요? [4] 2012.01.30 by 클라우
루큐모닷컴 여러분 이소스르 [4] 2012.01.30 by snows96
코드야뭐니 확장변수 제발 답벼좀 부탁드립니다..  
bonafide 혹시 게시판 스킨 보신분 계신가요 ?^^ file  
슈퍼보드맨 레이아웃은 만들엇는데요,보드 나 다른 스킨은 안되네요. [2] 2012.01.30 by snows96