묻고답하기

 

 

늅입니다.

 

그러니까 간단하게

복잡한거 다생략하고

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