[Mediawiki-l] Is there a way to control edit rights for talk pages differently from content pages?

Thomas Dalton thomas.dalton at gmail.com
Wed May 7 22:08:30 UTC 2008


On 07/05/2008, Daniel Barrett <danb at vistaprint.com> wrote:
> Something like this loop should work, if you haven't defined any custom namespaces in your wiki:
>
>  global $wgCanonicalNamespaceNames;
>  foreach ($wgCanonicalNamespaceNames as $ns => $name) {
>   // If namespace ID is non-negative and even, protect it.
>   if ($ns >= 0 && $ns % 2 == 0) {
>     $wgNamespaceProtection[$ns] = array( 'sysop' );
>   }
>  }

Don't you need namespace ids, rather than namespace names? I may just
be mis-remembering what the various arrays are called...



More information about the MediaWiki-l mailing list