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

提供: wikipokpok
移動先: 案内検索
(特別ページの画像リスト等にパーミッションを設定する)
(2008年12月27日 (土) 02:09; 192.168.1.2 (ノート) による版の版まで差し戻し(荒らしの為:Spam))
1行目: 1行目:
comment6
+
== 特定の権限を与えられたユーザーのみアクセスできる名前空間を作る(特定ページへのアクセス制限) ==
http://iyran33.yourfreehosting.net/bolton-evening-news-job-section.html bolton evening news job section
+
新しいグループを作り、そのグループに属するユーザーのみに閲覧編集等の権限を与える。
http://frentes28.myd.net/american-mutual-holding-company.html american national anthem in spanish
+
=== 1,新しいグループを作成する ===
http://iyran33.yourfreehosting.net/alquiler-coches-aeropuerto-sevilla.html alquiler en vilanova i la geltru
+
LocalSettings.phpに$wgGroupPermissionsを追記する。<br />
http://iyran33.yourfreehosting.net/vacations-cancun-resort-las-vegas.html las vegas vacation ideas
+
http://frentes28.myd.net/animals-before-we-were-so-rudely-interrupted.html animals doing stupid things
+
<pre>
http://iyran33.yourfreehosting.net/acadiana-high-school-lafayette-louisiana.html acalanes high school alumni
+
$wgGroupPermissions['groupname']['move']            = true;
http://frentes28.myd.net/glastonbury-music-festival-tickets.html gone with the wind musical tickets
+
$wgGroupPermissions['groupname']['read']            = true;
http://frentes28.myd.net/arts-jobs-australia.html networking jobs in australia
+
$wgGroupPermissions['groupname']['edit']            = true;
http://frentes28.myd.net/about-automated-teller-machine.html about barranquilla colombia
+
$wgGroupPermissions['groupname']['createpage']      = true;
http://iyran33.yourfreehosting.net/ideas-for-leaving-gifts.html ideas for team gifts
+
$wgGroupPermissions['groupname']['createtalk']      = true;
 +
$wgGroupPermissions['groupname']['upload']          = true;
 +
$wgGroupPermissions['groupname']['reupload']        = true;
 +
$wgGroupPermissions['groupname']['reupload-shared'] = true;
 +
$wgGroupPermissions['groupname']['minoredit']      = true;
 +
</pre>
 +
特別ページのユーザー権限の管理に反映されたgroupnameを、登録ユーザーに割り当てる。。
  
comment6
+
=== 2,新しい名前空間を作成する ===
http://malconn43.007webs.com/animated-emoticons-messenger.html animated free birthday cards
+
LocalSettings.phpに$wgExtraNamespaces,$wgNamespacesWithSubpages, and $wgNamespacesToBeSearchedDefaultを追記する。<br />
http://saqan657.freewhost.com/business-plan-financing.html advertising agency business plan
+
http://subix674.myd.net/lose-weight-without-diet-pills.html new hoodia diet pill
+
$wgExtraNamespaces =
http://saqan657.freewhost.com/grand-rapids-home-builders-association.html equity home builders
+
      array(100 => "Hilfe",         #スペースは使えない
http://lemon783.hostevo.com/glass-water-cooler-jug.html innowave water coolers
+
            101 => "Hilfe_Diskussion",
http://subix674.myd.net/allan-macnab-recreation-centre.html allan parsons project eye in
+
            102 => "Aide",
http://lemon783.hostevo.com/albanian-english-dictionary.html albanian mobile communications
+
            103 => "Discussion_Aide"
http://iraklin66.001webs.com/arlington-highlands-restaurants.html arlington hotel new york city
+
            );
http://lemon783.hostevo.com/unusual-business-ideas.html best home business ideas and opportunities
+
 
http://subix674.myd.net/layered-taco-dip-recipe.html beef taco dip recipe
+
<var>$wgNamespacesWithSubpages</var><br />
http://malconn43.007webs.com/free-crochet-books.html free jazz real book
+
MediaWiki 1.4.x and olderの例:
http://saqan657.freewhost.com/arqueologo-exclusive-selection.html arquitectura escultura y pintura
+
$wgNamespacesWithSubpages =
http://malconn43.007webs.com/alice-in-chains-would-video.html alice in wonderland biography
+
        array( -1 => 0, 0 => 0, 1 => 1, 2 => 1, 3 => 1,
http://saqan657.freewhost.com/appelation-bordeaux-controlee.html appellate division fourth department
+
              4 => 0, 5 => 1, 6 => 0, 7 => 1,
http://malconn43.007webs.com/aint-no-mountain-high-enough-artist.html aint no mountain high enough cover
+
              8 => 0, 9 => 1, 10 => 0,11 => 1,
http://malconn43.007webs.com/care-med-international-travel-insurance.html cheap long term travel insurance
+
              '''100 => 1, 101 => 1''' );
http://iraklin66.001webs.com/area-manager-responsibilities.html area network interface card
+
MediaWiki 1.5.xの例:
http://iraklin66.001webs.com/harry-potter-newest-book.html 1st harry potter book
+
$wgNamespacesWithSubpages = array(
http://malconn43.007webs.com/jobs-in-santa-clara-california.html jobs in walnut california
+
NS_TALK          => true,
http://malconn43.007webs.com/5-day-weather-forecast-nice.html 2 day weather forecast
+
  NS_USER          => true,
http://subix674.myd.net/american-baptist-east-evansville-in.html american bar association business
+
  NS_USER_TALK      => true,
http://saqan657.freewhost.com/adobe-business-card-templates.html adobe captivate alternatives
+
  NS_PROJECT_TALK  => true,
http://malconn43.007webs.com/hair-styles-with-plaits.html hairband hair styles
+
  NS_IMAGE_TALK    => true,
http://iraklin66.001webs.com/apartments-hagerstown-maryland.html apartments hendersonville tennessee
+
  NS_MEDIAWIKI_TALK => true,
http://iraklin66.001webs.com/blackened-fish-recipe.html fish fillet recipes
+
  NS_TEMPLATE_TALK  => true,
http://iraklin66.001webs.com/on-used-auto-sales.html ricks used auto parts
+
  NS_HELP_TALK      => true,
http://iraklin66.001webs.com/list-of-united-states-citizens.html alphabetical list of 50 united states
+
  NS_CATEGORY_TALK  => true,
http://subix674.myd.net/water-park-sublett.html water park usa
+
  '''100              => true,'''
http://lemon783.hostevo.com/american-standard-whirlpool-bath.html american standard whirlpool tub
+
  '''101              => true'''
http://saqan657.freewhost.com/exercise-fitness-equipment.html exercise fitness training
+
);
http://iraklin66.001webs.com/amsoft-information-services-india-pvt.html amsouth bank internet banking
+
 
http://subix674.myd.net/automatic-paintball-guns-for-sale.html ben tippmann paintball guns
+
<var>$wgNamespacesToBeSearchedDefault</var><br />
http://saqan657.freewhost.com/american-university-courses.html american university diploma
+
MediaWiki 1.4.x and olderの例:
http://malconn43.007webs.com/water-park-at-geauga-lake.html water park canandaigua ny
+
$wgNamespacesToBeSearchedDefault =
http://lemon783.hostevo.com/chicken-cordon-blue-recipes.html dinner recipes for chicken
+
        array( -1 => 0, 0 => 1, 1 => 0, 2 => 0, 3 => 0,
http://subix674.myd.net/lifepack-emergency-water-filter.html mavello water filter
+
                4 => 0, 5 => 0, 6 => 0, 7 => 0,
http://saqan657.freewhost.com/area-small-business-association.html area technical college rhinelander wi
+
                8 => 0, 9 => 1, 10 => 0, 11 => 1,
http://malconn43.007webs.com/sock-it-to-me-cake-recipe.html punch bowl cake recipe
+
                '''100 => 1, 101 => 1''' );
http://malconn43.007webs.com/vegetarian-salad-recipes.html free vegetarian recipe
+
 
http://malconn43.007webs.com/baby-names-directory.html hebrew baby boy names
+
MediaWiki 1.5.xの例:
http://saqan657.freewhost.com/house-of-representative-jobs.html housekeeping jobs in usa
+
$wgNamespacesToBeSearchedDefault = array( -1 => 0, NS_MAIN => 1, NS_USER => 0,
http://lemon783.hostevo.com/mens-hair-styles-mohawk.html mens hairstyles 2008
+
  NS_USER_TALK => 0, NS_PROJECT_TALK => 0, NS_IMAGE_TALK => 0,
http://lemon783.hostevo.com/american-mushroom-institute.html american music awards youtube
+
  NS_IMAGE_TALK => 0, NS_TEMPLATE_TALK => 0, NS_HELP_TALK => 0,
http://iraklin66.001webs.com/arthur-murray-dance-studio-md.html arthur murray dance studio mi
+
  NS_CATEGORY_TALK => 0,
http://saqan657.freewhost.com/affirmative-action-definition.html affirmative action discrimination
+
  '''100 => 1, 101 => 1''' );
http://subix674.myd.net/akademia-techniczno-humanistyczna-w-bielsku.html akademia wychowania fizycznego katowice
+
 
http://saqan657.freewhost.com/cheap-european-travel-insurance.html travel brochures europe
+
=== 3,Title.php (includes/Title.php)を書き換える ===
http://malconn43.007webs.com/apocalypse-please-sheet-music.html apocalyptic rapture teachings
+
Title.php (old)
http://subix674.myd.net/airline-reservations-at-home.html airline tickets credit card
+
 
http://subix674.myd.net/aston-martin-used-cars-for.html wood used for carving
+
if( $wgUser->isAllowed('read') ) {
http://iraklin66.001webs.com/hostess-gifts-ideas.html eco friendly gift ideas
+
return true;
http://malconn43.007webs.com/almost-skateboarding-videos.html almshouse surgery wakefield
+
} else {
http://iraklin66.001webs.com/the-cheapest-airline-tickets.html cheap airline tickets online
+
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月11日 (日) 03:26時点における版

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

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

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