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

提供: wikipokpok
移動先: 案内検索
(特別ページの画像リスト等にパーミッションを設定する)
("MediaWikiの設定について" を保護しました。 [edit=autoconfirmed:move=autoconfirmed])
 
(4人の利用者による、間の4版が非表示)
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
+
http://3rtaidncom.com/12/colombie-britanique-map.html mayaguez pr map
+
http://3rtaidncom.com/1/one-republic-concert-tickets.html pre sale concert tickets
+
http://3rtaidncom.com/2/malta-gozo-map.html high sierra map
+
http://3rtaidncom.com/3/guinness-book-of-records-with.html guinnesses book of world records
+
http://3rtaidncom.com/1/virtual-sidekick-phone.html carmine gotti phone
+
http://3rtaidncom.com/19/10063-n-maple-ave.html zip code map in denver
+
http://3rtaidncom.com/19/map-of-gleichen.html map of glemsford
+
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
+
http://3rtaidncom.com/8/wireless-cordless-headphone.html wireless cordless headphone
+
http://3rtaidncom.com/20/discounts-on-plane-tickets.html plane tickets fares
+
http://3rtaidncom.com/20/chicken-curries-recipes.html chicken hamburger recipes
+
http://3rtaidncom.com/15/i-setdata-phones.html i pink up the phone and say yellow
+
http://3rtaidncom.com/2/map-of-lisvane.html map of local group
+
http://3rtaidncom.com/18/sponge-cake-recipe-blog.html paella recipe video
+
http://3rtaidncom.com/19/how-to-get-to-new-leaf-city-in-maple.html how to get new maps for call of duty
+
http://3rtaidncom.com/7/portable-office-panels.html portable office manufacturers
+
http://3rtaidncom.com/16/of-haircut-ideas-for.html online hair cutting games
+
http://3rtaidncom.com/3/recipe-for-chicken-piccata.html recipe for chicken satay
+
http://3rtaidncom.com/8/small-scale-maps.html longtitude latitude map
+
http://3rtaidncom.com/4/ethelbert-road-bromley.html ethelbert road bromley
+
http://3rtaidncom.com/12/search-for-marriage-license.html 100 ton license
+
http://3rtaidncom.com/15/9mm-earbud-headphones.html 97 phone tap
+
http://3rtaidncom.com/20/lacanau-ocean-map.html labasa fiji map
+
http://3rtaidncom.com/5/healthy-crockpot-recipe.html fruit bowl recipe
+
http://3rtaidncom.com/12/architecture-of-the-metropolitan-museum-of-art.html cloisters metropolitan museum of
+
http://3rtaidncom.com/8/facilities-manager-jobs-houston.html merchandising jobs in houston texas
+
http://3rtaidncom.com/19/felt-f45-road.html felt f45 road
+
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
+
http://3rtaidncom.com/10/chocolate-and-caramel-recipes.html chocolate atole recipe
+
http://3rtaidncom.com/18/for-the-peachtree-roadrace.html the sun rebroadcast
+
http://3rtaidncom.com/9/drivers-license-test-questions.html drivers license picture
+
  
comment3
+
=== 2,新しい名前空間を作成する ===
http://3rtaidncom.com/9/peach-soup-recipes.html pear canning recipe
+
LocalSettings.phpに$wgExtraNamespaces,$wgNamespacesWithSubpages, and $wgNamespacesToBeSearchedDefaultを追記する。<br />
http://3rtaidncom.com/5/people-search-reverse-phone-number.html landline phone deals
+
http://3rtaidncom.com/4/e-stealth-bluetooth-mobile-phone-spy.html tracfone prepaid cellular phone black tfgv170
+
$wgExtraNamespaces =
http://3rtaidncom.com/3/map-of-ocean-blvd.html map of north york moors
+
      array(100 => "Hilfe",         #スペースは使えない
http://3rtaidncom.com/14/glazed-chicken-breast-recipe.html good recipes for chicken
+
            101 => "Hilfe_Diskussion",
http://3rtaidncom.com/12/maps-of-dallas-tx.html maps of gatlinburg
+
            102 => "Aide",
http://3rtaidncom.com/1/amapa-iron-ore.html lcs rampages map
+
            103 => "Discussion_Aide"
http://3rtaidncom.com/2/books-on-broadway.html lds org broadcast
+
            );
http://3rtaidncom.com/5/direct-travel-insurance-shoreham.html express centurion travel insurance
+
 
http://3rtaidncom.com/13/gpsmap-60cs-gps.html santa clarita map
+
<var>$wgNamespacesWithSubpages</var><br />
http://3rtaidncom.com/18/rapala-trout-fishing.html mackerel fishing techniques
+
MediaWiki 1.4.x and olderの例:
http://3rtaidncom.com/13/south-carolina-area-map.html crescent edinburgh map
+
$wgNamespacesWithSubpages =
http://3rtaidncom.com/13/hotel-sambhar-recipe.html pickle recipe blog
+
        array( -1 => 0, 0 => 0, 1 => 1, 2 => 1, 3 => 1,
http://3rtaidncom.com/4/maple-story-privte-severs.html maple story tespia private
+
              4 => 0, 5 => 1, 6 => 0, 7 => 1,
http://3rtaidncom.com/18/painshill-park-fishing.html spearfishing wet suits
+
              8 => 0, 9 => 1, 10 => 0,11 => 1,
http://3rtaidncom.com/3/recipe-of-sandwitches.html recipe pane di
+
              '''100 => 1, 101 => 1''' );
http://3rtaidncom.com/9/cell-phone-long-distance.html phone and address search
+
MediaWiki 1.5.xの例:
http://3rtaidncom.com/3/clean-marine-jokes.html 55 birthday jokes
+
$wgNamespacesWithSubpages = array(
http://3rtaidncom.com/9/everlast-lonely-road.html road direction map
+
NS_TALK          => true,
http://3rtaidncom.com/9/some-extra-money.html extra in make money
+
  NS_USER          => true,
http://3rtaidncom.com/12/neritic-zone-map.html weather mapleton ut
+
  NS_USER_TALK      => true,
http://3rtaidncom.com/6/seattle-wa-city-map.html weekly weather maps
+
  NS_PROJECT_TALK  => true,
http://3rtaidncom.com/5/kilmarnock-road-glasgow-g41.html killala road ballina co mayo
+
  NS_IMAGE_TALK    => true,
http://3rtaidncom.com/4/ca-92069-map.html ca 90095 map
+
  NS_MEDIAWIKI_TALK => true,
http://3rtaidncom.com/15/telephones-online-bill-payment.html grand cancun phone
+
  NS_TEMPLATE_TALK  => true,
http://3rtaidncom.com/18/cresyl-violet-recipe.html creme brulea recipe
+
  NS_HELP_TALK      => true,
http://3rtaidncom.com/8/standby-flight-tickets.html cheap flight tickets com
+
  NS_CATEGORY_TALK  => true,
http://3rtaidncom.com/15/employment-listings-canada.html employment guide canada
+
  '''100              => true,'''
http://3rtaidncom.com/20/road-america-events.html road altoona pa 16601
+
  '''101              => true'''
http://3rtaidncom.com/20/2009-dvd-rapidshare.html basics dvd rapidshare
+
);
http://3rtaidncom.com/6/malayala-manorama-daily-news-paper.html greensburg daily news indiana
+
 
http://3rtaidncom.com/16/boston-scientific-phone.html real phone book
+
<var>$wgNamespacesToBeSearchedDefault</var><br />
http://3rtaidncom.com/2/judes-ormeau-road-belfast.html upton road claughton
+
MediaWiki 1.4.x and olderの例:
http://3rtaidncom.com/20/what-is-ad-adware.html ad adware serial
+
$wgNamespacesToBeSearchedDefault =
http://3rtaidncom.com/1/gerroa-fishing-club.html game fishing holidays in
+
        array( -1 => 0, 0 => 1, 1 => 0, 2 => 0, 3 => 0,
http://3rtaidncom.com/13/reverse-cellphone-lookup-canada.html totally free reverse cell phone lookup
+
                4 => 0, 5 => 0, 6 => 0, 7 => 0,
http://3rtaidncom.com/11/map-southern-ireland.html mapa conceptual sobre la
+
                8 => 0, 9 => 1, 10 => 0, 11 => 1,
http://3rtaidncom.com/10/home-rentals-in-torrance.html home rentals listings
+
                '''100 => 1, 101 => 1''' );
http://3rtaidncom.com/10/used-his-cell-phone.html shure wh30xlr condenser headset microphone with
+
 
http://3rtaidncom.com/7/fair-roadford-lake.html old dalkeith road eh16
+
MediaWiki 1.5.xの例:
http://3rtaidncom.com/1/hotels-on-charnley-road.html buckingham road shoreham
+
$wgNamespacesToBeSearchedDefault = array( -1 => 0, NS_MAIN => 1, NS_USER => 0,
http://3rtaidncom.com/16/why-should-i-quit-smoking.html quit smoking plans
+
  NS_USER_TALK => 0, NS_PROJECT_TALK => 0, NS_IMAGE_TALK => 0,
http://3rtaidncom.com/1/broadlands-lake-southampton.html broadminded take five
+
  NS_IMAGE_TALK => 0, NS_TEMPLATE_TALK => 0, NS_HELP_TALK => 0,
http://3rtaidncom.com/5/mta-subway-map-with-streets.html soldeau piste map
+
  NS_CATEGORY_TALK => 0,
http://3rtaidncom.com/3/jobs-granbury-texas.html estate jobs in austin texas
+
  '''100 => 1, 101 => 1''' );
http://3rtaidncom.com/4/net-10-phone-problems.html inside telephone sales
+
 
http://3rtaidncom.com/12/maple-syrup-better-than-sugar.html maple syurp supplies
+
=== 3,Title.php (includes/Title.php)を書き換える ===
http://3rtaidncom.com/1/trichy-road-map.html bulgaria physical map
+
Title.php (old)
http://3rtaidncom.com/10/arbor-road-livonia-mi-48150.html arapahoe road greenwood village colorado
+
 
http://3rtaidncom.com/3/hollybush-road-gravesend.html hollybush road gravesend
+
if( $wgUser->isAllowed('read') ) {
http://3rtaidncom.com/2/kids-star-wars-costumes.html kids spiderman costume
+
return true;
http://3rtaidncom.com/6/long-term-weather-forecast-san.html long range weather forecast marbella
+
} else {
http://3rtaidncom.com/17/american-museum-of-natural-history-anthropology.html american mueseum of natural history
+
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に追記する。

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に追記する。