I agree with some of your points. If it's an intranet site this may be
just fine. If not, he has the if-test and he can use it however he wants.
No need to leave out the cache answer:
+ $parser->disableCache(); # Mark this content as
uncacheable
if ($wgUser->isLoggedIn())
I do disagree with this though, "MediaWiki is not built for partial-read
restriction, don't do it." SMW lets us conditionally hide, transpose, and
re-arrange content easily using templates and restrict access to groups, and
those certainly amount to partial-read restrictions. Perhaps you meant
something more along the lines of it shouldn't be used as a per-user
per-page conditional access system.
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Daniel Friesen
Sent: Wednesday, January 11, 2012 7:31 AM
To: [email protected]
Subject: Re: [Mediawiki-l] I need to Hide a single page from Un-login users
Quite frankly this is some pretty bad advice.
Firstly don't forget the parser cache. The parser cache will mean that the
page output will be cached in either logged-in or logged-out form and people
that are supposed to see the other form will see the wrong one.
Additionally it's a ridiculous suggestion, you're not even hiding the page
you're just wrapping the content with some css and making it look like the
content isn't there when the whole page is there and the whole content is
there to see.
MediaWiki is not built for partial-read restriction, don't do it.
--
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]
On Wed, 11 Jan 2012 07:14:18 -0800, Sal Quintanilla <[email protected]>
wrote:
> The answer is "it depends", but maybe this will work for you.
>
> Add the extension MyVariables to your installation
>
> http://www.mediawiki.org/wiki/Extension:MyVariables
>
> and then modify it to add a new variable like LOGGEDIN:
>
> Near the top:
> $wgCustomerVariables = array(..., 'LOGGEDIN', ...)
>
> In function wfGetCustomVariable(), add
> case MAG_LOGGEDIN:
> if ($wgUser->isLoggedIn())
> $ret = 'Y';
> else
> $ret = 'N';
> break;
>
> On your Mediawiki page, surround the content with something like
>
> {{#ifeq: {{LOGGEDIN}} | N | <div style="display:none">}} ... content
> ...
> {{#ifeq: {{LOGGEDIN}} | N | </div>}}
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of
> [email protected]
> Sent: Wednesday, January 11, 2012 1:59 AM
> To: [email protected]
> Subject: [Mediawiki-l] I need to Hide a single page from Un-login
> users
>
> Hi
>
>
> I need to Hide a single page from Un-login users.. Can u help me
> regarding dis.?
>
>
> Regards
_______________________________________________
MediaWiki-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
_______________________________________________
MediaWiki-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l