묻고답하기



contact us 모듈관련 질문인데요    fhttp://www.brideand.co.kr/reservation.html --------------- 이 페이지에 있는건데요

 

로그인 하지 않은 경우에도 실행하려면 어찌해야 하는지 궁금합니다. - 아시는 분들의 도움 부탁드립니다.-----

 

다른 질문 답변보고 아래와 같이 해보아도 안되네요

 

 

--------------------------------- 제가 바꾼 부분은 124 줄인데요-------------------------------------------------------------------

// 권한 체크
switch($permission_target) {
case 'root' :
$this->stop('msg_not_permitted_act');
break;
case 'manager' :
if(!$grant->manager) $this->stop('msg_not_permitted_act');
break;
case 'member' :
if(!$is_logged&&$module_info->mid!='reservation') $this->stop('msg_not_permitted_act');
break;
}
}

--------------------------------------------------------------------------------------------------------------------------------------------------

 

 

원래 부분-------------------------------------------------------------------------------------------------------------------------------------------------------

<?php
    /**
    * @class ModuleObject
    * @author zero (zero@nzeo.com)
    * @brief base class of ModuleHandler
    **/

    class ModuleObject extends Object {

        var $mid = NULL; ///< string to represent run-time instance of Module (XE Module)
        var $module = NULL; ///< Class name of Xe Module that is identified by mid
        var $module_srl = NULL; ///< integer value to represent a run-time instance of Module (XE Module)
        var $module_info = NULL; ///< an object containing the module information
        var $xml_info = NULL; ///< an object containing the module description extracted from XML file

        var $module_path = NULL; ///< a path to directory where module source code resides

        var $act = NULL; ///< a string value to contain the action name

        var $template_path = NULL; ///< a path of directory where template files reside
        var $template_file = NULL; ///< name of template file

        var $layout_path = ''; ///< a path of directory where layout files reside
        var $layout_file = ''; ///< name of layout file
        var $edited_layout_file = ''; ///< name of temporary layout files that is modified in an admin mode

        var $stop_proc = false; ///< a flag to indicating whether to stop the execution of code.

        /**
         * @brief setter to set the name of module
         * @param name of module
         **/
        function setModule($module) {
            $this->module = $module;
        }

        /**
         * @brief setter to set the name of module path
         * @param the directory path to a module directory
         **/
        function setModulePath($path) {
            if(substr($path,-1)!='/') $path.='/';
            $this->module_path = $path;
        }

        /**
         * @brief setter to set an url for redirection
         * @param $url url for redirection
         * @remark redirect_url is used only for ajax requests
         **/
        function setRedirectUrl($url='./') {
            $this->add('redirect_url', $url);
        }

        /**
         * @brief sett to set the template path for refresh.html
         * @remark refresh.html is executed as a result of method execution
         * 공통 tpl중 refresh.html을 실행할 뿐..
         **/
        function setRefreshPage() {
            $this->setTemplatePath('./common/tpl');
            $this->setTemplateFile('refresh');
        }


        /**
         * @brief sett to set the action name
         **/
        function setAct($act) {
            $this->act = $act;
        }

        /**
         * @brief sett to set module information
         * @param[in] $module_info object containing module information
         * @param[in] $xml_info object containing module description
        **/
        function setModuleInfo($module_info, $xml_info) {
            // 기본 변수 설정
            $this->mid = $module_info->mid;
            $this->module_srl = $module_info->module_srl;
            $this->module_info = $module_info;
            $this->xml_info = $xml_info;
            $this->skin_vars = $module_info->skin_vars;

            // 웹서비스에서 꼭 필요한 인증 정보와 권한 설정 체크
            $is_logged = Context::get('is_logged');
            $logged_info = Context::get('logged_info');

            // module model 객체 생성
            $oModuleModel = &getModel('module');

            // XE에서 access, manager (== is_admin) 는 고정된 권한명이며 이와 관련된 권한 설정
            $module_srl = Context::get('module_srl');
            if(!$module_info->mid && preg_match('/^([0-9]+)$/',$module_srl)) {
                $request_module = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
                if($request_module->module_srl == $module_srl) {
                    $grant = $oModuleModel->getGrant($request_module, $logged_info);
                }
            } else {
                $grant = $oModuleModel->getGrant($module_info, $logged_info, $xml_info);
            }

            // 현재 모듈의 access 권한이 없으면 권한 없음 표시
            //if(!$grant->access) return $this->stop("msg_not_permitted");

            // 관리 권한이 없으면 permision, action 확인
            if(!$grant->manager) {
                // 현재 요청된 action의 퍼미션 type(guest, member, manager, root)를 구함
                $permission_target = $xml_info->permission->{$this->act};

                // module.xml에 명시된 퍼미션이 없을때 action명에 Admin이 있으면 manager로 체크
                if(!$permission_target && substr_count($this->act, 'Admin')) $permission_target = 'manager';

                // 권한 체크
                switch($permission_target) {
                    case 'root' :
                            $this->stop('msg_not_permitted_act');
                        break;
                    case 'manager' :
                            if(!$grant->manager) $this->stop('msg_not_permitted_act');
                        break;
                    case 'member' :
                            if(!$is_logged) $this->stop('msg_not_permitted_act');
                        break;
                }
            }

            // 권한변수 설정
            $this->grant = $grant;
            Context::set('grant', $grant);

            if(method_exists($this, 'init')) $this->init();
        }

        /**
         * @brief set the stop_proc and approprate message for msg_code
         * @param $msg_code an error code
         **/
        function stop($msg_code) {
            // proc 수행을 중지 시키기 위한 플래그 세팅
            $this->stop_proc = true;

            // 에러 처리
            $this->setError(-1);
            $this->setMessage($msg_code);

            // message 모듈의 에러 표시
            $oMessageView = &getView('message');
            $oMessageView->setError(-1);
            $oMessageView->setMessage($msg_code);
            $oMessageView->dispMessage();

            $this->setTemplatePath($oMessageView->getTemplatePath());
            $this->setTemplateFile($oMessageView->getTemplateFile());

            return $this;
        }

        /**
         * @brief set the file name of the template file
         **/
        function setTemplateFile($filename) {
            if(substr($filename,-5)!='.html') $filename .= '.html';
            $this->template_file = $filename;
        }

        /**
         * @brief retrieve the directory path of the template directory
         **/
        function getTemplateFile() {
            return $this->template_file;
        }

        /**
         * @brief set the directory path of the template directory
         **/
        function setTemplatePath($path) {
            if(substr($path,0,1)!='/' && substr($path,0,2)!='./') $path = './'.$path;
            if(substr($path,-1)!='/') $path .= '/';
            $this->template_path = $path;
        }

        /**

         * @brief retrieve the directory path of the template directory
         **/
        function getTemplatePath() {
            return $this->template_path;
        }

        /**
         * @brief set the file name of the temporarily modified by admin
         **/
        function setEditedLayoutFile($filename) {
            if(substr($filename,-5)!='.html') $filename .= '.html';
            $this->edited_layout_file = $filename;
        }

        /**
         * @brief retreived the file name of edited_layout_file
         **/
        function getEditedLayoutFile() {
            return $this->edited_layout_file;
        }

        /**
         * @brief set the file name of the layout file
         **/
        function setLayoutFile($filename) {
            if(substr($filename,-5)!='.html') $filename .= '.html';
            $this->layout_file = $filename;
        }

        /**
         * @brief get the file name of the layout file
         **/
        function getLayoutFile() {
            return $this->layout_file;
        }

        /**
         * @brief set the directory path of the layout directory
         **/
        function setLayoutPath($path) {
            if(substr($path,0,1)!='/' && substr($path,0,2)!='./') $path = './'.$path;
            if(substr($path,-1)!='/') $path .= '/';
            $this->layout_path = $path;
        }

        /**
         * @brief set the directory path of the layout directory
         **/
        function getLayoutPath() {
            return $this->layout_path;
        }

        /**
         * @brief excute the member method specified by $act variable
         *
         **/
        function proc() {
            // stop_proc==true이면 그냥 패스
            if($this->stop_proc) return false;

            // addon 실행(called_position 를 before_module_proc로 하여 호출)
            $called_position = 'before_module_proc';
            $oAddonController = &getController('addon');
            $addon_file = $oAddonController->getCacheFilePath();
            @include($addon_file);

            if(isset($this->xml_info->action->{$this->act}) && method_exists($this, $this->act)) {

                // 권한 체크
                if(!$this->grant->access) return $this->stop("msg_not_permitted_act");

                // 모듈의 스킨 정보를 연동 (스킨 정보의 테이블 분리로 동작대상 모듈에만 스킨 정보를 싱크시키도록 변경)
                $oModuleModel = &getModel('module');
                $oModuleModel->syncSkinInfoToModuleInfo($this->module_info);
                Context::set('module_info', $this->module_info);

                // 실행
                $output = $this->{$this->act}();

            // act이 없으면 action_forward에서 해당하는 act가 있는지 찾아서 대신 실행
            } else if(Context::isInstalled()) {
                $oModuleModel = &getModel('module');

                $forward = null;

                // 현재 요청된 action의 대상 모듈을 찾음
                // 1. action이름으로 검색 (DB검색 없이 하기 위함)
                if(preg_match('/^([a-z]+)([A-Z])([a-z0-9\_]+)(.*)$/', $this->act, $matches)) {
                    $module = strtolower($matches[2].$matches[3]);
                    $xml_info = $oModuleModel->getModuleActionXml($module);
                    if($xml_info->action->{$this->act}) {
                        $forward->module = $module;
                        $forward->type = $xml_info->action->{$this->act}->type;
                        $forward->act = $this->act;
                    }
                }

                // 2. 1번에서 찾지 못하면 action forward를 검색
                if(!$forward) $forward = $oModuleModel->getActionForward($this->act);

                // 찾아진 forward 모듈이 있으면 실행
                if($forward->module && $forward->type && $forward->act && $forward->act == $this->act) {

                    $kind = strpos(strtolower($forward->act),'admin')!==false?'admin':'';

                    $oModule = &getModule($forward->module, $forward->type, $kind);
                    $xml_info = $oModuleModel->getModuleActionXml($forward->module);

                    $oModule->setAct($forward->act);
                    $oModule->init();
                    if($oModule->stop_proc) return $this->stop($oModule->getMessage());

                    $oModule->setModuleInfo($this->module_info, $xml_info);

                    if(isset($xml_info->action->{$forward->act}) && method_exists($oModule, $forward->act)) {
                        $output = $oModule->{$forward->act}();
                    } else {
                        return $this->stop("msg_module_is_not_exists");
                    }

                    // forward 모듈의 실행 결과 검사
                    if($oModule->stop_proc) return $this->stop($oModule->getMessage());

                    $this->setTemplatePath($oModule->getTemplatePath());
                    $this->setTemplateFile($oModule->getTemplateFile());
                    if($oModule->getLayoutFile()) $this->setLayoutFile($oModule->getLayoutFile());

                    $this->adds($oModule->getVariables());
                    $this->setMessage($oModule->getMessage());
                    $this->setError($oModule->getError());

                // forward 모듈을 찾지 못했다면 원 모듈의 default index action을 실행
                } else if($this->xml_info->default_index_act && method_exists($this, $this->xml_info->default_index_act)) {
                    Context::set('act',$this->act = $this->xml_info->default_index_act);
                    $output = $this->{$this->xml_info->default_index_act}();
                } else {
                    return false;
                }

            } else {
                return false;
            }

            // addon 실행(called_position 를 after_module_proc로 하여 호출)
            $called_position = 'after_module_proc';
            $oAddonController = &getController('addon');
            $addon_file = $oAddonController->getCacheFilePath();
            @include($addon_file);

            if(is_a($output, 'Object') || is_subclass_of($output, 'Object')) {
                $this->setError($output->getError());
                $this->setMessage($output->getMessage());
                return false;
            }

            // view action이고 결과 출력이 XMLRPC 또는 JSON일 경우 해당 모듈의 api method를 실행
            if($this->module_info->module_type == 'view'){
                if(Context::getResponseMethod() == 'XMLRPC' || Context::getResponseMethod() == 'JSON') {
                    $oAPI = getAPI($this->module_info->module, 'api');
                    if(method_exists($oAPI, $this->act)) {
                        $oAPI->{$this->act}($this);
                    }
                }
            }

            return true;
        }
    }
?>

 

글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
무지개2949 설정에서 파일박스가 저장이 되지 않으며 파일업로드가 되지 않습니다  
ppks21 소셜xe mid 포워딩이 작동하지 않습니다.  
midluck.net 닉네임클릭하면 나타나는 콘텍스트메뉴  
kss 제로보드에서 XE로 갈아타는 방법 [2] 2012.04.03 by zero28
살려주세욤 해킹방지하는법..,,살려주세요 [5] 2012.04.03 by 도라미
별을 사랑했네 데브님 ~^6 덕분에 80% 는 성공 했습니다. [1] 2012.04.03 by 별을 사랑했네
GT네오 뭔가좀 많이 이상 합니다. ㅡㅡ;; file  
별을 사랑했네 디렉토리에서 루드로 계정을 변경 할려면 ? [1] 2012.04.02 by 데브위트™
비커즈 익명게시판 질문 드립니다. [3] 2012.04.02 by 송동우
HolyJohn 파일박스가 뭔가요?  
Konghee 마우스 오버시 텍스트 호버링(주석나타내기..레이어적용)  
easeE 친구 리스트를 불러오고 싶습니다. [3] 2012.04.02 by 송동우
메호르 xe 1.4.1.1에서 최신 버전으로 업데이트 하는 방법 좀 알려주세요 [1] 2012.04.02 by 데브위트™
오냐오냐와투 모바일 레이아웃 회원가입 질문입니다~~  
mekey 위젯코드 생성 시 위제 스타일 코드(상세히)도 같이 생성은 할 수 없나요? [3] 2012.04.02 by mekey
bonik 정보 출력 질문?  
쫑효다컴 contact us 모듈관련 질문인데요  
크루나 과일가게 레이아웃사용중인데요 ..맨밑에 xe마크. 게시판이름들이뜨는데 [3] file 2012.04.02 by 데브위트™
별을 사랑했네 호스팅 이전시 질문입니다. [1] 2012.04.02 by 데브위트™
kuksys Error Code: HTTP Error, File name Message: 500 업로드시 애러 [1] 2012.04.02 by 데브위트™
비커즈 익명게시판 괜찮은거 스킨명점 가르쳐주세요~!!! [1] 2012.04.02 by 데브위트™
어쭈구리メ 어드민페이지에서 [1] 2012.04.02 by 데브위트™
임종관287 특정 게시판에 허용된 회원만 접속하되, 중복접속 차단할 수 있는지? [1] 2012.04.02 by 데브위트™
임종관287 게시판 본문에 XML 파일을 넣을 수 있는 궁금합니다. [1] 2012.04.02 by 데브위트™
박경서726 통합검색 - 외부문서로했을시 검색이안되요. [1] 2012.04.02 by 데브위트™
ㅅ ㅅ ㅓ ㄴ ㅣ 회원가입시 메세지가 뜨네요. [1] file 2012.04.02 by 데브위트™
김문식242 관리자 모드 비번을 잊어버렸는데 어찌해야할지요ㅜㅜ [1] 2012.04.02 by 데브위트™
제주오돌 관리자모드 확장메뉴에서 추가를 클릭했을때... [1] 2012.04.02 by 데브위트™
나우2006 게시판 댓글 등록시 file  
혼자267 저 왜 이러는 건가요.. file