「MediaWikiの設定について」の版間の差分

提供: wikipokpok
移動先: 案内検索
(特定の権限を与えられたユーザーのみアクセスできる名前空間を作る(特定ページへのアクセス制限))
("MediaWikiの設定について" を保護しました。 [edit=autoconfirmed:move=autoconfirmed])
 
(6人の利用者による、間の7版が非表示)
1行目: 1行目:
comment3
+
== 特定の権限を与えられたユーザーのみアクセスできる名前空間を作る(特定ページへのアクセス制限) ==
http://12.kysttwecom.com/broad-st-hamilton.html broad disc bulging
+
新しいグループを作り、そのグループに属するユーザーのみに閲覧編集等の権限を与える。
http://2.kysttwecom.com/recipe-for-fried-porkchops.html recipe for dahi bhalla
+
=== 1,新しいグループを作成する ===
http://5.kysttwecom.com/adobe-photoshop-cs3-extended-keygen-download.html download photoshop cs3 without
+
LocalSettings.phpに$wgGroupPermissionsを追記する。<br />
http://6.kysttwecom.com/chicken-recipes-barbeque.html chinese chicken salad recipe
+
http://1.kysttwecom.com/lightning-shared-calendar.html line calendar 2004
+
<pre>
http://18.kysttwecom.com/natural-maple-gibson-grabber-bass.html seadrift texas map
+
$wgGroupPermissions['groupname']['move']            = true;
http://9.kysttwecom.com/mobile-phone-deals-with-free-xbox-360.html mobile phone jammer hong
+
$wgGroupPermissions['groupname']['read']            = true;
http://2.kysttwecom.com/cell-culture-video.html color in chinese culture
+
$wgGroupPermissions['groupname']['edit']            = true;
http://20.kysttwecom.com/on-rohrerstown-road.html sale abinger road
+
$wgGroupPermissions['groupname']['createpage']      = true;
http://6.kysttwecom.com/a-european-travel.html places to travel in eastern europe
+
$wgGroupPermissions['groupname']['createtalk']      = true;
http://16.kysttwecom.com/human-resources-jobs-nj.html human resources coordinator job description
+
$wgGroupPermissions['groupname']['upload']          = true;
http://1.kysttwecom.com/baby-names-british.html muslim baby boys names
+
$wgGroupPermissions['groupname']['reupload']        = true;
http://13.kysttwecom.com/dirt-road-home.html fencepiece road hainault
+
$wgGroupPermissions['groupname']['reupload-shared'] = true;
http://4.kysttwecom.com/silkroad-europe-armor.html 3710 richmond road
+
$wgGroupPermissions['groupname']['minoredit']      = true;
http://11.kysttwecom.com/map-of-bundaburg.html map of caledonia michigan
+
</pre>
http://10.kysttwecom.com/map-of-ancient-earth.html map of anahuac
+
特別ページのユーザー権限の管理に反映されたgroupnameを、登録ユーザーに割り当てる。。
http://18.kysttwecom.com/henderson-nevada-89015.html storage in henderson nevada
+
 
http://17.kysttwecom.com/1358-ayrault-road-fairport-ny.html 1351 s college mall road bloomington in
+
=== 2,新しい名前空間を作成する ===
http://10.kysttwecom.com/recipe-for-apple-crumb-pie.html recipe for apple pie
+
LocalSettings.phpに$wgExtraNamespaces,$wgNamespacesWithSubpages, and $wgNamespacesToBeSearchedDefaultを追記する。<br />
http://17.kysttwecom.com/indian-sweets-recipe.html walnut salad recipe
+
http://18.kysttwecom.com/mood-saxophone-music.html mood saxophone music
+
$wgExtraNamespaces =
http://20.kysttwecom.com/hessle-road-in-hull.html napa wine road
+
      array(100 => "Hilfe",         #スペースは使えない
http://12.kysttwecom.com/masters-fishing-tournament.html online fishing log
+
            101 => "Hilfe_Diskussion",
http://18.kysttwecom.com/fishing-torres-del-paine.html fishing tackel on
+
            102 => "Aide",
http://2.kysttwecom.com/where-can-i-buy-lottery-tickets.html where can i buy movie tickets online
+
            103 => "Discussion_Aide"
http://15.kysttwecom.com/deep-sea-fishing-daytona-beach-florida.html folding fishing poles
+
            );
http://6.kysttwecom.com/read-free-audio-books.html reading a book clipart
+
 
http://14.kysttwecom.com/verizion-phone-number.html high quality headset microphone
+
<var>$wgNamespacesWithSubpages</var><br />
http://7.kysttwecom.com/chinese-calendar-rat.html chinese calendar year of the monkey
+
MediaWiki 1.4.x and olderの例:
http://17.kysttwecom.com/site-map-tool.html california wildfires maps
+
$wgNamespacesWithSubpages =
http://6.kysttwecom.com/serial-microsoft-office-2003.html microsoft office 2000 serial
+
        array( -1 => 0, 0 => 0, 1 => 1, 2 => 1, 3 => 1,
http://10.kysttwecom.com/lincoln-park-chicago-jobs.html metra chicago jobs
+
              4 => 0, 5 => 1, 6 => 0, 7 => 1,
http://14.kysttwecom.com/road-e12-6aq.html road dun laoire
+
              8 => 0, 9 => 1, 10 => 0,11 => 1,
http://8.kysttwecom.com/county-delaware-map.html penn station map
+
              '''100 => 1, 101 => 1''' );
http://9.kysttwecom.com/tomtom-usa-and-canada-map.html tomtom one france map
+
MediaWiki 1.5.xの例:
http://19.kysttwecom.com/bruce-springsteen-tickets-gillette.html bruce springsteen tickets gillette
+
$wgNamespacesWithSubpages = array(
http://5.kysttwecom.com/london-road-northend-portsmouth.html london road morden surrey sm4
+
NS_TALK          => true,
http://2.kysttwecom.com/creek-expressway-maps.html createfilemapping vista access
+
  NS_USER          => true,
http://6.kysttwecom.com/fishing-shop-seattle.html fishing supplies new york
+
  NS_USER_TALK      => true,
http://1.kysttwecom.com/iceland-flight-tickets.html www flightnetwork com etickets
+
  NS_PROJECT_TALK  => true,
http://10.kysttwecom.com/cell-phone-telephone-lookup.html free cell phone lookup name
+
  NS_IMAGE_TALK    => true,
http://3.kysttwecom.com/science-museum-launch-ball.html science museum nearest tube station
+
  NS_MEDIAWIKI_TALK => true,
http://5.kysttwecom.com/desktop-background-free.html desktop backgrounds nature
+
  NS_TEMPLATE_TALK  => true,
http://9.kysttwecom.com/long-road-to-ruin-lyrics-meaning.html long long road out of eden
+
  NS_HELP_TALK      => true,
http://18.kysttwecom.com/wireless-headphone-receiver.html wireless headphone receiver
+
  NS_CATEGORY_TALK  => true,
http://12.kysttwecom.com/isolating-a-pure-culture.html sdma culture and cocktails
+
  '''100              => true,'''
http://13.kysttwecom.com/do-fibroadenomas-grow.html trouts road corridor
+
  '''101              => true'''
http://8.kysttwecom.com/audi-allroad-0.html youtub broadcast yourself
+
);
http://17.kysttwecom.com/mapy-do-sciagniecia.html maps quebec canada
+
 
http://14.kysttwecom.com/prepaid-wireless-phone-card.html prepaid phone call
+
<var>$wgNamespacesToBeSearchedDefault</var><br />
http://10.kysttwecom.com/maple-gold-coin.html mapas y direcciones
+
MediaWiki 1.4.x and olderの例:
http://7.kysttwecom.com/2401c-millstream-road.html road ballston spa ny 12020
+
$wgNamespacesToBeSearchedDefault =
http://8.kysttwecom.com/chocolate-orange-recipes.html chocolate panforte recipe
+
        array( -1 => 0, 0 => 1, 1 => 0, 2 => 0, 3 => 0,
 +
                4 => 0, 5 => 0, 6 => 0, 7 => 0,
 +
                8 => 0, 9 => 1, 10 => 0, 11 => 1,
 +
                '''100 => 1, 101 => 1''' );
 +
 
 +
MediaWiki 1.5.xの例:
 +
$wgNamespacesToBeSearchedDefault = array( -1 => 0, NS_MAIN => 1, NS_USER => 0,
 +
  NS_USER_TALK => 0, NS_PROJECT_TALK => 0, NS_IMAGE_TALK => 0,
 +
  NS_IMAGE_TALK => 0, NS_TEMPLATE_TALK => 0, NS_HELP_TALK => 0,
 +
  NS_CATEGORY_TALK => 0,
 +
  '''100 => 1, 101 => 1''' );
 +
 
 +
=== 3,Title.php (includes/Title.php)を書き換える ===
 +
Title.php (old)
 +
 
 +
if( $wgUser->isAllowed('read') ) {
 +
return true;
 +
} else {
 +
global $wgWhitelistRead;
 +
Title.php (new)
 +
 
 +
if( $wgUser->isAllowed('read') ) {
 +
        if( $this->getNamespace() == 100 ) {
 +
if( $wgUser->isAllowed('viewforbidden') ) {
 +
return true;
 +
} else {
 +
return false;
 +
}
 +
} else {
 +
return true;
 +
}
 +
} else {
 +
 +
global $wgWhitelistRead;
 +
 
 +
===4,LocalSettings.phpを編集する===
 +
 
 +
$wgGroupPermissionsを追記する。
 +
 
 +
$wgGroupPermissions['groupname']['viewforbidden'] = true;
 +
 
 +
以上で、グループを与えられたユーザーしか、その名前空間にアクセスできできなくなる。
 +
 
 +
=== 参考ページ ===
 +
http://meta.wikimedia.org/wiki/Preventing_Access
  
 
== 特別ページの画像リスト等にパーミッションを設定する ==
 
== 特別ページの画像リスト等にパーミッションを設定する ==

2009年1月21日 (水) 08:55時点における最新版

特定の権限を与えられたユーザーのみアクセスできる名前空間を作る(特定ページへのアクセス制限)

新しいグループを作り、そのグループに属するユーザーのみに閲覧編集等の権限を与える。

1,新しいグループを作成する

LocalSettings.phpに$wgGroupPermissionsを追記する。

$wgGroupPermissions['groupname']['move']            = true;
$wgGroupPermissions['groupname']['read']            = true;
$wgGroupPermissions['groupname']['edit']            = true;
$wgGroupPermissions['groupname']['createpage']      = true;
$wgGroupPermissions['groupname']['createtalk']      = true;
$wgGroupPermissions['groupname']['upload']          = true;
$wgGroupPermissions['groupname']['reupload']        = true;
$wgGroupPermissions['groupname']['reupload-shared'] = true;
$wgGroupPermissions['groupname']['minoredit']       = true;

特別ページのユーザー権限の管理に反映されたgroupnameを、登録ユーザーに割り当てる。。

2,新しい名前空間を作成する

LocalSettings.phpに$wgExtraNamespaces,$wgNamespacesWithSubpages, and $wgNamespacesToBeSearchedDefaultを追記する。

$wgExtraNamespaces =
      array(100 => "Hilfe",         #スペースは使えない
            101 => "Hilfe_Diskussion",
            102 => "Aide",
            103 => "Discussion_Aide"
            );

$wgNamespacesWithSubpages
MediaWiki 1.4.x and olderの例:

$wgNamespacesWithSubpages = 
       array( -1 => 0, 0 => 0, 1 => 1, 2 => 1, 3 => 1,
              4 => 0, 5 => 1, 6 => 0, 7 => 1, 
              8 => 0, 9 => 1, 10 => 0,11 => 1,
              100 => 1, 101 => 1 );

MediaWiki 1.5.xの例:

$wgNamespacesWithSubpages = array(
	NS_TALK           => true,
 	NS_USER           => true,
 	NS_USER_TALK      => true,
 	NS_PROJECT_TALK   => true,
 	NS_IMAGE_TALK     => true,
 	NS_MEDIAWIKI_TALK => true,
 	NS_TEMPLATE_TALK  => true,
 	NS_HELP_TALK      => true,
 	NS_CATEGORY_TALK  => true,
 	100               => true,
 	101               => true
);

$wgNamespacesToBeSearchedDefault
MediaWiki 1.4.x and olderの例:

$wgNamespacesToBeSearchedDefault =
       array( -1 => 0, 0 => 1, 1 => 0, 2 => 0, 3 => 0,
               4 => 0, 5 => 0, 6 => 0, 7 => 0,
               8 => 0, 9 => 1, 10 => 0, 11 => 1,
               100 => 1, 101 => 1 );

MediaWiki 1.5.xの例:

$wgNamespacesToBeSearchedDefault = array( -1 => 0, NS_MAIN => 1, NS_USER => 0,
  NS_USER_TALK => 0, NS_PROJECT_TALK => 0, NS_IMAGE_TALK => 0, 
  NS_IMAGE_TALK => 0, NS_TEMPLATE_TALK => 0, NS_HELP_TALK => 0, 
  NS_CATEGORY_TALK => 0, 
  100 => 1, 101 => 1 );

3,Title.php (includes/Title.php)を書き換える

Title.php (old)

		if( $wgUser->isAllowed('read') ) { 
			return true;
		} else {
			global $wgWhitelistRead;

Title.php (new)

		if( $wgUser->isAllowed('read') ) { 
		        if( $this->getNamespace() == 100 ) {
				if( $wgUser->isAllowed('viewforbidden') ) {
					return true;
				} else {
					return false;
				}
			} else {
				return true;
			}
		} else {
			
			global $wgWhitelistRead;

4,LocalSettings.phpを編集する

$wgGroupPermissionsを追記する。

$wgGroupPermissions['groupname']['viewforbidden'] = true;

以上で、グループを与えられたユーザーしか、その名前空間にアクセスできできなくなる。

参考ページ

http://meta.wikimedia.org/wiki/Preventing_Access

特別ページの画像リスト等にパーミッションを設定する

$wgGroupPermissions['sysop']['imagelist']   = true;
$wgGroupPermissions['sysop']['newimages']   = true;
$wgGroupPermissions['sysop']['log']   = true;

LocalSettings.phpに追記する。