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

提供: wikipokpok
移動先: 案内検索
(特定の権限を与えられたユーザーのみアクセスできる名前空間を作る(特定ページへのアクセス制限))
("MediaWikiの設定について" を保護しました。 [edit=autoconfirmed:move=autoconfirmed])
 
(15人の利用者による、間の19版が非表示)
1行目: 1行目:
comment3
+
== 特定の権限を与えられたユーザーのみアクセスできる名前空間を作る(特定ページへのアクセス制限) ==
http://cupamon322.hostevo.com/daiwa-fishing-lures.html sardis fishing report
+
新しいグループを作り、そのグループに属するユーザーのみに閲覧編集等の権限を与える。
http://rumin346.001webs.com/fishing-river-thames.html fishing trips south
+
=== 1,新しいグループを作成する ===
http://cupamon322.hostevo.com/fishing-reports-lakes.html fishing symulator 2
+
LocalSettings.phpに$wgGroupPermissionsを追記する。<br />
http://cupamon322.hostevo.com/short-american-jokes.html short fat jokes
+
http://marento90.007webs.com/big-game-fishing-cape.html ocean fishing map
+
<pre>
http://fefe543.rack111.com/fishing-tackle-wholesalers.html walleye fly fishing
+
$wgGroupPermissions['groupname']['move']            = true;
http://rumin346.001webs.com/handmade-fishing-nets.html northeast tuna fishing
+
$wgGroupPermissions['groupname']['read']            = true;
http://cupamon322.hostevo.com/fishing-tonka-walleye.html fishing the rapala
+
$wgGroupPermissions['groupname']['edit']            = true;
http://fefe543.rack111.com/great-fishing-tips.html carrot stix fishing rods
+
$wgGroupPermissions['groupname']['createpage']      = true;
http://rumin346.001webs.com/fishing-village-uk.html fishinger blvd columbus
+
$wgGroupPermissions['groupname']['createtalk']      = true;
http://rumin346.001webs.com/fishing-tide-chart.html fishing tide chart
+
$wgGroupPermissions['groupname']['upload']          = true;
http://mener69.100webspace.net/fishing-in-belise.html fishing howard county md
+
$wgGroupPermissions['groupname']['reupload']        = true;
http://fefe543.rack111.com/fishing-torres-del-paine.html fishing tackle shops aberdeen
+
$wgGroupPermissions['groupname']['reupload-shared'] = true;
http://rumin346.001webs.com/fishing-gift-basket.html cat fishing boats
+
$wgGroupPermissions['groupname']['minoredit']      = true;
http://fefe543.rack111.com/old-7-sportfishing.html jordan lake north carolina fishing
+
</pre>
http://fefe543.rack111.com/tampa-bay-fishing-reports.html free on line fishing
+
特別ページのユーザー権限の管理に反映されたgroupnameを、登録ユーザーに割り当てる。。
http://marento90.007webs.com/draycote-trout-fishing.html cabo san lucas fishing vacations
+
 
http://mener69.100webspace.net/fishing-hook-set.html missouri hunting fishing
+
=== 2,新しい名前空間を作成する ===
http://cupamon322.hostevo.com/the-warren-fishing.html catfish fishing techniques
+
LocalSettings.phpに$wgExtraNamespaces,$wgNamespacesWithSubpages, and $wgNamespacesToBeSearchedDefaultを追記する。<br />
http://cupamon322.hostevo.com/san-pedro-belize-fishing.html az trout fishing
+
http://cupamon322.hostevo.com/fishing-in-grand-canaria.html fishing in ceredigion
+
$wgExtraNamespaces =
http://rumin346.001webs.com/leeda-fishing-rod.html tennessee fishing cabins
+
      array(100 => "Hilfe",         #スペースは使えない
http://mener69.100webspace.net/michigan-steelhead-fly-fishing.html wedowee fishing report
+
            101 => "Hilfe_Diskussion",
http://rumin346.001webs.com/potomac-river-fishing-report.html key west fishing boats
+
            102 => "Aide",
http://cupamon322.hostevo.com/point-pleasant-fishing.html fishing boat model
+
            103 => "Discussion_Aide"
http://fefe543.rack111.com/smallmouth-bass-fishing-guides.html idaho fly fishing shops
+
            );
http://fefe543.rack111.com/berkley-fishing-poles.html tiffany lakosky bowfishing video
+
 
http://marento90.007webs.com/girls-gone-fly-fishing.html salmon fishing game
+
<var>$wgNamespacesWithSubpages</var><br />
http://mener69.100webspace.net/calendarios-mas-calientes.html calendarpal v2 1  
+
MediaWiki 1.4.x and olderの例:
http://rumin346.001webs.com/april-2008-printable-calendar.html april 2008 calendar planner
+
$wgNamespacesWithSubpages =
http://fefe543.rack111.com/bumper-fishing-rod-holder.html walleye fishing articles
+
        array( -1 => 0, 0 => 0, 1 => 1, 2 => 1, 3 => 1,
http://mener69.100webspace.net/farmway-1-fishing.html saltwater fishing terms
+
              4 => 0, 5 => 1, 6 => 0, 7 => 1,
http://cupamon322.hostevo.com/fishing-in-river.html fishing salmon river
+
              8 => 0, 9 => 1, 10 => 0,11 => 1,
http://fefe543.rack111.com/2009-calendar-year-with-holidays.html 2009 calendar with stat holidays
+
              '''100 => 1, 101 => 1''' );
http://cupamon322.hostevo.com/fishing-reports-for-cabo.html fishing report in ocean
+
MediaWiki 1.5.xの例:
http://rumin346.001webs.com/deep-sea-fishing-oahu.html bass fishing lodge
+
$wgNamespacesWithSubpages = array(
http://marento90.007webs.com/rapala-tournament-fishing-wii.html casting fishing rods
+
NS_TALK          => true,
http://marento90.007webs.com/joker-from-next-friday.html joke sms in urdu
+
  NS_USER          => true,
http://rumin346.001webs.com/tallebudgera-creek-fishing.html sea fishing for tuna
+
  NS_USER_TALK      => true,
http://fefe543.rack111.com/fly-in-fishing-bc.html wholesale fishing supply
+
  NS_PROJECT_TALK  => true,
http://rumin346.001webs.com/night-ice-fishing.html used sportfishing boats
+
  NS_IMAGE_TALK    => true,
http://mener69.100webspace.net/shore-tuna-fishing.html meeker colorado fishing
+
  NS_MEDIAWIKI_TALK => true,
http://rumin346.001webs.com/fishing-net-maker.html fishing in mequinenza
+
  NS_TEMPLATE_TALK  => true,
http://mener69.100webspace.net/freshwater-fishing-license.html boat fishing rod holder
+
  NS_HELP_TALK      => true,
http://marento90.007webs.com/offshore-fishing-bait.html saltwater fishing information
+
  NS_CATEGORY_TALK  => true,
http://fefe543.rack111.com/saltwater-salmon-fishing.html saltwater salmon fishing
+
  '''100              => true,'''
http://marento90.007webs.com/trout-fishing-in-ca.html ocracoke island fishing
+
  '''101              => true'''
http://mener69.100webspace.net/halibut-fishing-sf-bay.html tying braid fishing line
+
);
http://rumin346.001webs.com/shore-saltwater-fishing.html biloxi fishing charters
+
 
http://marento90.007webs.com/fishing-knots-loop-to.html fishing in ongar
+
<var>$wgNamespacesToBeSearchedDefault</var><br />
http://marento90.007webs.com/free-fishing-products.html electronic fishing pole
+
MediaWiki 1.4.x and olderの例:
http://rumin346.001webs.com/fishing-shop-chicago.html fishing season cabo
+
$wgNamespacesToBeSearchedDefault =
http://fefe543.rack111.com/trolling-fishing-lures.html conejos river fishing
+
        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に追記する。