Extension talk:AccessControl

Jump to navigation Jump to search

About this board

57 previous topics.

Archives 

Previous discussion was archived at Extension talk:AccessControl/Archive 1 on 2016-10-24.

Once you mistype the <accesscontrol> </accesscontrol> you cannot access the page any more

3
Janos.tapolcai (talkcontribs)

Is there a workout to undo the changes if you are not the admin and mistype the <accesscontrol> tag?

Janos.tapolcai (talkcontribs)

in fact the help here is very useful (and readable after translating to English with google) [https://www.thewoodcraft.org/wiki/index.php/AccessControl]

When you can't get to the page

Do not panic!

If you mistakenly removed your name from the list of users authorized to edit the page and you know another user who has access to edit the page, you can try to ask the user to correct your mistake and add you to the list again.

If you do not know anybody and no other user has access to the page, you must ask for help from a user who has administrator rights ('sysop').

However, this will not help if the privileged status of this user group is disabled via $ wgAdminCanReadAll , or if you have managed to block access to a page in such a way that even an administrator (a user in the 'sysop' group) cannot access it. Such a situation may occur, for example, in the case of multiple translucency.

Then you have only one option.

If you do not have access to the configuration file LocalSettings.php, you must ask whoever has access to temporarily deactivate AccessControl so that you can fix the faulty record, or to fix it for you - the easiest and quickest thing is to completely delete the page content. You can then draw it from a previous revision and it will minimize the time it takes to solve your problem.

Kghbln (talkcontribs)

A little workaround which may also make editing faster: Create a template "Accescontrol" and add the content to go with the tags via an unnamed parameter. Have not tested this but it should work. But yes, a mistyped tag should probably not result into something like this.

Reply to "Once you mistype the <accesscontrol> </accesscontrol> you cannot access the page any more"

migrated from Simple Security to AccessControl on mw 1.32 without Issue.

2
208.81.12.35 (talkcontribs)

Just commented out the require once for Simple Security, and added Access-Control


require_once("{IP}/extensions/Acess/Control/AccessControl.php");

$wgAdminCanReadAll = true;

$wgAccessControlRedirect = true;


I have the groups still in place from the SimpleSecurity extension ie;


# create user groups

$wgSecurityExtraGroups = array('TEAMSecure');

#prevent includes for pages that need extra security.

$wgNonincludableNamespaces = array('Example_page');

#Groups for secure pages

$wgGroupPermissions['all']['read'] = false;

$wgGroupPermissions['TEAMSecure']['read'] = true;

$wgGroupPermissions['TEAMSecure']['writeapi'] = true;

$wgGroupPermissions['TEAMSecure']['edit'] = true;

$wgGroupPermissions['TEAMSecure']['editinterface'] = true;

$wgGroupPermissions['TEAMSecure']['read'] = true;


So have used them accordingly;

Now on pages to be protected instead of adding [[Category:TEAMSecure]]

to secure the pae from all but the TEAMSecure group I used;

<accesscontrol>Administrators,TEAMSecure</accesscontrol>


The page is protected from view or edit, the user is redirected to a page called Deny User for authenticated users without access to that page.

and Deny anonymous for unauthenticated users.


Those pages can be edited by those users but all they change is the message they see when they try to get to the protected page since its redirected, I watch those pages for changes accordingly.

I did not keep the secure categories secition as this extension works atthe page/subpage level.


you may want to Disable some special pages to hide them or a subset of them accordingly. to prevent unauthorized users from using those tools to work around the extension.


Use the disablespecialpages extension .Extension:DisableSpecialPages

to disable all but login create user and search or look into this function that can disable any special pages including search


function disableSomeSpecialPages(&$list) {

       global $wgUser;

       #If not sysop disable other pages

       if (!in_array("sysop", $wgUser->getEffectiveGroups())) {

               unset($list['Version']);

               unset($list['Contributions']);

               unset($list['Allpages']);

               unset($list['Lonelypages']);

               unset($list['Longpages']);

               unset($list['Uncategorizedcategories']);

               unset($list['Categories']);

               unset($list['CreateCategory']);

               unset($list['CreateForm']);

               unset($list['CreateTemplate']);

               unset($list['Search']);

}

       return true;

}

$wgHooks['SpecialPage_initList'][] = 'disableSomeSpecialPages';


This is working well on mw 1.32 for me.


Airammontessori (talkcontribs)

Hi there, I've done exactly what you've done but the AccessControl is not working for me. I can't access a page with a user belonging to a group that is supposed to have access to it.

Only work with admin group of course with:

$wgAdminCanReadAll = true;

of course ...

Which version of the extension are you using? I run the latest 2.6. The author mentionned something about the 2.5.1 which is better but I don't know where to find this version and it is unclear to me what's the difference between both.


Reply to "migrated from Simple Security to AccessControl on mw 1.32 without Issue."

Trying to configure but the documentation doesnt help

2
177.215.67.42 (talkcontribs)

i`m trying to configure the access control extension but doesnt work, i created an group on my localsetting.php file but when i go to an page restricted by the group with an user that is part of the group it doesnt allow to access or edit the page. @Want

Airammontessori (talkcontribs)

Did you figure it out? I have the same problem.

Reply to "Trying to configure but the documentation doesnt help"
T0lk (talkcontribs)

I recently upgraded my wiki to 1.31.1 to see what the status of this extension would be. Surprisingly the site continues to work without any error messages, and restricted pages continue to be blocked. Search results of access restricted pages continues to work as expected as well. The only thing I could find which is broken now is an access bypass through the edit/view source tab, which reveals the page contents.

Has anyone fixed that issue, or found others? I did not test the content export feature/api.

T0lk (talkcontribs)

When combined with Extension:SourceProtection the wiki works as expected. The only added step now is making sure access restricted pages have edit protections in place.

Reply to "Status on 1.31.1"

Cannot access Special: namespace with AccessControl enabled

7
134.76.234.21 (talkcontribs)

I migrated my wiki (from 1.18 to latest 1.28). I was using the old AccessControl extension. Afer the migration (and updating the AccessControl plugin to the latest) whenever I try to access any of the Special Pages (including UserLogin and UserLogout) I get:

[e77339a315d8aef182f77e7f] /wiki/index.php?title=Special:UserLogin&returnto=Main+Page MWException from line 121 of /var/www/mediawiki-1.28.0/includes/page/WikiPage.php: Invalid or virtual namespace -1 given.

Backtrace:

  1. 0 /var/www/mediawiki-1.28.0/extensions/AccessControl/AccessControl.hooks.php(86): WikiPage::factory(Title)
  2. 1 /var/www/mediawiki-1.28.0/extensions/AccessControl/AccessControl.hooks.php(295): AccessControlHooks::getContentPage(integer, string)
  3. 2 [internal function]: AccessControlHooks::onUserCan(Title, User, string, string)
  4. 3 /var/www/mediawiki-1.28.0/includes/Hooks.php(195): call_user_func_array(string, array)
  5. 4 /var/www/mediawiki-1.28.0/includes/Title.php(2056): Hooks::run(string, array)
  6. 5 /var/www/mediawiki-1.28.0/includes/Title.php(2498): Title->checkPermissionHooks(string, User, array, string, boolean)
  7. 6 /var/www/mediawiki-1.28.0/includes/Title.php(1924): Title->getUserPermissionsErrorsInternal(string, User, string)
  8. 7 /var/www/mediawiki-1.28.0/includes/MediaWiki.php(202): Title->getUserPermissionsErrors(string, User)
  9. 8 /var/www/mediawiki-1.28.0/includes/MediaWiki.php(851): MediaWiki->performRequest()
  10. 9 /var/www/mediawiki-1.28.0/includes/MediaWiki.php(512): MediaWiki->main()
  11. 10 /var/www/mediawiki-1.28.0/index.php(43): MediaWiki->run()
  12. 11 {main}

Can you pls advice me how to properly configure the AccessControl plugin ?

132.183.13.75 (talkcontribs)

I also get this error in MW 1.29.0-wmf.3 when going to Special:Version.

109.190.122.47 (talkcontribs)

I fixed this one by editing "includes/page/WikiPage.php", in function factory. On line 120, replace : } elseif ( $ns < 0 ) {

By : } elseif ( $ns < -1 ) {

DanielJamieson (talkcontribs)

This worked for me. Thanks

213.164.76.76 (talkcontribs)

Hello,

Same Problem here, please fix it in the code, because at every update the changes ar lost!

Kind regards...

109.233.225.254 (talkcontribs)

Another dirty fix: In file "extensions/AccessControl/AccessControl.hooks.php": Add(not replace, just add) to line 83 this code:

if ($namespace == -1) $namespace = 0;

It works for me and will not overwritten after wiki core update.

Johnywhy (talkcontribs)

might be helpful to include the whole line.

so, from this

if ( $gt->isSpecialPage() ) {

to this?

if ( $gt->isSpecialPage() ) {if ($namespace == -1) $namespace = 0; 
Reply to "Cannot access Special: namespace with AccessControl enabled"

AccessControl and MediaWiki 1.31

1
ShInKurO (talkcontribs)

Hello,

I've installed this extension (latest version REL1_31), I've created a custom namespace into my LocalSetting.php and other steps which are described in the AccessControl wiki page, but if I try to log in into my wiki I've these errors:

[6799ad66fae2450d6b57bd1b] /php5/index.php?title=Speciale:Entra&returnto=Pagina+principale MWException from line 121 of /MY_WIKI/php5/includes/page/WikiPage.php: Invalid or virtual namespace -1 given.

Backtrace:

#0 /MY_WIKI/php5/extensions/AccessControl/AccessControl.hooks.php(86): WikiPage::factory(Title)

#1 /MY_WIKI/php5/extensions/AccessControl/AccessControl.hooks.php(294): AccessControlHooks::getContentPage(integer, string)

#2 /MY_WIKI/php5/includes/Hooks.php(177): AccessControlHooks::onUserCan(Title, User, string, string)

#3 /MY_WIKI/php5/includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)

#4 /MY_WIKI/php5/includes/Title.php(2269): Hooks::run(string, array)

#5 /MY_WIKI/php5/includes/Title.php(2737): Title->checkPermissionHooks(string, User, array, string, boolean)

#6 /MY_WIKI/php5/includes/Title.php(2135): Title->getUserPermissionsErrorsInternal(string, User, string)

#7 /MY_WIKI/php5/includes/MediaWiki.php(207): Title->getUserPermissionsErrors(string, User)

#8 /MY_WIKI/php5/includes/MediaWiki.php(861): MediaWiki->performRequest()

#9 /MY_WIKI/php5/includes/MediaWiki.php(524): MediaWiki->main()

#10 /MY_WIKI/php5/index.php(42): MediaWiki->run()

#11 {main}

Reply to "AccessControl and MediaWiki 1.31"

AccessControl Extension HTTP 500 Error with Mediawiki 1.30

1
106.57.72.254 (talkcontribs)

I installed the extension and added following lines to localsettings.php,

require_once("$IP/extensions/Accesscontrol/accesscontrol.php");

$wgAdminCanReadAll = true;

$wgAccessControlRedirect = false;

But when I tried to visit http://IPaddress/mediawiki/index.php, I got a HTTP 500 error. I searched apache error log and PHP error log, nothing found.

If I comment the line require_once..., everything works fine.

My environment is wamp (PHP 5.6.35, Apache 2.4.33, Mariadb 10.2.14) on Windows Server 2012 R2

Is this extension compatible with Apache 2.4.33? I notice some syntax has changed from Apache 2.2 to 2.4, such as "Deny from all" is changed to "Require all denied"

Reply to "AccessControl Extension HTTP 500 Error with Mediawiki 1.30"
Johnywhy (talkcontribs)
Reply to "Patch needed?"

Crashed 1.30 Special:SpecialPages

3
Johnywhy (talkcontribs)
[WstJ-uaufRsHLEzsvm4oNQAAABQ] /index.php/Special:SpecialPages MWException from line 127 of /home/gunsywtx/public_html/includes/page/WikiPage.php: Invalid or virtual namespace -1 given.

Backtrace:

#0 /home/gunsywtx/public_html/extensions/AccessControl/AccessControl.hooks.php(86): WikiPage::factory(Title)
#1 /home/gunsywtx/public_html/extensions/AccessControl/AccessControl.hooks.php(294): AccessControlHooks::getContentPage(integer, string)
#2 /home/gunsywtx/public_html/includes/Hooks.php(177): AccessControlHooks::onUserCan(Title, User, string, string)
#3 /home/gunsywtx/public_html/includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)
#4 /home/gunsywtx/public_html/includes/Title.php(2194): Hooks::run(string, array)
#5 /home/gunsywtx/public_html/includes/Title.php(2636): Title->checkPermissionHooks(string, User, array, string, boolean)
#6 /home/gunsywtx/public_html/includes/Title.php(2060): Title->getUserPermissionsErrorsInternal(string, User, string)
#7 /home/gunsywtx/public_html/includes/MediaWiki.php(206): Title->getUserPermissionsErrors(string, User)
#8 /home/gunsywtx/public_html/includes/MediaWiki.php(851): MediaWiki->performRequest()
#9 /home/gunsywtx/public_html/includes/MediaWiki.php(523): MediaWiki->main()
#10 /home/gunsywtx/public_html/index.php(43): MediaWiki->run()
#11 {main}
109.233.225.254 (talkcontribs)

Another dirty fix: In file "extensions/AccessControl/AccessControl.hooks.php": Add(not replace, just add) to line 83 this code:

if ($namespace == -1) $namespace = 0;

It works for me and will not overwritten after wiki core update.

Johnywhy (talkcontribs)

thx

Reply to "Crashed 1.30 Special:SpecialPages"
Revel IT (talkcontribs)

I've recently installed Access Control (v. 2.6) on a fairly new MediaWiki (v. 1.30) server. I've tried creating a user list in a custom namespace and in the main namespace, but neither of them seem to work. I even tried using a modded AccessControl.php listed on the Extension page. Any help is appreciated.

Reply to "Adding User Groups"