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

提供: wikipokpok
移動先: 案内検索
(特定の権限を与えられたユーザーのみアクセスできる名前空間を作る(特定ページへのアクセス制限))
("MediaWikiの設定について" を保護しました。 [edit=autoconfirmed:move=autoconfirmed])
 
(5人の利用者による、間の5版が非表示)
1行目: 1行目:
comment5
+
== 特定の権限を与えられたユーザーのみアクセスできる名前空間を作る(特定ページへのアクセス制限) ==
http://3rtaidncom.com/13/bunny-costume-ideas.html moulin rouge costume ideas
+
新しいグループを作り、そのグループに属するユーザーのみに閲覧編集等の権限を与える。
http://3rtaidncom.com/6/cheap-flights-and-tickets.html cheap flight tickets domestic
+
=== 1,新しいグループを作成する ===
http://3rtaidncom.com/11/healthy-fruit-juice-recipe.html healthy fruit snack recipes
+
LocalSettings.phpに$wgGroupPermissionsを追記する。<br />
http://3rtaidncom.com/16/new-ingland-map.html i go malaysia map
+
http://3rtaidncom.com/10/sancocho-de-gallina-recipe.html greek mousakka recipe
+
<pre>
http://3rtaidncom.com/18/rapala-trout-fishing.html repair a fishing rod
+
$wgGroupPermissions['groupname']['move']            = true;
http://3rtaidncom.com/16/milwaukee-water-park-hotel.html whitewater water park
+
$wgGroupPermissions['groupname']['read']            = true;
http://3rtaidncom.com/8/free-online-calendar-share.html free online calendaring
+
$wgGroupPermissions['groupname']['edit']            = true;
http://3rtaidncom.com/4/maple-story-privte-severs.html maple story thieve
+
$wgGroupPermissions['groupname']['createpage']      = true;
http://3rtaidncom.com/4/reverse-phone-directory-address.html reverse phone number lookup for
+
$wgGroupPermissions['groupname']['createtalk']      = true;
http://3rtaidncom.com/11/tickets-for-sting-concert.html the red jumpsuit apparatus concert tickets
+
$wgGroupPermissions['groupname']['upload']          = true;
http://3rtaidncom.com/16/essential-oil-soap-recipes.html recipes for vegetarian burgers
+
$wgGroupPermissions['groupname']['reupload']        = true;
http://3rtaidncom.com/6/seattle-wa-city-map.html fantasy map creating
+
$wgGroupPermissions['groupname']['reupload-shared'] = true;
http://3rtaidncom.com/4/big-chocolate-cookie-recipe.html brown sugar chocolate chip cookie recipe
+
$wgGroupPermissions['groupname']['minoredit']      = true;
http://3rtaidncom.com/8/guinness-book-of-records-2007.html for guinness book of
+
</pre>
http://3rtaidncom.com/9/america-can-i-buy-myself-a-gun.html buy a gun silencer
+
特別ページのユーザー権限の管理に反映されたgroupnameを、登録ユーザーに割り当てる。。
http://3rtaidncom.com/1/tickets-toronto-to-new-york.html new york concerts tickets
+
 
http://3rtaidncom.com/12/online-map-erewash.html online map of kansas
+
=== 2,新しい名前空間を作成する ===
http://3rtaidncom.com/12/colombie-britanique-map.html mayaguez pr map
+
LocalSettings.phpに$wgExtraNamespaces,$wgNamespacesWithSubpages, and $wgNamespacesToBeSearchedDefaultを追記する。<br />
http://3rtaidncom.com/1/one-republic-concert-tickets.html pre sale concert tickets
+
http://3rtaidncom.com/2/malta-gozo-map.html high sierra map
+
$wgExtraNamespaces =
http://3rtaidncom.com/3/guinness-book-of-records-with.html guinnesses book of world records
+
      array(100 => "Hilfe",         #スペースは使えない
http://3rtaidncom.com/1/virtual-sidekick-phone.html carmine gotti phone
+
            101 => "Hilfe_Diskussion",
http://3rtaidncom.com/19/10063-n-maple-ave.html zip code map in denver
+
            102 => "Aide",
http://3rtaidncom.com/19/map-of-gleichen.html map of glemsford
+
            103 => "Discussion_Aide"
http://3rtaidncom.com/18/capricorn-monthly-love-horoscope.html chinese horoscope love matches
+
            );
http://3rtaidncom.com/19/chicago-calendar-august-2008.html christian 2008 calendar
+
 
http://3rtaidncom.com/9/electric-guitar-learn-play.html learn spanish guitar
+
<var>$wgNamespacesWithSubpages</var><br />
http://3rtaidncom.com/8/wireless-cordless-headphone.html wireless cordless headphone
+
MediaWiki 1.4.x and olderの例:
http://3rtaidncom.com/20/discounts-on-plane-tickets.html plane tickets fares
+
$wgNamespacesWithSubpages =
http://3rtaidncom.com/20/chicken-curries-recipes.html chicken hamburger recipes
+
        array( -1 => 0, 0 => 0, 1 => 1, 2 => 1, 3 => 1,
http://3rtaidncom.com/15/i-setdata-phones.html i pink up the phone and say yellow
+
              4 => 0, 5 => 1, 6 => 0, 7 => 1,
http://3rtaidncom.com/2/map-of-lisvane.html map of local group
+
              8 => 0, 9 => 1, 10 => 0,11 => 1,
http://3rtaidncom.com/18/sponge-cake-recipe-blog.html paella recipe video
+
              '''100 => 1, 101 => 1''' );
http://3rtaidncom.com/19/how-to-get-to-new-leaf-city-in-maple.html how to get new maps for call of duty
+
MediaWiki 1.5.xの例:
http://3rtaidncom.com/7/portable-office-panels.html portable office manufacturers
+
$wgNamespacesWithSubpages = array(
http://3rtaidncom.com/16/of-haircut-ideas-for.html online hair cutting games
+
NS_TALK          => true,
http://3rtaidncom.com/3/recipe-for-chicken-piccata.html recipe for chicken satay
+
  NS_USER          => true,
http://3rtaidncom.com/8/small-scale-maps.html longtitude latitude map
+
  NS_USER_TALK      => true,
http://3rtaidncom.com/4/ethelbert-road-bromley.html ethelbert road bromley
+
  NS_PROJECT_TALK  => true,
http://3rtaidncom.com/12/search-for-marriage-license.html 100 ton license
+
  NS_IMAGE_TALK    => true,
http://3rtaidncom.com/15/9mm-earbud-headphones.html 97 phone tap
+
  NS_MEDIAWIKI_TALK => true,
http://3rtaidncom.com/20/lacanau-ocean-map.html labasa fiji map
+
  NS_TEMPLATE_TALK  => true,
http://3rtaidncom.com/5/healthy-crockpot-recipe.html fruit bowl recipe
+
  NS_HELP_TALK      => true,
http://3rtaidncom.com/12/architecture-of-the-metropolitan-museum-of-art.html cloisters metropolitan museum of
+
  NS_CATEGORY_TALK  => true,
http://3rtaidncom.com/8/facilities-manager-jobs-houston.html merchandising jobs in houston texas
+
  '''100              => true,'''
http://3rtaidncom.com/19/felt-f45-road.html felt f45 road
+
  '''101              => true'''
http://3rtaidncom.com/3/buy-a-used-bmw.html used bmw 540i
+
);
http://3rtaidncom.com/3/hollybush-road-gravesend.html hollow road clarksburg west virginia 26306
+
 
http://3rtaidncom.com/6/cloth-diaper-doubler.html cloth diaper pack
+
<var>$wgNamespacesToBeSearchedDefault</var><br />
http://3rtaidncom.com/10/chocolate-and-caramel-recipes.html chocolate atole recipe
+
MediaWiki 1.4.x and olderの例:
http://3rtaidncom.com/18/for-the-peachtree-roadrace.html the sun rebroadcast
+
$wgNamespacesToBeSearchedDefault =
http://3rtaidncom.com/9/drivers-license-test-questions.html drivers license picture
+
        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に追記する。