와
tpl_toolsevent('sitetools', array(
tpl_action('recent', true, 'li', true),
tpl_action('media', true, 'li', true),
tpl_action('index', true, 'li', true)
));
교체 비어
플러그인을 만듭니다. 플러그인 이름이 nositetoolsanon
이라고 가정하고 lib/plugins/nositetoolsanon/action.php
아래에 파일을 만들어야합니다.
<?php
if(!defined('DOKU_INC')) die();
class action_plugin_nositetoolsanon extends DokuWiki_Action_Plugin {
public function getInfo(){
return array('date'=>'2017-08-25', 'name'=>'No sitetools for anonymous users', 'author'=>'Phy25');
}
public function register(Doku_Event_Handler $controller) {
$controller->register_hook('TEMPLATE_SITETOOLS_DISPLAY', 'BEFORE', $this, 'action_link');
}
public function action_link(&$event, $param){
global $INFO;
if(empty($INFO["userinfo"])){
// more robust check by ACL: global $ID; if (auth_quickaclcheck($ID) < AUTH_READ)
$event->preventDefault();
}
}
}
이 방법은 모든 템플릿에 적용되며 업데이트로 덮어 쓰지 않습니다.
힌트 : 읽을 수없는 사용자의 네임 스페이스를 뒤집으려면 it may cause issues if deeper namespaces have higher permissions than the ones above이지만 구성 파일에 $conf['sneaky_index'] = 1
을 설정하십시오.
고마워요! StackOverflow에 대한 완벽한 대답. –
이것은 실제로 관리자를 제외한 모든 로그인 사용자의 링크를 숨기고 있습니다. – phy25