[Mediawiki-l] User Permission: protected user page?

Bass, Joshua L joshua.l.bass at lmco.com
Tue Aug 30 19:06:03 UTC 2005


Is this the code for 1.5?


-----Original Message-----
From: mediawiki-l-bounces at Wikimedia.org
[mailto:mediawiki-l-bounces at Wikimedia.org] On Behalf Of Joshua Oreman
Sent: Tuesday, August 30, 2005 1:46 PM
To: MediaWiki announcements and site admin list
Subject: Re: [Mediawiki-l] User Permission: protected user page?


On 8/30/05, Sy <sy1234 at gmail.com> wrote:
> On 8/29/05, Joshua Yeidel <yeidel at wsu.edu> wrote:
> > I made a similar change in 1.4 by patching include/Title.php's 
> > "userCan()" function
> 
> I've put your hack into its own page on meta.  If you've got your own 
> user there, feel free to move it.
> 
> http://meta.wikimedia.org/wiki/User:Sysy/Joshua_Yeidel%27s_permissions
> _hack
> 
> I'm interested to know if anyone figures something out for 1.5.. I 
> feel that permissions is one of the major barriers to a certain kind 
> of use of mediawiki.

Here's my (very very hacky) way of doing it:

Edit includes/EditPage.php.
After these lines
		if ( !$wgUser->isAllowed('edit') ) {
			if ( $wgUser->isAnon() ) {
				$this->userNotLoggedInPage();
				return;
			} else {
				$wgOut->readOnlyPage(
$this->mArticle->getContent( true ), true );
				return;
			}
		}
(about line 185) add these lines:
		$this->mArticle->fetchContent();
		if ( !$wgUser->isSysop() &&
$this->mArticle->mTitle->getNamespace()
== NS_USER &&
		     $wgUser->getName() !=
$this->mArticle->mTitle->getText() )
                {
		    $wgOut->readOnlyPage ($this->mArticle->getContent
(true), true);
		    return;
		}
Hope this helps.

-- Josh


> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at Wikimedia.org 
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l at Wikimedia.org
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l



More information about the MediaWiki-l mailing list