문서 보기이전 판역링크Fold/unfold all맨 위로 이 문서는 읽기 전용입니다. 원본을 볼 수는 있지만 바꿀 수는 없습니다. 문제가 있다고 생각하면 관리자에게 문의하세요. ====== Dokuwiki와 XE의 연동 ====== Dokuwiki의 로그인 권한을 XE와 연동하는 방식을 설명합니다. Rhymix 연동은 구성이 살짝 다릅니다. 제가 한 방식은 [[rhymix dokuwiki연동]]에서 설명하였습니다. 기본적으로 https://openwiki.kr/tech/authxe 를 따릅니다. 다만 다음 부분에서 차이가 있습니다. ===== define XE 설정 ===== 원문과 다르게 ''/inc/init.php''가 아니라 ''/inc/preload.php'' 파일을 생성하고, 그부분에 해당 내용을 추가했습니다. ''init.php'' 파일의 바로 하단을 확인하면 ''preload.php'' 파일이 존재할 경우 include하도록 되어있으므로, 버전 업데이트 등에서도 안전하게 로그인 연동을 수행할 수 있습니다. <code php> <?php define("__ZBXE__",true); // xe 여기있소! define("__XE__",true); //XE 1.5.3 이후의 버전에서는 추가해야 한다. require_once("/home2/vaslor/html/bb/config/config.inc.php"); //XE설정파일의 적절한 경로를 넣다. $oContext = &Context::getInstance(); $oContext->init(); //도쿠위키 시작시에 XE도 같이 시작하는 것이다. ?> </code> =====authxe plugin 추가===== 이 부분은 원 문서와 거의 동일합니다. lib/plugins 폴더에 authxe 폴더를 추가하고 아래 파일을 넣었습니다. warning으로 인해 ''%%class_exists(Context)%%''를 ''%%class_exists('Context')%%''로 변경했습니다. <file php auth.php><?php // must be run within Dokuwiki if(!defined('DOKU_INC')) die(); /** * Authxe authentication backend * * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) * @author V_L <dryoo@live.com> */ class auth_plugin_authxe extends DokuWiki_Auth_Plugin { protected $users = null; protected $_pattern = array(); public function __construct() { parent::__construct(); $this->cando['external'] = true; global $config_cascade; } function trustExternal($user,$pass,$sticky=false){ global $USERINFO; if (class_exists('Context')) { $logged_info = Context::get("logged_info"); if($logged_info){ $sticky ? $sticky = true : $sticky = false; $USERINFO['name'] = $logged_info->nick_name; $USERINFO['pass'] = $logged_info->password; $USERINFO['mail'] = $logged_info->email_address; $USERINFO['grps'] = @array_values(@array_filter($logged_info->group_list)); $_SERVER['REMOTE_USER'] = $logged_info->user_id; $_SESSION[DOKU_COOKIE]['auth']['user'] = $logged_info->user_id; $_SESSION[DOKU_COOKIE]['auth']['info'] = $USERINFO; return true; } else return false; } else return false; } }</file> 개발/xe_dokuwiki연동.txt 마지막으로 수정됨: 2021/09/24 02:29저자 hide_d