Extension talk:HNP

From MediaWiki.org
Jump to navigation Jump to search

Problem[edit]

Recently I setup mediawiki 1.13.2 in our company and want to use HNP to control the permissions of namespaces. However I meet a problem with HNP and I don’t know how to solve this problem. Could anybody please kindly give me some suggestion? Thanks!

I have installed StubManager V1.3.0, HNP V1.1.2 and ExtensionManager V2.0.1. I add 2 extra namespaces “IDTV_SW_EXT”, “IDTV_SW_INT” and their talk namespaces. I also add 2 extra groups “idtv_sw” and “idtv_eng”. “idtv_sw” is designed to access both namespaces. “idtv_eng” is designed to not access “IDTV_SW_INT”. But after I setup the group permission in MediaWiki:Registry/HNP. All users in “idtv_sw” and “idtv_eng” can’t access “IDTV_SW_EXT” and “IDTV_SW_INT”. The error message says

“The action you have requested is limited to users in one of the groups *, Users, idtv_sw, idtv_eng.” But the user is in “idtv_sw” or “idtv_eng”.

The following lines are already added in MediaWiki:Registry/HNP.

   {{#hnp: idtv_sw | IDTV_SW_EXT    | ~ |   read,edit,browse,search,minoredit,create,delete,move,nominornewtalk,createpage,createtalk,rollback,

protect,patrol,patrolmarks,purge,upload,reupload,reupload-own,reupload-shared,upload_by_url}}

   {{#hnp: idtv_eng | IDTV_SW_EXT | ~ | read,edit,browse,search,minoredit,create,delete,move,nominornewtalk,createpage,createtalk,rollback,

protect,patrol,patrolmarks,purge,upload,reupload,reupload-own,reupload-shared,upload_by_url}}

In my LocalSettings.php, I also add

   require_once( "extensions/StubManager/StubManager.php" );
   require_once( "$IP/extensions/HNP/HNP.php" );

Does anybody can help me? Thanks a lotJulesshen 01:50, 25 November 2008 (UTC)


Presentation[edit]

Sorry, but this extension gets 0/10 for user-friendliness, I'm afraid. Firstly, as there was next to no explanation of how it works, I stared at the template for long enough to think that I understood what I needed to do, but an example would be helpful. Having then decided that it was worth trying (as a replacement for NamespacePermissions), I found that I had to download the individual files from SVN, rather than just retrieve a tar.gz from ExtensionDistributor. Attention to these two areas would be much appreciated! ;-)

On a less critical note, "Namespace [In]dependant" should be "Namespace-[in]dependent" - -ant is the noun and -ent the adjective.

/Sam

Problems[edit]

  • 192.165.213.18 10:07, 27 August 2008 (UTC) Maybe I'm being thick, but it looks as if the section below has been shuffled. I presume that "Nope. Then again, to reap the full benefits of this extension, patches must be applied to the codebase anyways... and that's something I haven't done, nor do I have plans for this. Jean-Lou Dupont 15:24, 7 May 2008 (UTC)'" applies to Filburt's question re 1.12.0 and that Robert's contribution is offered as evidence. However, even so,I'm confused - what patches "must be applied to the codebase"? It looks as if you're saying that the extension won't work unless you apply the patches, but you're not saying what they are...?

/Sam


Hi, that's me once more,

I wanted to ask, if you have any expierences with the HNP extension under Mediawiki 1.12 yet? I tried it and it seems that the extension is ignored by MediaWiki 1.12. Am I right?

Thanks + Greetings, Filburt

I installed the HNP under MediaWiki 1.12, but could not protect a namespace from being read by anonymous users. After some tries I found the following patch in another Extension, and now everything seems to work fine for me. Regards, Robert.
function userCanRead(...) in include/Title.php:
...
// PATCH begin {{
//# Shortcut for public wikis, allows skipping quite a bit of code path
//if ($wgGroupPermissions['*']['read'])
//  return true;
// PATCH end }}
...

Nope. Then again, to reap the full benefits of this extension, patches must be applied to the codebase anyways... and that's something I haven't done, nor do I have plans for this. Jean-Lou Dupont 15:24, 7 May 2008 (UTC)


Hi again,

I went on trying various things. I think I got it. If you only define

  {{#hnp: * | Main          | Laender | read, edit }}

instead of

  {{#hnp: * | Main          | ~ | !read, !edit }}
  {{#hnp: * | Main          | Laender | read, edit }}

than everything works proper. The first line is not necessary and does not work in this case.

Greetings, Filburt


Hi again,

I only wanted to show what is working and what is not working. It is possible to make all Main-Pages visible and than to hide one of them, but not to hide all pages and then make one of them visible. The following still hides every page in Main, including 'Laender'. I already tried various things but without any success :-(


  {{#hnp: * | Main          | ~ | !read, !edit }}
  {{#hnp: * | Main          | Laender | read, edit }}


Thank you! Filburt


Thank you for your answer. I changed the LocalSettings.php as you mentioned. Unfortunately it hasn’t solved the problem yet. It works in this way:

  {{#hnp: * | Main          | ~ | read, edit }}
  {{#hnp: * | Main          | Laender | !read, !edit }}
  {{#hnp: * | Main          | Projekte | !read, !edit }}

But it doesn’t help because new added pages should be invisible for anonymous.

{{#hnp: * | Main | ~ | read, edit }} does not hide new pages for anons: you need to put !read at least for blocking the read right. Jean-Lou Dupont 09:38, 21 April 2008 (UTC)

The problem with the error message in Language.php seems to be only with anonymous and user, but not with sysop rights – if I logged in there is no message.

Thanks ones more! Filburt


Hi,

I use your BizzWiki extension since month and it works proper – thank you ones more for this extension.

Now I updated to the newer version, that I can define the userrights on a MediaWiki-page. There were no bigger problems with the update but two problems I haven’t been able to solve yet:


1. In the old BizzwikiSettings.php I defined that all pages in NS_Main are invisible for anonymous except some pages I named. Now I tried to define the same rights in Mediawiki:Registry/HNP in this way:

  {{#hnp: * | Main | ~ | !read, !edit, !browse, !raw }}
  {{#hnp: * | Main | mainpage | read, !edit, !browse, !raw }}
  {{#hnp: * | Main | Projekte | read, !edit, !browse, !raw }}

Unfortunately it does not work. Anonymous are not allowed to read the named pages.

Sometimes, the main namespace is not configured with a "canonical name". In this case, add:
$wgCanonicalNamespaceNames[NS_MAIN] = "Main";

in LocalSettings.php. Jean-Lou Dupont 23:53, 20 April 2008 (UTC)

2. Since I’ve updated sometimes I get the following error-message:

  Warning: array_slice() [function.array-slice]: The first argument should be an array in C:\xampp\htdocs\lektoren\languages\Language.php on line 1153

There seems to be no problems except the message, but do you have any idea from where does it come from? I already updated the language.php – with no success.

I am not sure where this comes from. I would need more info to trouble shoot. Jean-Lou Dupont 23:53, 20 April 2008 (UTC)


Thanks a lot for your help + greetings

Filburt




I installed HNP with the page MediaWiki:Registry/HNP of your proposal, but I can't see any success. All the pages are viewable and it's not possible to hide Recent changes out of "Special pages".

Which extensions of your hand I have to install? ViewsourceRight, RegistryManager, GroupManager? Is it necessary to install BizzWiki?

A lot of questions and no solution?

Thank's. --A.Burgermeister 15:02, 16 November 2007 (UTC)

For limiting 'browsing' capability of a namespace (e.g. list in Special:Recentchanges), you must install Extension:BizzWiki.
Jean-Lou Dupont 16:03, 16 November 2007 (UTC)
I installed BizzWiki, but still as a anonymous user I can see Recentchanges. What shall I do? --A.Burgermeister 17:55, 16 November 2007 (UTC)
In German the Special pages are named Spezial. --A.Burgermeister 18:21, 16 November 2007 (UTC)
You must configure your HNP registry: the 'browse' right is per-namespace in scope. So, if you want to stop '*' from browsing the 'NS_TEMPLATE' (example), then {{#hnp: * | NS_TEMPLATE | ~ | !browse }}.
Jean-Lou Dupont 18:41, 16 November 2007 (UTC)
from your example: {{#hnp: * | Special | Log/~ | !browse, !read, !raw, !viewsource, !search }} and my idea of this line: no browsing, no reading, and so on. But the anonymous user can see all Specialpages! --A.Burgermeister 21:24, 16 November 2007 (UTC)
Of course, you set the page prefix to Log/~ thereby restricting access to the page descendants of Log. If you want to bar any * user from seeing any page in the NS_SPECIAL namespace, then do {{#hnp: * | NS_SPECIAL| ~ | !browse, !read, !viewsource, !raw, !edit, !search }}.Jean-Lou Dupont 21:34, 16 November 2007 (UTC)

Adding users to a group[edit]

Maybe it is a simple question - however: How do I need to connect new users I added in MediaWiki with a new added usergroup in the hierarchy in the HNP-Editor?

Example:

Hierarchy: {{#hnp_h: sysop, user, elearner , * }}

--> How do I add Mr. Anybody to the elearner-group

Thank's a lot!!!

DKU, 9.11.2007

To add users to a particular group, you use a sysop account to access the page Special:Userrights. Jean-Lou Dupont 12:17, 9 November 2007 (UTC)


Yeah, that's clear. But the problem is that the groups are shown in Special:userrights are not the same ones like in the HNP-hierarchy-definition. On Special:userrights are still the standard usergroups Sysop, Beaurocrat and Bots...

I guess I forgot a definition somewhere? Thanks for your fast answer!

DKU, 9.11.2007

Use Extension:GroupManager
Jean-Lou Dupont 15:42, 9 November 2007 (UTC)


Hm, I installed GroupManager-Extension and defined in MediaWiki:Registry/Groups:

 {| border = 1
 {{#wggroup: sysop|Administrator}}
 {{#wggroup: user|Normale Nutzer }}
 {{#wggroup: elearner|E-Learning/IT-Verantwortliche }}
 {{#wggroup: *|Anonyme Nutzer }}
 {|

But unfortunately no changes in Special:userrights :-(

(Could it be a problem with the German MediaWiki-Version I use?)

DKU, 10.11.2007

I must admit I do not use Extension:GroupManager on a regular basis; based on your query, I have found some limitations with this extension... I must attend to those limitations at some point. Sorry for the inconveniences. Jean-Lou Dupont 12:19, 10 November 2007 (UTC)

I've managed to get HNP up and running on my 1.11 MW install. I've worked my way through a number of issues and have most everything working, but I am unable to move pages with any accounts. Sysop, normal, etc; they all give the same error

"You do not have permission to move pages on this wiki."

And I see this at the top of the page: HNP: action "move" namespace dependent but called from NS_SPECIAL.

I've assigned the "move" permission to everyone on the main namespace and the custom namespaces I've created, but it doesn't appear to be working. The error message isn't the normal HNP denied message though, which makes me think I'm hitting some sort of internal mediawiki block. I was able to move pages before I set up HNP, so something must be different.

Any ideas?

I must admit I don't move pages oftern. Try putting the 'move' right in the namespace independant list. Let me know. Jean-Lou Dupont 20:05, 12 October 2007 (UTC)

Putting "move" in the independant list allows me to move pages with sysop accounts, but not with normal users. Is there a way to give an independant permission to other groups? UPDATE: just found that I had to do the same with "upload"

I've also had to make a few other changes to fix a few errors:

  • Added patrolmarks to dependant list to stop an error from appearing on the recentchanges page
  • caching the permissions page didn't seem to work for me, so I commented out the caching code and am just having the extension parse the registry page
  • commented out line 191 in hnp.body.php to prevent continuous debug spam from appearing on special pages
I have found some corner case issues. I will be fixing them shortly. Thanks for your patience. Jean-Lou Dupont 21:04, 13 October 2007 (UTC)
New version (1.0.1) available through PEAR or SVN. Jean-Lou Dupont 21:25, 13 October 2007 (UTC)

Still having some problems with moving and uploading, trying either action with an account that supposedly has permission for it gives a "HNP: action upload namespace dependent but called from NS_SPECIAL" behind a permission error screen. Moving them to the independant list causes the PHP error to go away, but I still get a permission error page with non-sysop accounts.

Could you show me the configuration you are using? i.e. your MediaWiki:Registry/HNP.Jean-Lou Dupont 18:45, 15 October 2007 (UTC)

Here it is:

== Group Hierarchy Definition ==
Hierarchy: {{#hnp_h: sysop, NSGROUP1, NSGROUP2, user, * }}

== Namespace Independant Rights ==
{| border = 1
! Right !! Type !! Notes
|-
{{#hnp_r:createaccount | I }}
{{#hnp_r:ipblock-exempt | I }}
{{#hnp_r:hideuser | I }}
{{#hnp_r:userrights | I }}
{{#hnp_r:siteadmin | I }}
{{#hnp_r:import | I }}
{{#hnp_r:importupload | I }}
{{#hnp_r:deletedhistory | I }}
{{#hnp_r:deleterevision | I }}
{{#hnp_r:hiderevision | I }}
{{#hnp_r:block | I }}
{{#hnp_r:oversight | I }}
{{#hnp_r:bot | I }}
{{#hnp_r:proxyunbannable | I }}
{{#hnp_r:trackback | I }}
{{#hnp_r:unwatchedpages | I }}
{{#hnp_r:skipcaptcha | I | ReCAPTCHA specific}} 
{{#hnp_r:makesysop | I | MakeSysop extension specific }} 
{{#hnp_r:desysop | I | DeSysop extension specific}}
|}

== Namespace Dependant Rights ==
{| border = 1
! Right !! Type !! Notes
|-
{{#hnp_r: read | D }}
{{#hnp_r: edit | D }}
{{#hnp_r: browse | D }}
{{#hnp_r: search | D }}
{{#hnp_r: minoredit | D }}
{{#hnp_r: create | D }}
{{#hnp_r: delete | D }}
{{#hnp_r: nominornewtalk | D }}
{{#hnp_r: createpage | D }}
{{#hnp_r: createtalk | D }}
{{#hnp_r: rollback | D }}
{{#hnp_r: protect | D }}
{{#hnp_r: patrol | D }}
{{#hnp_r: autopatrol | D }}
{{#hnp_r: purge | D }}
{{#hnp_r: move | D }}
{{#hnp_r: upload | D }}
{{#hnp_r: reupload | D }}
{{#hnp_r: reupload-own | D }}  <!-- MW 1.11 -->
{{#hnp_r: reupload-shared | D }}
{{#hnp_r: upload_by_url | D }}
{{#hnp_r: patrolmarks | D }}
|}

== Group Rights ==
{| border = 1
! Group !! Namespace !! Title !! Right !! Notes
|-
{{#hnp: sysop   | ~ | ~ | ~    }}
{{#hnp: sysop   | ~ | ~ | !bot }}

{{#hnp: steward | ~ | ~ | makesysop }}
{{#hnp: steward | ~ | ~ | userrights }}

{{#hnp: bureaucrat | ~ | ~ | makesysop }}
{{#hnp: bureaucrat | ~ | ~ | desysop }}

{{#hnp: * | ~             | ~ | createaccount                }}

{{#hnp: user | Main          | ~ | read, browse, raw, viewsource }}
{{#hnp: user | Talk          | ~ | read, browse, raw, viewsource }}
{{#hnp: user | Special       | ~ | read, browse, raw, viewsource }}
{{#hnp: user | Project       | ~ | read, browse, raw, viewsource }}
{{#hnp: user | Project_talk  | ~ | read, browse, raw, viewsource }}
{{#hnp: user | Category      | ~ | read, browse, raw, viewsource }}
{{#hnp: user | Category_talk | ~ | read, browse, raw, viewsource }}
{{#hnp: user | Help          | ~ | read, browse, raw, viewsource }}
{{#hnp: user | Help_talk     | ~ | read, browse, raw, viewsource }}

{{#hnp: user | NS1          | ~ | read, edit, move, upload, create, createpage, createtalk, delete, search, minoredit, rollback, reupload, reupload-own, reupload-shared, browse, raw, viewsource }}
{{#hnp: NSGROUP1 | NS1          | ~ | !read, !edit, !createpage, !createtalk, !delete, !search, !minoredit, !rollback, !upload, !reupload, !reupload-own, !reupload-shared, !browse, !raw, !viewsource }}
{{#hnp: NSGROUP2 | NS1          | ~ | read, !edit, !createpage, !createtalk, !delete, search, !minoredit, !rollback, !reupload, !reupload-own, !reupload-shared, !browse, !raw, !viewsource }}
{{#hnp: user | NS1_TALK          | ~ | read, edit, create, move, upload, createpage, createtalk, delete, search, minoredit, rollback, upload, reupload, reupload-own, reupload-shared, browse, raw, viewsource }}
{{#hnp: NSGROUP1 | NS1_TALK          | ~ | !read, !edit, !createpage, !createtalk, !delete, !search, !minoredit, !rollback, !reupload, !reupload-own, !reupload-shared, !browse, !raw, !viewsource }}
{{#hnp: NSGROUP2 | NS1_TALK          | ~ | !read, !edit, !createpage, !createtalk, !delete, search, !minoredit, !rollback, !reupload, !reupload-own, !reupload-shared, !browse, !raw, !viewsource }}

{{#hnp: user | NS2          | ~ | read, edit, create, move, upload, createpage, createtalk, delete, search, minoredit, rollback, reupload, reupload-own, reupload-shared, browse, raw, viewsource }}
{{#hnp: NSGROUP2 | NS2          | ~ | !read, !edit, !createpage, !createtalk, !delete, !search, !minoredit, !rollback, !reupload, !reupload-own, !reupload-shared, !browse, !raw, !viewsource }}
{{#hnp: NSGROUP1 | NS2          | ~ | read, !edit, !createpage, !createtalk, !delete, search, !minoredit, !rollback, !reupload, !reupload-own, !reupload-shared, !browse, !raw, !viewsource }}
{{#hnp: user | NS2_TALK          | ~ | read, edit, create, move, upload, createpage, createtalk, delete, search, minoredit, rollback, reupload, reupload-own, reupload-shared, browse, raw, viewsource }}
{{#hnp: NSGROUP2 | NS2_TALK          | ~ | !read, !edit, !createpage, !createtalk, !delete, !search, !minoredit, !rollback, !reupload, !reupload-own, !reupload-shared, !browse, !raw, !viewsource }}
{{#hnp: NSGROUP2 | NS2_TALK          | ~ | !read, !edit, !createpage, !createtalk, !delete, search, !minoredit, !rollback, !reupload, !reupload-own, !reupload-shared, !browse, !raw, !viewsource }}

{{#hnp: user | Core          | ~ | read, edit, create, move, upload, createpage, createtalk, delete, search, minoredit, rollback, reupload, reupload-own, reupload-shared, browse, raw, viewsource }}
{{#hnp: NSGROUP1 | Core          | ~ | !read, !edit, !createpage, !createtalk, !delete, !search, !minoredit, !rollback, !reupload, !reupload-own, !reupload-shared, !browse, !raw, !viewsource }}
{{#hnp: NSGROUP2 | Core       | ~ | !read, !edit, !createpage, !createtalk, !delete, search, !minoredit, !rollback, !reupload, !reupload-own, !reupload-shared, !browse, !raw, !viewsource }}
{{#hnp: user | Core_Talk          | ~ | read, edit, create, move, upload, createpage, createtalk, delete, search, minoredit, rollback, reupload, reupload-own, reupload-shared, browse, raw, viewsource }}
{{#hnp: NSGROUP1 | Core_Talk          | ~ | !read, !edit, !createpage, !createtalk, !delete, !search, !minoredit, !rollback, !reupload, !reupload-own, !reupload-shared, !browse, !raw, !viewsource }}
{{#hnp: NSGROUP2 | Core_Talk       | ~ | !read, !edit, !createpage, !createtalk, !delete, search, !minoredit, !rollback, !reupload, !reupload-own, !reupload-shared, !browse, !raw, !viewsource }}

{{#hnp: * | MediaWiki     | Common.css   | read }} 
{{#hnp: * | MediaWiki     | Common.css   | raw  }} 
{{#hnp: * | MediaWiki     | Monobook.css | read }} 
{{#hnp: * | MediaWiki     | Monobook.css | raw  }} 

{{#hnp: * | Filesystem    | LocalSettings.php | !read, !raw, !viewsource }} 
{{#hnp: * | Filesystem    | AdminSettings.php | !read, !raw, !viewsource }} 

<!-- user related -->
<!-- users get more rights -->
{{#hnp: user | Talk          | ~ | edit, create, createpage }} 
{{#hnp: user | Project_talk  | ~ | edit, create, createpage }} 
{{#hnp: user | Category_talk | ~ | edit, create, createpage }} 
{{#hnp: user | Help_talk     | ~ | edit, create, createpage }} 
{{#hnp: user | Image_talk    | ~ | edit, create, createpage }} 
{{#hnp: user | User_talk     | ~ | edit, create, createpage }} 

{{#hnp: user | Template      | ~ | read, browse, search, watch, unwatch }} 
{{#hnp: user | Template_talk | ~ | read, browse, search, watch, unwatch }}
{{#hnp: user | Image         | ~ | read, browse, search, watch, unwatch }} 
{{#hnp: user | Image_talk    | ~ | read, browse, search, watch, unwatch }} 
{{#hnp: user | User          | ~ | read, browse, search, watch, unwatch }} 
{{#hnp: user | User_talk     | ~ | read, browse, search, watch, unwatch }} 

|}

<!-- __NO_FCKEDITOR__ -->
I am not sure that MediaWiki supports mixed case group names. Try with only lower case names. Jean-Lou Dupont 07:06, 16 October 2007 (UTC)

Switched everything to lowercase, still getting the same behavior. I've just commented out the auth code for upload/move for now.

Aren't you using BizzWiki? Maybe I wrongfully assumed you were also using Extension:BizzWiki. You need this extension in order to properly manage those rights. There are patches for Special:Movepage. I should have thought about asking this question early; my sincere apologies. Jean-Lou Dupont 18:46, 23 October 2007 (UTC)
For uploads, I found that you have to give the groups you want to allow uploading additional rights for the Image namespace -- in particular 'edit' and 'create'. The wiki checks if the uploading user has that rights before it even uploads anything. If you do not have that rights, the 'protected page' error is displayed. Note, that you will probably also want to give the 'delete' right in order to allow users do delete images/files they have uploaded. -- Regards, Robert

Insert non-formatted text here

What in the world?[edit]

Warning: Parameter 1 to Language::getMagic() expected to be a reference, value given in ***\w\includes\StubObject.php on line 58

Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting T_NS_SEPARATOR in ***\w\extensions\HNP\HNP.body.php on line 423 What in the world is going on? I have Mediawiki 1.15.1 and have StubManager installed. The ONLY other one installed, I can't get others till I get this one working. Rgoodermote 23:41, 20 August 2009 (UTC)

Answer for HNP.body.php on line 423: Change "Namespace::" to "MWNamespace::". The error disappears. salindley 9 March 2010