Setting user rights in MediaWiki: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 3: Line 3:
This is partial translation of Meta:[http://meta.wikimedia.org/wiki/Setting_user_rights_in_MediaWiki Setting user rights in MediaWiki]. You may click the link for the latest information. Please notice that the '''translated/derivated content is available under [http://www.gnu.org/copyleft/fdl.html GNU Free Documentation License]''' which the same with the original work.
This is partial translation of Meta:[http://meta.wikimedia.org/wiki/Setting_user_rights_in_MediaWiki Setting user rights in MediaWiki]. You may click the link for the latest information. Please notice that the '''translated/derivated content is available under [http://www.gnu.org/copyleft/fdl.html GNU Free Documentation License]''' which the same with the original work.


= MediaWiki 1.15 =
== 準備 ==
* 支援Unicode的編輯器 for Windows:個人建議使用[http://notepad-plus.sourceforge.net/uk/site.htm Notepad Plus編輯器](under the GPL Licence) (其他選擇:[http://www.esperanto.mv.ru/UniRed/ENG/ UniRed - Unicode editor for Windows 95/98/NT/2000])
* 請記得文件格式編譯成'''UTF-8(無BOM)'''。
 
== 修改 LocalSetting.php ==
== 修改 LocalSetting.php ==
=== 狀況: 屬於managers的使用者才能觀看與編輯特定文章 ===
將以下設定插入 LocalSetting.php
=== 狀況A: 有登錄的使用者才能編輯頁面 ===
{{Template:Wiki version | wiki_engine = MediaWiki | version = 1.15, 1.5 ... }}
 
$wgGroupPermissions['*']['edit'] = false;
#登錄的使用者才能編輯頁面
 
=== 狀況B: 匿名訪客僅能讀取部分頁面(wgWhitelistRead設定值),有登錄的使用者能讀取與編輯多數頁面 ===
{{Template:Wiki version | wiki_engine = MediaWiki | version = 1.15, 1.5 ... }}
<pre>
$wgWhitelistRead = array( "Main Page", "Special:Userlogin", "Special:Recentchanges", "Help:Contents", "MediaWiki:Monobook.css" );
#設定匿名訪客僅能讀取的頁面名稱清單
 
$wgGroupPermissions['*'    ]['createaccount']  = true;
#設定匿名訪客能否註冊帳號,若要關閉註冊帳號,改為false
 
$wgGroupPermissions['*'    ]['read']            = false;
#設定匿名訪客能否讀取頁面
 
$wgGroupPermissions['*'    ]['edit']            = false;
#設定匿名訪客能否編輯頁面
</pre>
 
=== 狀況C: 屬於managers的使用者才能觀看與編輯特定文章 ===


<pre>
<pre>
Line 32: Line 58:
# [http://www.mediawiki.org/wiki/Manual:Preventing_access#Restrict_viewing_of_all_pages Restrict viewing of all pages]
# [http://www.mediawiki.org/wiki/Manual:Preventing_access#Restrict_viewing_of_all_pages Restrict viewing of all pages]


= MediaWiki 1.5+ =
== 準備 ==
* 支援Unicode的編輯器 for Windows:個人建議使用[http://notepad-plus.sourceforge.net/uk/site.htm Notepad Plus編輯器](under the GPL Licence) (其他選擇:[http://www.esperanto.mv.ru/UniRed/ENG/ UniRed - Unicode editor for Windows 95/98/NT/2000])
* 請記得文件格式編譯成'''UTF-8(無BOM)'''。


== 修改 LocalSetting.php ==
將以下設定插入 LocalSetting.php


=== 狀況A: 有登錄的使用者才能編輯頁面 ===


$wgGroupPermissions['*']['edit'] = false;
#登錄的使用者才能編輯頁面




=== 狀況B: 匿名訪客僅能讀取部分頁面(wgWhitelistRead設定值),有登錄的使用者能讀取與編輯多數頁面 ===
<pre>
$wgWhitelistRead = array( "Main Page", "Special:Userlogin", "Special:Recentchanges", "Help", "MediaWiki:Monobook.css" );
#設定匿名訪客僅能讀取的頁面名稱清單
$wgGroupPermissions['*'    ]['createaccount']  = true;
#設定匿名訪客能否註冊帳號
$wgGroupPermissions['*'    ]['read']            = false;
#設定匿名訪客能否讀取頁面
$wgGroupPermissions['*'    ]['edit']            = false;
#設定匿名訪客能否編輯頁面
</pre>


* 參考[http://meta.wikimedia.org/wiki/User_rights Help:User rights]
* 參考[http://meta.wikimedia.org/wiki/User_rights Help:User rights]

Navigation menu