Hi
I need to Hide a single page from Un-login users.. Can u help me regarding dis.?
Regards
---
This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful.
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: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Sreelaxmi.Alladi@cognizant.com Sent: Wednesday, January 11, 2012 1:59 AM To: MediaWiki-l@lists.wikimedia.org 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
---
This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
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.
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: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Daniel Friesen Sent: Wednesday, January 11, 2012 7:31 AM To: mediawiki-l@lists.wikimedia.org 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 salquint@gmail.com 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:MyVariablesand 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: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Sreelaxmi.Alladi@cognizant.com Sent: Wednesday, January 11, 2012 1:59 AM To: MediaWiki-l@lists.wikimedia.org 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 MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
It can work if it's just eg. show a different advice for anonymous and logged in users. But if you wanted real security, it would be much harder. Thus what Daniel said "Don't do it". But we won't stop you if you want to use it.
On 11/01/12 16:39, Sal Quintanilla wrote:
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 asuncacheable 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.
SMW does not do anything related to read or write access restrictions. You probably mean some other extension.
Markus
mediawiki-l@lists.wikimedia.org