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

Joshua Oreman oremanj at gmail.com
Tue Aug 30 18:46:17 UTC 2005


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
>



More information about the MediaWiki-l mailing list