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

提供: wikipokpok
移動先: 案内検索
(特別ページの画像リスト等にパーミッションを設定する)
(rvv)
1行目: 1行目:
comment2
+
== 特定の権限を与えられたユーザーのみアクセスできる名前空間を作る(特定ページへのアクセス制限) ==
http://ulesnao.com/11/cheap-airline-tickets-to-cancun.html cheap seats airline tickets
+
新しいグループを作り、そのグループに属するユーザーのみに閲覧編集等の権限を与える。
http://ulesnao.com/11/map-of-berrien-county-michigan.html map of boston subway system
+
=== 1,新しいグループを作成する ===
http://ulesnao.com/12/mp3-players-and-headphones.html cable telephone provider
+
LocalSettings.phpに$wgGroupPermissionsを追記する。<br />
http://ulesnao.com/14/recipe-calorie-counter.html bean crockpot recipes
+
http://ulesnao.com/11/burlington-northern-route-map.html new hampshire cities and towns map
+
<pre>
http://ulesnao.com/0/map-of-wisconsin-rapids-wi.html map of worland wyoming
+
$wgGroupPermissions['groupname']['move']            = true;
http://ulesnao.com/18/guaira-venezuela-map.html typemapping beanmapping for
+
$wgGroupPermissions['groupname']['read']            = true;
http://ulesnao.com/11/map-of-seacaucus.html map of seend
+
$wgGroupPermissions['groupname']['edit']            = true;
http://ulesnao.com/7/on-line-map-of-the-united-states.html united states usa map driving
+
$wgGroupPermissions['groupname']['createpage']      = true;
http://ulesnao.com/14/maple-story-unrandomizer.html maple syrup in quebec
+
$wgGroupPermissions['groupname']['createtalk']      = true;
http://ulesnao.com/14/jokes-about-women-in.html jokes from women
+
$wgGroupPermissions['groupname']['upload']          = true;
http://ulesnao.com/6/duke-power-customer-service-phone-number.html dualphone multi point wireless bluetooth
+
$wgGroupPermissions['groupname']['reupload']        = true;
http://ulesnao.com/17/liptovsky-hradok-map.html live search mapes
+
$wgGroupPermissions['groupname']['reupload-shared'] = true;
http://ulesnao.com/0/airflo-tec-mt-fly-fishing.html purse seiners fishing
+
$wgGroupPermissions['groupname']['minoredit']      = true;
http://ulesnao.com/0/tony-and-guy-hair-styles.html top new hair styles
+
</pre>
http://ulesnao.com/post-office-jobs-in-california.html fun jobs in california
+
特別ページのユーザー権限の管理に反映されたgroupnameを、登録ユーザーに割り当てる。。
http://ulesnao.com/12/e51-md7161-2-phones.html e2811 2.4 ghz cordless phone
+
http://ulesnao.com/1/kalum-river-fishing.html free fishing takle
+
http://ulesnao.com/13/michigan-career-center.html loyola marymount university career center
+
http://ulesnao.com/2/september-2008-printable-calendar.html serie a calendario 2008 2009
+
http://ulesnao.com/15/traditional-roast-chicken-recipe.html peri peri marinade recipe
+
http://ulesnao.com/10/business-phone-system-pbx.html cellular phone track
+
http://ulesnao.com/5/yakama-reservation-map.html chicago ridge mall map
+
http://ulesnao.com/t-in-the-park-2008-tickets-go.html t in the park tickets from
+
http://ulesnao.com/1/baby-names-with-meaning.html baby names scottish
+
http://ulesnao.com/13/newark-airline-tickets.html lowest fare airline tickets
+
http://ulesnao.com/15/symbols-on-maps.html north miami map
+
http://ulesnao.com/5/mobile-phone-rates-australia.html mobile phone store new
+
http://ulesnao.com/11/bill-gaither-concert-tickets.html scalping concert tickets
+
http://ulesnao.com/2/map-of-california-congressional-districts.html map of cape cod towns
+
http://ulesnao.com/12/map-of-wapping.html map of williams lake bc
+
http://ulesnao.com/3/multiple-recipents-in.html sorbet sherbet recipe
+
http://ulesnao.com/6/kerala-chicken-curry-recipe.html lemmon pepper chicken recipe
+
http://ulesnao.com/16/driving-license-crash-course.html altomp3 gold 5.20 license key
+
http://ulesnao.com/16/cheap-cell-phones-att.html used att phone
+
http://ulesnao.com/11/frico-recipe-patate.html fresh squash recipes
+
http://ulesnao.com/11/squash-ravoli-recipe.html spinach kootu recipe
+
http://ulesnao.com/16/rock-used-auto-dealer.html used auto price guides
+
http://ulesnao.com/7/cat5-telephone-cable.html direct loans phone
+
http://ulesnao.com/0/top-female-baby-names.html baby names meaning free
+
http://ulesnao.com/17/free-tomtom-navigator-6-maps.html gillette wyoming map
+
http://ulesnao.com/10/in-the-anglophone.html headphones for mp3 and
+
http://ulesnao.com/16/potsticker-sauce-recipes.html vegan banana nut bread recipe
+
http://ulesnao.com/10/cdma-phone-service-providers.html cd 788v headphones
+
http://ulesnao.com/13/acini-di-pepe-fruit-salad-recipe.html restaurant tilapia recipe
+
http://ulesnao.com/map-of-saint-augustine.html map of silver coast
+
http://ulesnao.com/2/map132-dll-is.html mapa de guasave sinaloa
+
http://ulesnao.com/2/easy-turkey-soup-recipe.html famous barr french onion soup recipe
+
http://ulesnao.com/6/nine-mile-creek-fishing.html tony scavo fishing
+
http://ulesnao.com/1/greater-kansas-city-home-builders-association.html greater montgomery home builders
+
http://ulesnao.com/2/flybuys-phone-number.html samsung sgh x630 phone discount
+
http://ulesnao.com/11/magnetic-cell-phone-holder.html telstra phone cards
+
http://ulesnao.com/2/realistic-condenser-microphone.html labs aurvana dj headphones
+
  
comment5
+
=== 2,新しい名前空間を作成する ===
http://olpetsn.com/4/michael-buble-tickets-july.html michael buble tickets on
+
LocalSettings.phpに$wgExtraNamespaces,$wgNamespacesWithSubpages, and $wgNamespacesToBeSearchedDefaultを追記する。<br />
http://olpetsn.com/17/puerto-vallart-map.html 455 maple ave
+
http://olpetsn.com/10/folly-beach-vacation.html bethany beach vacation rentals
+
$wgExtraNamespaces =
http://olpetsn.com/14/telephone-number-search-in.html nortel phone line
+
      array(100 => "Hilfe",         #スペースは使えない
http://olpetsn.com/5/chicken-palao-recipe.html chicken palao recipe
+
            101 => "Hilfe_Diskussion",
http://olpetsn.com/11/used-cars-richardson-texas.html used cars kingston new york
+
            102 => "Aide",
http://olpetsn.com/6/trout-fishing-places.html carp fishing river ebro
+
            103 => "Discussion_Aide"
http://olpetsn.com/4/phone-wifi-card.html phone tru8885 2
+
            );
http://olpetsn.com/concert-tickets-cheap.html the cheapest concert tickets
+
 
http://olpetsn.com/0/peticure-dog-cat-nail.html pets dogs 2 for wii
+
<var>$wgNamespacesWithSubpages</var><br />
http://olpetsn.com/6/venus-headphone-adapter.html pennsylvania department of education phone
+
MediaWiki 1.4.x and olderの例:
http://olpetsn.com/0/tennis-championships-tickets.html darts championship 2008 tickets
+
$wgNamespacesWithSubpages =
http://olpetsn.com/6/cheese-salad-recipe.html chef recipe rice salad
+
        array( -1 => 0, 0 => 0, 1 => 1, 2 => 1, 3 => 1,
http://olpetsn.com/17/cell-phone-wireless-headsets.html pc to phone voip
+
              4 => 0, 5 => 1, 6 => 0, 7 => 1,
http://olpetsn.com/8/watch-bleach-episode-165-online.html watch bleach episode 5
+
              8 => 0, 9 => 1, 10 => 0,11 => 1,
http://olpetsn.com/0/channel-5-boston-weather.html wbz tv channel 4 boston
+
              '''100 => 1, 101 => 1''' );
http://olpetsn.com/4/logistics-jobs-houston.html welding jobs houston
+
MediaWiki 1.5.xの例:
http://olpetsn.com/4/java-map-set.html jerusalem city map
+
$wgNamespacesWithSubpages = array(
http://olpetsn.com/mystery-party-ideas.html mardi gras party ideas
+
NS_TALK          => true,
http://olpetsn.com/8/nicotine-withdrawal-symptoms.html equate nicotine gum
+
  NS_USER          => true,
http://olpetsn.com/10/buy-batman-movie-tickets.html better to buy tickets online or
+
  NS_USER_TALK      => true,
http://olpetsn.com/13/fresh-fish-taco-recipe.html fried fish taco recipe
+
  NS_PROJECT_TALK  => true,
http://olpetsn.com/friends-reuninted-dating.html female friends dating
+
  NS_IMAGE_TALK    => true,
http://olpetsn.com/14/top-gear-lotus.html top gear games
+
  NS_MEDIAWIKI_TALK => true,
http://olpetsn.com/11/person-who-invented-telephone.html boostaroo portable headphone amplifier
+
  NS_TEMPLATE_TALK  => true,
http://olpetsn.com/8/printable-calendar-may-june-2008.html printable calendar of july 2008
+
  NS_HELP_TALK      => true,
http://olpetsn.com/10/guam-public-school-system-calendar.html guilford county schools 2008 2009 calendar
+
  NS_CATEGORY_TALK  => true,
http://olpetsn.com/2/dvd-road-map.html the road map
+
  '''100              => true,'''
http://olpetsn.com/2/homemade-halloween-costume-ideas.html homemade batman costume
+
  '''101              => true'''
http://olpetsn.com/1/used-fuel-delivery-trucks.html used trucks dealership
+
);
http://olpetsn.com/19/6713-telephone-road-fort-worth.html 6639 cell phone
+
 
http://olpetsn.com/9/apple-snack-recipes.html apple shake recipe
+
<var>$wgNamespacesToBeSearchedDefault</var><br />
http://olpetsn.com/11/calendar-form-script.html calendar from july
+
MediaWiki 1.4.x and olderの例:
http://olpetsn.com/5/car-back-glass.html car glass fix
+
$wgNamespacesToBeSearchedDefault =
http://olpetsn.com/11/watch-your-friends.html i watch fosters home for imaginary friends
+
        array( -1 => 0, 0 => 1, 1 => 0, 2 => 0, 3 => 0,
http://olpetsn.com/9/the-family-guy-full-episodes.html tbs family guy full episodes
+
                4 => 0, 5 => 0, 6 => 0, 7 => 0,
http://olpetsn.com/4/fly-fishing-in-malaysia.html fly fishing in sa
+
                8 => 0, 9 => 1, 10 => 0, 11 => 1,
http://olpetsn.com/13/the-bank-job-cover.html story behind the bank job
+
                '''100 => 1, 101 => 1''' );
http://olpetsn.com/1/discount-tickets-for-rapids.html discount tickets for frontier city
+
 
http://olpetsn.com/0/metropolitan-museum-of-arts-store.html metropolitan museum of photography
+
MediaWiki 1.5.xの例:
http://olpetsn.com/1/memory-mapped-i-o-ports-rivatuner.html web images maps news shopping google mail more
+
$wgNamespacesToBeSearchedDefault = array( -1 => 0, NS_MAIN => 1, NS_USER => 0,
http://olpetsn.com/14/language-learning-video.html learn a human language
+
  NS_USER_TALK => 0, NS_PROJECT_TALK => 0, NS_IMAGE_TALK => 0,
http://olpetsn.com/0/recipe-for-chicken-curry-and.html recipe for chicken fettuccini alfredo
+
  NS_IMAGE_TALK => 0, NS_TEMPLATE_TALK => 0, NS_HELP_TALK => 0,
http://olpetsn.com/7/the-islamic-calendar-is-when-the-islamic.html the julian calendar and go backward
+
  NS_CATEGORY_TALK => 0,
http://olpetsn.com/4/anglophone-in-quebec.html disneyland anaheim phone number
+
  '''100 => 1, 101 => 1''' );
http://olpetsn.com/10/career-opportunities-in-fashion.html careers and opportunities
+
 
http://olpetsn.com/3/osso-buco-slow-cooker-recipe.html cuisinart pie crust recipe
+
=== 3,Title.php (includes/Title.php)を書き換える ===
http://olpetsn.com/8/fishing-trips-south-wales.html fishing tackle shop birmingham
+
Title.php (old)
http://olpetsn.com/17/3d-deer-hunting-games.html the best hunting games
+
 
http://olpetsn.com/18/cell-phone-charger-circuit-diagram.html cell phone baterry
+
if( $wgUser->isAllowed('read') ) {
http://olpetsn.com/0/east-world-map.html fotos de la mapacha
+
return true;
http://olpetsn.com/9/find-people-by-cell-phone-numbers.html att cell phones for sale
+
} 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に追記する。

2009年1月15日 (木) 01:03時点における版

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

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

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