위키 액션에 권한주기

[ Plugin / Security for Wiki Action / Leave Comment ]

  • Pmwiki는 if구문으로 어느 페이지나 나만 볼 수 있는 글을 쓸 수 있다. 그러나 그렇게 쓰더라도 Source나 History(diff) 또는 Rss로 내보내면 무용지물.
    config.php에 추가할 것들
    php
    1. SDV($SourceShowGroups,array("Comments", "WAI", "Plugin", "CSS", "Javascript"));
    2. // diff나 source 액션을 허용할 그룹들 array
    3. function SourceShowGroup($pagename){
    4.     global $SourceShowGroups;
    5.     $matchGroup = false;
    6.     for($c=0; $c<count($SourceShowGroups); $c++){
    7.         if(!preg_match('/^'.$SourceShowGroups[$c].'/',$pagename)){
    8.         $matchGroup = false;
    9.         } else {
    10.         $matchGroup = true; break;
    11.         }
    12.     }
    13. return $matchGroup;
    14. }
    15. if (SourceShowGroup($pagename)) {
    16.     $HandleAuth['source'] = 'read';
    17.     $HandleAuth['diff'] = 'read';
    18. } else {
    19.     $HandleAuth['source'] = 'edit';
    20.     $HandleAuth['diff'] = 'edit';
    21. }
  • RSS도 비슷하게 설정해주면 된다.

Categories : Web | PHP