Extension talk:AccessControl/2018

57 previous topics.

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

Extension sees my tag on page but doesn't process.

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


When I edit the code of a page and put <accesscontrol>Editor:whois</accesscontrol>, anyone but administrators cannot access that page. I also tried several variations of this with no luck.

When I look at the code (around line 112), the following line returns a blank string, but it clearly should be returning the text inside the accesscontrol tag.

$allowedUsers = ContentHandler::getContentText( $groupPage -> getContent());

I'm using extension Access Control version REL 1_30, but I also went back to V2.6. It had a slightly different function call that calls a function no longer used, so that didn't work.

I'm using the latest MW core which is 1.30.

At first I thought my settings were wrong, but after fiddling with permissions for hours, I started debugging the code.

In the page: ".com/index.php/Editor:Whois" I put:

*awuff

*jmich

In the User List I have:

awuff ‎ (STAFF, Staff, Editor)

jmich (Staff,Editor)

In LocalSettings.php I have:

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

$wgGroupPermissions['Editor']['createpage'] = true;

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

require_once "extensions/AccessControl/AccessControl.php";

$wgAdminCanReadAll = true;                      // sysop users can read all restricted pages

$wgAccessControlRedirect = false;       // don't redirect from page with search results for denied and

                                                                        // anonymous users, if searching pattern is validate on any                                                               

// Define constants for my additional namespaces.

define("NS_STAFF", 3000); // This MUST be even.

#define("NS_STAFF_TALK", 3001); // This MUST be the following odd integer.

define("NS_EDITOR", 3002);

// Add namespaces.

$wgExtraNamespaces[NS_STAFF] = "Staff";

#$wgExtraNamespaces[NS_STAFF_TALK] = "Staff_talk";

$wgExtraNamespaces[NS_EDITOR] = "Editor";

Going back to the code, line 111 "$groupPage = WikiPage::factory( $gt );"

returns:

object(WikiPage)#156 (12) { ["mTitle"]=> object(Title)#154 (32) { ["mTextform"]=> string(12) "Editor:whois" ["mUrlform"]=> string(12) "Editor:whois" ["mDbkeyform"]=> string(12) "Editor:whois" ["mUserCaseDBKey":protected]=> NULL ["mNamespace"]=> int(0) ["mInterwiki"]=> string(0) "" ["mLocalInterwiki":"Title":private]=> bool(false) ["mFragment"]=> string(0) "" ["mArticleID"]=> int(-1) ["mLatestID":protected]=> bool(false) ["mContentModel":"Title":private]=> bool(false) ["mForcedContentModel":"Title":private]=> bool(false) ["mEstimateRevisions":"Title":private]=> NULL ["mRestrictions"]=> array(0) { } ["mOldRestrictions":protected]=> bool(false) ["mCascadeRestriction"]=> NULL ["mCascadingRestrictions"]=> NULL ["mRestrictionsExpiry":protected]=> array(0) { } ["mHasCascadingRestrictions":protected]=> NULL ["mCascadeSources"]=> NULL ["mRestrictionsLoaded"]=> bool(false) ["mPrefixedText":protected]=> NULL ["mTitleProtection"]=> NULL ["mDefaultNamespace"]=> int(0) ["mLength":protected]=> int(-1) ["mRedirect"]=> NULL ["mNotificationTimestamp":"Title":private]=> array(0) { } ["mHasSubpages":"Title":private]=> NULL ["mPageLanguage":"Title":private]=> bool(false) ["mDbPageLanguage":"Title":private]=> bool(false) ["mTitleValue":"Title":private]=> NULL ["mIsBigDeletion":"Title":private]=> NULL } ["mDataLoaded"]=> bool(false) ["mIsRedirect"]=> bool(false) ["mLatest"]=> bool(false) ["mPreparedEdit"]=> bool(false) ["mId":protected]=> NULL ["mDataLoadedFrom":protected]=> int(-1) ["mRedirectTarget":protected]=> NULL ["mLastRevision":protected]=> NULL ["mTimestamp":protected]=> string(0) "" ["mTouched":protected]=> string(14) "19700101000000" ["mLinksUpdated":protected]=> string(14) "19700101000000" } Faw872 (talk) 19:11, 22 February 2018 (UTC)

The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Crashed 1.30 Special:SpecialPages

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


[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}
Johnywhy (talk) 11:10, 9 April 2018 (UTC)
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. 109.233.225.254 (talk) 05:18, 10 April 2018 (UTC)
thx Johnywhy (talk) 18:37, 23 June 2018 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Adding User Groups

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


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. Revel IT (talk) 17:50, 8 June 2018 (UTC)

The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Trying to configure but the documentation doesnt help

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 177.215.67.42 (talk) 00:20, 11 June 2018 (UTC)

Did you figure it out? I have the same problem. Airammontessori (talk) 20:02, 26 May 2019 (UTC)

Patch needed?

Is this patch still needed? It's older than the latest release of the extension.

https://www.mediawiki.org/wiki/Extension:AccessControl#Notes

https://pastebin.com/a05ZJa39 Johnywhy (talk) 18:38, 23 June 2018 (UTC)

AccessControl Extension HTTP 500 Error with Mediawiki 1.30

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" 106.57.72.254 (talk) 13:42, 1 July 2018 (UTC)

AccessControl and MediaWiki 1.31

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} ShInKurO (talk) 08:06, 8 July 2018 (UTC)

Status on 1.31.1

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 (talk) 22:59, 9 October 2018 (UTC)

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. T0lk (talk) 20:37, 10 October 2018 (UTC)