01.12.2012 Views

7 Components: the Function Pages - Developers

7 Components: the Function Pages - Developers

7 Components: the Function Pages - Developers

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

$wgExtraNamespaces =<br />

array(100 => "Flying Sparks",<br />

101 => "Flying Sparks_Discussion" );<br />

You must now determine <strong>the</strong> behavior of <strong>the</strong> areas by setting two<br />

more variables. In <strong>the</strong> file includes/DefaultSettings.php you will find<br />

<strong>the</strong> entries to <strong>the</strong> variables $wgNamespacesWithSubpages and<br />

$wgNamespacesToBeSearchedDefault. Copy both to LocalSettings.php<br />

and expand <strong>the</strong> list with <strong>the</strong> numbers of <strong>the</strong> new<br />

namespaces. The first variable determines that new pages may be<br />

generated in <strong>the</strong> namespace, while <strong>the</strong> second determines whe<strong>the</strong>r<br />

<strong>the</strong> area is to be automatically included in searches:<br />

$wgNamespacesWithSubpages = array(<br />

-1 => 0,<br />

0 => 0,<br />

...<br />

100 => 1,<br />

101 => 1 );<br />

$wgNamespacesToBeSearchedDefault = array(<br />

-1 => 0,<br />

0 => 1,<br />

...<br />

100 => 1,<br />

101 => 1 );<br />

Using this procedure, you can add up to 156 of your own namespaces<br />

in your wiki.<br />

The file LocalSettings.php also contains information regarding<br />

who may view and modify <strong>the</strong> pages of <strong>the</strong> wiki. Granting permissions<br />

in MediaWiki is done according to <strong>the</strong> whitelist principle. This<br />

means that all pages that cannot be freely accessed are put on a list<br />

(<strong>the</strong> whitelist) and cannot be viewed or edited. If <strong>the</strong>re is no whitelist,<br />

<strong>the</strong>re are no limits. There is also a list for user accounts. Individuals<br />

on that list have <strong>the</strong> right to establish new user accounts. In<br />

<strong>the</strong> default setting, which is not specifically listed, every user,<br />

whe<strong>the</strong>r logged in or not, may perform any task. The necessary parameters<br />

are set as follows:<br />

$wgWhitelistEdit = false;<br />

$wgWhitelistRead = false;<br />

$wgWhitelistAccount = array ( "user" => 1,<br />

"sysop" => 1, "developer" => 1 );<br />

Limiting page<br />

access<br />

8.1 File structure and LocalSettings.php �<br />

�<br />

�<br />

121

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!