Is there some way to determine if the a user has logged in via MW and then if they are NOT logged in, make this addition to any page:
__NOEDITSECTION__
I have all the various settings for permissions on who can edit, can not edit, read, create accounts etc.. Most of these functions are limited to 5 persons who can actually login into MW. Only myself can create accounts, and the other 4 could edit if they chose to, but not likely.
The majority of users are readers and can only get to the site after authenticating via .htaccess, this applies to the Uber 5 too. No on gets to the wiki till you login. Then if your an Uber 5 you have to login in again to edit.
To make it easier for "web and wiki challenged" on the planet I've been asked to remove the "edit" actions that appear for sections as it confuses the "wiki challenged" users.
So my thought was that if I could determine if the user was not logged into MW some how then I could get __NOEDITSECTION__ added to the pages based on this test.
I am just not finding a solution as to:
1) Determine if a user is logged in or not logged in to MW 2) Where should this go to apply site wide? monobook.php?
My theory goes along this line, this is just theory, non working:
<?php if($_GET['loggedin']==''){ ?> __NOEDITSECTION__
<?php } ?>
I use:
MW : 1.6.10 Skin: monobook
I will be moving to 1.10 after testing, but production use will stay with 1.6.10 for awhile till I test things out on 1.10. My host only recently made PHP5 available to users, thats why I started at 1.6.10
So this needs to work for 1.6.10 as well as current versions.
If you have it set up not to allow anonymous edits, the section edit links shouldn't appear to non-logged in users at all.
Thomas Dalton wrote:
If you have it set up not to allow anonymous edits, the section edit links shouldn't appear to non-logged in users at all.
I have been told that this is true in MW 1.6.10 or older but not in newer versions. Is this correct? If so, I don't understand the logic in removing this functionality and would be interested in hearing why it was done.
Mike
I have been told that this is true in MW 1.6.10 or older but not in newer versions. Is this correct? If so, I don't understand the logic in removing this functionality and would be interested in hearing why it was done.
Before sending that email, I tested it with the latest version. I tested it on a protected page, rather than restricting access to the whole wiki, but I would expect the same behaviour regardless of the method of stopping someone editing. Who told you the functionality had been removed?
Thomas Dalton wrote:
Who told you the functionality had been removed?
A message on the MWUser forum (message 5 in the following) http://www.mwusers.com/forums/showthread.php?t=4970
I noticed that not all wikis seem to have this feature active when not logged in. I hadn't tested it and took it at face value.
Mike
After some further testing, it seems you're right - the edit links appear even if you aren't allowed to edit. I'd say that's a bug...
On 22/07/07, Thomas Dalton thomas.dalton@gmail.com wrote:
After some further testing, it seems you're right - the edit links appear even if you aren't allowed to edit. I'd say that's a bug...
PS It's Bug 1859 (http://bugzilla.wikimedia.org/show_bug.cgi?id=1859). There are a couple of patches which claim to fix it, hopefully someone with commit access will commit them and your problem will be solved.
Fast an dirty way, put at the beginning of editSectionLink and editSectionLinkForOther (at Linker.php)
global $wgUser; if (!$wgUser->isLoggedIn()) return "";
(you will also need to disable the parser cache or take into account the loggedness)
On Jul 22, 2007, at 5:36 PM, Platonides wrote:
Fast an dirty way, put at the beginning of editSectionLink and editSectionLinkForOther (at Linker.php)
global $wgUser; if (!$wgUser->isLoggedIn()) return "";
is editSectionLinfForOther something that can be overridden in skins?
I know nothing of PHP, but I see a comment in Linker.php saying that Skin is a descendent of Linker. User defined skins inherit from SkinTemplate which in turns inherit from Skin, so if PHP inheritance works as I expect it should be possible to override it.
I'm asking because of my other question on restyling buttons: here is where the [edit] link is produced.
Thanks,
Maurizio
On Jul 23, 2007, at 10:37 AM, Maurizio Vitale wrote:
On Jul 22, 2007, at 5:36 PM, Platonides wrote:
Fast an dirty way, put at the beginning of editSectionLink and editSectionLinkForOther (at Linker.php)
global $wgUser; if (!$wgUser->isLoggedIn()) return "";
is editSectionLinfForOther something that can be overridden in skins?
I know nothing of PHP, but I see a comment in Linker.php saying that Skin is a descendent of Linker. User defined skins inherit from SkinTemplate which in turns inherit from Skin, so if PHP inheritance works as I expect it should be possible to override it.
The answer seems to be no (tried, purged the cache w/ no effect). Why?
Thanks,
Maurizio
Maurizio Vitale wrote:
is editSectionLinfForOther something that can be overridden in skins?
I know nothing of PHP, but I see a comment in Linker.php saying that Skin is a descendent of Linker. User defined skins inherit from SkinTemplate which in turns inherit from Skin, so if PHP inheritance works as I expect it should be possible to override it.
The answer seems to be no (tried, purged the cache w/ no effect). Why?
Thanks,
Maurizio
Probably the bit of code which calls it, instanciate a Linker, not a skin.
mediawiki-l@lists.wikimedia.org