[Mediawiki-l] Determine if user logged in and then remove edit

mediawiki at wpascanner.com mediawiki at wpascanner.com
Sun Jul 22 13:33:24 UTC 2007


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.





More information about the MediaWiki-l mailing list