Sorry, Joshua Oreman, that's a case of "Ready, Fire, Aim" on my part. I agree that the patches are essentially the same in function.
Again, I haven't looked at 1.5; maybe Oreman's patch is better for that version.
-- Joshua Yeidel
On 8/30/05 12:18 PM, "Joshua Oreman" oremanj@gmail.com wrote:
On 8/30/05, Joshua Yeidel yeidel@wsu.edu wrote:
I think Joshua Oreman's approach gets the presentation correct (read-only page) but doesn't secure the page (e.g., against adding "action=edit" to a URL and hacking the page).
Setting Title::userCan('edit') to false also causes the read-only page to be displayed without patching EditPage.php.
That patch is to EditPage::edit(). See the comment at the top of that function. /**
- This is the function that gets called for "action=edit".
*/ It works fine against &action=edit.
You're going to be patching Title.php or EditPage.php whatever you do; the test I gave should work equally well in either one (with minor modifications).
Yes, that's a patch against 1.5.
-- Josh
-- Joshua
On 8/30/05 11:46 AM, "Joshua Oreman" oremanj@gmail.com wrote:
On 8/30/05, Sy sy1234@gmail.com wrote:
On 8/29/05, Joshua Yeidel yeidel@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@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l