묻고답하기

 

 

늅입니다.

 

그러니까 간단하게

복잡한거 다생략하고

외부컨테이너에서 기존 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 남기남
장승일 포인트 시스템 아시는분..  
한청년-_- 백업된 sql 어떻게 적용하나요? [1] 2008.10.29 by 우리아기
쿨유노 Help_ 캐나다에서 사이트 접속이 안되네요 [1] 2008.10.29 by csolix
hahacoba 제 게시판이 파일첨부가 안되요 [3] 2008.10.29 by 우리아기
박성우167 도와주세요 [5] 2008.10.29 by ⅴⅴⅴⅴⅴ
우리아기 svn으로 어제 패치 했는데요..... 첨부파일쪽이 이렇게 나와요  
한청년-_- 백업된 sql적용어떻게하나요? 급급급 [1] 2008.10.29 by 백성찬
TEOP (제발 도와주세요) 게시판에서 특정 글을 썼을때... [2] 2008.10.30 by TEOP
MEGAMIX 다시한번 질문..본문 하단의 여백문제... [2] file 2008.10.30 by MEGAMIX
paulkim FTP 어쩌고 저쩌고;; [4] file 2008.10.30 by 두운초온
나그네 http://도메인명/zbxe/?mid=tour [3] 2008.10.30 by bluepark
러브콘 제로보드 설치후 에러가 나서 삭제를 하려고 하니 files 폴더가 삭제가 안됩니다. [2] 2008.10.30 by z
신기루418 다른아이피 동시접속 차단  
리봄 파일 첨부 오류 문제 (백성찬님 글 읽어 봤습니다만, 초짜라서요) [3] 2008.10.30 by 이해가
홈피가이 제로보드 관련 책자 푸펀좀... [1] 2008.10.30 by 비나무
세상속으로 좌측메뉴바부분 테두리부분에 대한 질문입니다. [2] 2008.10.30 by 세상속으로
msuhsy 본문과 리스트를 동시에나오게하려면? [1] 2008.10.30 by 비나무
初心不變 XE 사용가능한 웹호스팅 알고계시는분..? [3] 2008.10.30 by 뉴자인
별사탕FS 1.06으로 업데이트 해도 첨부가 안됩니다. [1] 2008.10.30 by 비나무
뉴자인 (스샷첨부) 최신글 클릭하면 원하는 페이지로 어케 보내죠? [3] file 2008.10.30 by 뉴자인
김정태748 php 문서안에 제로보드를 include 하려는데 안됩니다. 도와주세요 [1] 2008.10.30 by 지나가다
제비엑스 프레임구성과 레이아웃... [1] 2008.10.30 by 지나가다
카니무사 최근 이미지 말인데요 [2] 2008.10.30 by 카니무사
별사탕FS 그림과 같이 했는데도 안되네요. [2] file 2008.10.30 by 백성찬
김동현 설치후 관리자 모드로 안들어가 집니다. [1] 2008.10.30 by 네비™
뚱뚱빵빵 DyCalendar.setup 에러관련  
-_-735 1.0.6버젼으로 업뎃했는데..  
기시맨 레이아웃 image 파일 경로  
박인호 게시판이 열리지 않는 문제에 대해 문의드립니다. [1] 2020.03.14 by 박인호
별사탕FS 마이그레이션 - 제로보드4 => xe 로 이전 순서 [2] 2008.10.30 by 백성찬