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

提供: wikipokpok
移動先: 案内検索
(特別ページの画像リスト等にパーミッションを設定する)
1行目: 1行目:
comment1
+
== 特定の権限を与えられたユーザーのみアクセスできる名前空間を作る(特定ページへのアクセス制限) ==
http://8sdygrecom.com/3/logans-roadhouse-location.html logans roadhouse monday
+
新しいグループを作り、そのグループに属するユーザーのみに閲覧編集等の権限を与える。
http://8sdygrecom.com/19/contour-map-data.html west didsbury map
+
=== 1,新しいグループを作成する ===
http://8sdygrecom.com/20/perch-fish-recipes.html pickeld fish recipe
+
LocalSettings.phpに$wgGroupPermissionsを追記する。<br />
http://8sdygrecom.com/20/unlocking-gsm-phones.html track cell phone numbers
+
http://8sdygrecom.com/14/developing-a-personal-development-plan.html personal development plan guide
+
<pre>
http://8sdygrecom.com/18/soccer-ball-history.html indoor soccer ball
+
$wgGroupPermissions['groupname']['move']            = true;
http://8sdygrecom.com/8/pritchards-road-birmingham.html prison road represa ca
+
$wgGroupPermissions['groupname']['read']            = true;
http://8sdygrecom.com/4/jonas-brothers-tickets-in-atlanta.html jonas brothers concert tickets for sale
+
$wgGroupPermissions['groupname']['edit']            = true;
http://8sdygrecom.com/10/tech-2-line-cordless-phone.html of a gramaphone
+
$wgGroupPermissions['groupname']['createpage']      = true;
http://8sdygrecom.com/10/touchtel-broadband-connection-bangalore.html ecorse road belleville mi
+
$wgGroupPermissions['groupname']['createtalk']      = true;
http://8sdygrecom.com/7/knoxville-tn-calendar-of-events.html kurt adler advent calendars
+
$wgGroupPermissions['groupname']['upload']          = true;
http://8sdygrecom.com/20/map-of-names.html the mississippi map
+
$wgGroupPermissions['groupname']['reupload']        = true;
http://8sdygrecom.com/12/adobe-keygen-instructions.html adobe golive cs keygen
+
$wgGroupPermissions['groupname']['reupload-shared'] = true;
http://8sdygrecom.com/13/map-of-portglenone.html map of porthtowan
+
$wgGroupPermissions['groupname']['minoredit']      = true;
http://8sdygrecom.com/15/best-taco-recipe.html creamy tacos recipe
+
</pre>
http://8sdygrecom.com/16/nicole-kidman-hairstyle.html new wavy hairstyles
+
特別ページのユーザー権限の管理に反映されたgroupnameを、登録ユーザーに割り当てる。。
http://8sdygrecom.com/14/house-harfield-road.html house ledson road
+
http://8sdygrecom.com/5/country-roads-words.html thornhill park road
+
http://8sdygrecom.com/12/shimano-fishing-reel-repairs.html on your doorstep fishing
+
http://8sdygrecom.com/4/phone-book-service.html magic phone service
+
http://8sdygrecom.com/17/calendar-of-holidays-for-2008.html calendar of february
+
http://8sdygrecom.com/17/7025-tomken-road-unit.html 700 cortelyou road
+
http://8sdygrecom.com/6/city-of-portland-parking-tickets.html haydock park tickets
+
http://8sdygrecom.com/3/thailand-country-map.html south beach miami hotels map
+
http://8sdygrecom.com/1/instrument-microphone-cardioid.html instinct cell phone cover
+
http://8sdygrecom.com/19/benefits-of-career-development.html career development and employment
+
http://8sdygrecom.com/13/dinamap-service-manual.html vina del mar chile map
+
http://8sdygrecom.com/2/177-broad-st.html down the old plank road lyrics
+
http://8sdygrecom.com/9/road-london-w2-4rj.html road london w3 8bl
+
http://8sdygrecom.com/7/recipe-pork-fillet.html recipe for dog food
+
http://8sdygrecom.com/16/disney-channel-high-school-musical-2.html disney channel high school musical 2 games
+
http://8sdygrecom.com/20/japanese-cake-recipes.html orange pound cake recipe
+
http://8sdygrecom.com/2/a900m-cell-phone.html best phone number search
+
http://8sdygrecom.com/14/boston-city-map.html imapi cd burning
+
http://8sdygrecom.com/18/mapacha-en-h-extremo.html mapas hidrograficos de
+
http://8sdygrecom.com/18/road-haulage-association-conditions.html road indianapolis in 46250
+
http://8sdygrecom.com/1/top-rated-broadway-shows-in-new-york.html elfchild roadhog mountain
+
http://8sdygrecom.com/2/pilates-for-back-and-posture.html back brace improve posture
+
http://8sdygrecom.com/8/low-fat-low-cholesterol-diets.html low cholesterol diet foods
+
http://8sdygrecom.com/20/creative-gift-basket-ideas.html cute valentines day gift ideas
+
http://8sdygrecom.com/8/calendar-of-june-2008.html calendar of november 2008
+
http://8sdygrecom.com/9/homedics-plus-shiatsu-back-massager-with-heat.html homedics black ultimate comfort back massager
+
http://8sdygrecom.com/13/jobs-in-canadaigua.html tdcanada trust jobs
+
http://8sdygrecom.com/11/american-history-x-kerb.html american history x imdb
+
http://8sdygrecom.com/10/and-whining-road-lyrics.html dragonball z shin budokai another road iso
+
http://8sdygrecom.com/4/louisiana-state-code.html va state code
+
http://8sdygrecom.com/7/apartments-benidorm-telephone.html my phone samsung u600
+
http://8sdygrecom.com/18/education-as-a-career.html early childhood education careers
+
http://8sdygrecom.com/6/native-language-map.html calgary ctrain map
+
http://8sdygrecom.com/8/top-stuffing-mix-recipes.html top recipes sites
+
http://8sdygrecom.com/10/campden-road-south-croydon.html cameron road tsim
+
http://8sdygrecom.com/18/nigger-jokes-page-2.html hyperlite ho joker
+
  
comment2
+
=== 2,新しい名前空間を作成する ===
http://0eyteurcom.com/17/vegetarian-meals-recipe.html vegetarian meat recipe
+
LocalSettings.phpに$wgExtraNamespaces,$wgNamespacesWithSubpages, and $wgNamespacesToBeSearchedDefaultを追記する。<br />
http://0eyteurcom.com/11/epiphone-wildkat-trans.html epiphone playerpack special
+
http://0eyteurcom.com/11/north-american-culture.html cultured marble vanity tops
+
$wgExtraNamespaces =
http://0eyteurcom.com/12/broad-head-road.html broad leaved pepper
+
      array(100 => "Hilfe",         #スペースは使えない
http://0eyteurcom.com/1/road-users-guide.html road walnut ca 91789
+
            101 => "Hilfe_Diskussion",
http://0eyteurcom.com/18/map-of-copperbelt.html map of colva
+
            102 => "Aide",
http://0eyteurcom.com/1/topographical-maps-symbols.html ducie street manchester map
+
            103 => "Discussion_Aide"
http://0eyteurcom.com/12/offensive-one-liner-jokes.html fill it with water joke
+
            );
http://0eyteurcom.com/12/need-for-speed-downloadable.html need for speed full game downloads
+
 
http://0eyteurcom.com/16/good-telephone-manner.html france phone area code
+
<var>$wgNamespacesWithSubpages</var><br />
http://0eyteurcom.com/15/map-of-buntingford.html map of bushey herts
+
MediaWiki 1.4.x and olderの例:
http://0eyteurcom.com/14/french-culture-lesson-plans.html current japanese culture
+
$wgNamespacesWithSubpages =
http://0eyteurcom.com/3/maps-of-the-south-east.html maps of the south east
+
        array( -1 => 0, 0 => 0, 1 => 1, 2 => 1, 3 => 1,
http://0eyteurcom.com/2/coarse-fishing-england.html sea king fishing
+
              4 => 0, 5 => 1, 6 => 0, 7 => 1,
http://0eyteurcom.com/18/by-stained-glass-windows.html bunclody stained glass
+
              8 => 0, 9 => 1, 10 => 0,11 => 1,
http://0eyteurcom.com/6/kohonen-map-vlsi.html ma login s mappedurl
+
              '''100 => 1, 101 => 1''' );
http://0eyteurcom.com/14/cute-hairstyles-long-hair.html cute hairstyles on
+
MediaWiki 1.5.xの例:
http://0eyteurcom.com/2/hot-pepper-chicken-recipe.html hot and spicy chicken wings recipe
+
$wgNamespacesWithSubpages = array(
http://0eyteurcom.com/6/deep-fishing-sea-trip.html deep sea crab fishing
+
NS_TALK          => true,
http://0eyteurcom.com/10/shepherds-pie-recipe-cheese.html shepherds pie all recipes
+
  NS_USER          => true,
http://0eyteurcom.com/12/maporama-route-planner.html mapp pro gas
+
  NS_USER_TALK      => true,
http://0eyteurcom.com/2/one-language-one-culture.html saheb bhim rao ambedkar college of agriculture engg etawah
+
  NS_PROJECT_TALK  => true,
http://0eyteurcom.com/7/ultrapure-water-quality-inc.html the water supply water quality regulations
+
  NS_IMAGE_TALK    => true,
http://0eyteurcom.com/10/reviews-of-in-ear-headphones.html johnston iowa phone
+
  NS_MEDIAWIKI_TALK => true,
http://0eyteurcom.com/6/download-avatar-book-1.html avatar book 3 list
+
  NS_TEMPLATE_TALK  => true,
http://0eyteurcom.com/18/massachusetts-united-states-map.html large map of turkey
+
  NS_HELP_TALK      => true,
http://0eyteurcom.com/17/merge-calendars-in-outlook.html a aztec calendar
+
  NS_CATEGORY_TALK  => true,
http://0eyteurcom.com/16/magazine-with-free-eye-pencils.html free fantasy football magazine
+
  '''100              => true,'''
http://0eyteurcom.com/19/jonas-brothers-tickets-march-22.html jonas brothers tickets los
+
  '''101              => true'''
http://0eyteurcom.com/8/authentic-chicken-tikka-masala-recipe.html baked chicken crispy recipe
+
);
http://0eyteurcom.com/15/rushcroft-road-sw2.html fishinger road hilliard
+
 
http://0eyteurcom.com/11/home-rentals-in-sonoma-county.html home rentals in stockton
+
<var>$wgNamespacesToBeSearchedDefault</var><br />
http://0eyteurcom.com/1/send-a-message-to-a-cell-phone-for-free.html send a message to a mobile phone from
+
MediaWiki 1.4.x and olderの例:
http://0eyteurcom.com/15/map-of-pottsville-pa.html map of protarus cyprus
+
$wgNamespacesToBeSearchedDefault =
http://0eyteurcom.com/7/lincoln-journal-star-newspaper-in-lincoln.html kansas city star newspaper subscription
+
        array( -1 => 0, 0 => 1, 1 => 0, 2 => 0, 3 => 0,
http://0eyteurcom.com/20/openwave-mobile-phone.html corded phone with cordless handsets
+
                4 => 0, 5 => 0, 6 => 0, 7 => 0,
http://0eyteurcom.com/16/diabetic-chocolate-chip-cookies-recipe.html spicy chicken marinade recipes
+
                8 => 0, 9 => 1, 10 => 0, 11 => 1,
http://0eyteurcom.com/10/eli-and-edythe-broad-center-for-regenerative-medicine.html elizabeth ann broadnax
+
                '''100 => 1, 101 => 1''' );
http://0eyteurcom.com/15/6756-snake-road.html 6754 valley view road
+
 
http://0eyteurcom.com/18/telephone-wiring-repairs.html telephone preferance agency
+
MediaWiki 1.5.xの例:
http://0eyteurcom.com/13/httpsession-to-flexsession-map-not-created-in-message-broker.html human linkage maps
+
$wgNamespacesToBeSearchedDefault = array( -1 => 0, NS_MAIN => 1, NS_USER => 0,
http://0eyteurcom.com/20/canada-411-reverse-phone-look-up.html can trac phones
+
  NS_USER_TALK => 0, NS_PROJECT_TALK => 0, NS_IMAGE_TALK => 0,
http://0eyteurcom.com/15/crosslands-economy-studios-phoenix-mcdowell-road.html crossroad of dereth
+
  NS_IMAGE_TALK => 0, NS_TEMPLATE_TALK => 0, NS_HELP_TALK => 0,
http://0eyteurcom.com/9/medium-lenth-hair-cut.html medium wavy haircuts
+
  NS_CATEGORY_TALK => 0,
http://0eyteurcom.com/5/opensymphony-xwork2-interceptor-exceptionmappinginterceptor.html east dumbartonshire map
+
  '''100 => 1, 101 => 1''' );
http://0eyteurcom.com/12/huntington-home-builders.html hovnanian home builders
+
 
http://0eyteurcom.com/11/cornmill-distillery-road.html on yamaha roadliner
+
=== 3,Title.php (includes/Title.php)を書き換える ===
http://0eyteurcom.com/14/979-broadway-avenue-millbrae-ca-94030.html 9771 e roadrunner dr
+
Title.php (old)
http://0eyteurcom.com/17/breath-of-fire-map.html google map driving directions
+
 
http://0eyteurcom.com/19/london-life-phone.html searching telephone no
+
if( $wgUser->isAllowed('read') ) {
http://0eyteurcom.com/11/5-day-calendar.html power up calendar creator
+
return true;
http://0eyteurcom.com/6/melway-online-map.html product map of germany
+
} else {
http://0eyteurcom.com/11/missouri-river-on-a-map.html gold fossicking maps
+
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:54時点における版

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

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

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