Saturday, September 29. 2007Version 0.8 of AccessControl Extension for MediaWikiTrackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
Thank you ! I'll install.
#1
on
2007-09-29 14:18
Yukio,
I just wanted post the same mistake. You was quicker!! Bye Christian
#1.1
on
2007-10-16 18:28
I love the extension, but I couldn't get it to work correctly for me without changing line 520 from
$allowedGroups = str_replace("(ro)","",substr($content, $start, $end-strlen($endtag)+1 )); to $allowedGroups = str_replace("(ro)","",substr($content, $start, $end-$start )); Without the change, it seemed to include the ending tab as part of the last group name in the list (or only group name in the list, as my case happened to be) and therefore access control did not work accurately.
#2
on
2007-09-30 17:34
What is complete string for the accesscontrol-tag?
#2.1
on
2007-09-30 18:00
Martin, I'm having trouble figuring out how to control user access for viewing a page, not just editing it. Is this within the scope of your plugin? Am I just missing something?
Upgraded Mediawiki to 1.11 and upgraded to v0.8 of AccessControl.
whenever a term inside an accesscontrolled page is searched for it comes back with No Access even though there are a lot of unprotected pages which also contain the term. Any thoughts on how to fix?
#4
on
2007-10-22 17:03
Hi Martin,
Erstmal vorab, danke für das schöne Script. Ich benötige dringend Hilfe, zu accesscontrol 0.8 ich verwende es mit medawiki 1.11.0. Alles funktioniert wenn ich mit einem vorhandenem User per Cookies eingeloggt werde. Allerdings lädt sich die Seite zu Tode wenn in den Cookies keine Login-Daten vermerkt sind. Firefox sagt mir dazu folgendes: Die aufgerufene Website leitet die Anfrage so um, dass sie nie beendet werden kann. Ist das Problem bekannt? Du kannst mich auch per Skype: tarcus2k ICQ: 96061581 oder MSN: tarcus2k@hotmail.com kontaktieren. Vielen Dank schonmal
I installed the latest version (0.
#6
on
2007-10-30 14:01
About my previous comment with searching redirecting to no access. This only seems to happen if the search term matches text in a restricted page. So, if there is a restricted article that has the word 'secret' in it and you search for 'secret' , you are redirected to the no access page, even if there are NON protected pages containing the word 'secret'.
#7
on
2007-10-30 14:25
To get it working on my site I had to do several modifications in accesscontrol.php on my 1.11.0 mediawiki.
First I commented a lot of stuff around line 200 as you can see because it was just not working: // get the allowed users from the group // this part is used, if the Version of MediaWiki is greater or equal than 1.7 //if ($wgWikiVersion>=1.7) //{ // create new title as static helper $Title = new Title(); // create title in namespace 0 (default) from groupTitle $gt = $Title->makeTitle(0, $groupTitle); // create Article and get the content $groupPage = new Article( $gt, 0 ); $allowedUsers=$groupPage->fetchContent(0); $Title = null; //} //else //{ // old mimic for mediaWiki 1.6 and below // $groupPage = new Article( $groupTitle, 0 ); // $allowedUsers=$groupPage->getPreloadedText($groupTitle); //} Then near line 425 I modified this: // return "$linkName"; return "$linkName"; That is because my site is: http://domain/wiki/index.php/... And by default this extension seems to miss the wiki word of the path I have. About LocalSettings.php now I use these prefs: ############################################################################### # PAGES SECURITY PATCH ############################################################################### require_once("extensions/accesscontrolSettings.php"); include("extensions/accesscontrol.php"); # require that users log in to read $wgGroupPermissions['*']['read'] = true; # require that users log in to edit $wgGroupPermissions['*']['edit'] = true; # allow these pages for anonymous users $wgWhitelistRead = array( "Main Page", "Special:Userlogin", "-", "MediaWiki:Monobook.css" ); Now, to polish it all I added this little hook too in the LocalSettings.php file (it makes it so that an anonymous user can't edit pages, but only view the source) : # This snippet prevents editing from anonymous users but gives them read source access function fnMyUserCan($title, $user, $action) { if (($action == 'edit') && $user->isAnon()) { return false; } return true; } $wgHooks['userCan'][] = 'fnMyUserCan';
#8
on
2007-11-07 16:31
Is it possible to deactivate redirection to No_Access in search results ?
#9
on
2007-11-21 15:38
LDAP extension and Group Based Access Extension - Always Getting No Access Page
----------------------- Has anyone gotten both of these extensions to work together? I have LDAP working perfectly but this extension doesn't seem to work too well with it. Whenever I create a page with the accesscontrol tag and the group's inside it - it results in a No Access Page regardless if you're in that group or not. I thought it had to do with the case sensitivity of the AD usernames but even when I took out the 'strtolower' function in accesscontrol.php it still has the same results.
#10
on
2007-11-27 16:27
guten tag nochmal!
ich glaube, dass mir vorhin ein fehler unterlaufen ist! ich verwende die accesscontrol extension 0.8 mit mediawiki 1.11.0 nicht mit 1.10.0! vielen dank! mfg bpczi
#11
on
2007-12-05 19:50
hallo Martin,
dein Script ist super. Würde gerne wissen, ob du noch weiter an Erweiterungen arbeitest. Ich habe auf einer Seite gesehen, dass du vor hast accesscontrol-tags für Templates zu kreieren. Diese Funktion wäre für mein Wiki sehr hilfreich und ich wollte mal fragen ob und wann etwas für diese Funktion geplant ist? lg
#12
on
2007-12-06 10:30
Hallo Nadja,
ich bin im Moment leider ziemlich beschäftigt, da ich gerade auf der Suche nach einem neuen Job bin. Ich arbeite definitv an der Extension weiter, kann aber noch nicht sagen, wann ich dazu komme, neue Funktionalitäten einzubauen, da ich das ganze nach Feierabend betreibe. Ich werde mich aber nach Kräften bemühen Bye Martin
#12.1
on
2007-12-06 21:57
The download link appears to be broken.
#13
on
2007-12-06 15:04
Sorry, it's fixed now
#13.1
on
2007-12-06 21:58
the download link seems to be dead
#14
on
2007-12-06 19:28
Sorry, it's fixed now, I switched my whole website to the blog and forgot the download directory
#14.1
on
2007-12-06 21:58
hello,
How could I to deactivate redirection to No_Access in search results ?? weber
#15
on
2007-12-27 09:35
Hi, this is caused by the hookUserCan Function.
On line 71 in accesscontrol.php is the hook link. Just comment the line [geshi lang=PHP]$wgHooks['userCan'][] = 'hookUserCan';[/lang] out. But be aware that this breaks the bypassing of the cache. Bye Martin
#15.1
on
2007-12-27 10:50
Dear Martin
I got it. Thanks a lot! weber
#15.1.1
on
2007-12-27 11:13
Dear Martin
When I comment the line $wgHooks['userCan'][] = 'hookUserCan',I find AccessControl Extension lose it's function. So,How can I do ?? weber
#15.1.2
on
2007-12-27 11:25
Hi Martin,
I had the same problem and your solution works in firefox. Using the IE and following a link (in the search result) to a fobidden page you will get No Access. Using the Browser back button and following the link again you get access. Do you have any hints how to solve this? bye Michael
#15.1.3
on
2008-01-15 14:43
Hi Martin,
I'm using MediaWiki 1.11.1 and have the problem of the no-access page showing for a search. I tried commenting out line 71 in accesscontrol.php and the search works for anonymous users. But accesscontrol now doesn't restrict anonymous users from seeing controlled pages. Chet
#15.1.4
on
2008-01-29 18:13
I wrote my own patch to "solve" this problem..
I have modified accesscontrol.php on line 248 to this : // redirect to the no-access-page if current user doesn't match the // accesscontrol list If(strpos($_SERVER["HTTP_REFERER"],"&search=")){ }else{ $wgOut->redirect($wgAccessControlNoAccessPage); } Its not ideal solution, but now you can search in protected documents...
#15.1.4.1
on
2009-09-08 15:39
I'm having a similar problem... searching doesn't work when one of the results is protected. Is there anyway to either remove the offending results from search, or (less favorable solution) allow protected searches to be returned while still protecting the individual pages?
I tried commenting out the line, but it looks like when I do so, all protected content is available.
#15.1.5
on
2008-03-10 15:30
Getting "PHP parse error: Syntax error, unexpected T_REQUIRED_ONCE in LocalSettings.php" when parsing the line
require_once("extensions/accesscontrolSettings.php") have mediawiki 1.11.0 installed and version 8. Any ideas?
#16
on
2008-01-07 20:01
This seems like an error with an unset semicolon. Have you checked, if the instructions before the "require_once" are are ended with a semicolon?
#16.1
on
2008-03-22 14:45
Hallo Martin,
könntest Du bitte die Installationsanleitung auf dieser Seite http://www.mediawiki.org/wiki/Extension:Group_Based_Access_Control überarbeiten/korrigieren. Es fehlt der Hinweis auf die Herunterladbaren Dateien (die Datei accesscontrol.php wird gar nicht erwähnt) und die Angaben zur/aus der accesscontrolSettings.php sind nicht up-to-date.
#17
on
2008-01-15 14:59
Hallo Martin,
hatte wie Metasharp das Problem, dass MediaWiki bei mir in einem Unterpfad installiert ist. Die Webadresse also ungefähr so lautet: http://www.homepage.org/wiki/ Damit kommt Deine AccessControl Erweiterung leider nicht richtig klar. Habe deswegen die beiden Dateien accesscontrol.php und accesscontrolSettings.php ein wenig angepasst. In accesscontrolSettings.php an Zeile 9 dies eingefügt: $wgAccessControlLocalSubPath = "/wiki"; // If the wiki remains in a subfolder define that folder here Zeile 15 ersetzt durch: $wgAccessControlNoAccessPage = $wgAccessControlLocalSubPath."/index.php?title=Kein_Zugriff"; Zeile 23 ersetzt durch: // $wgAccessControlNoAccessPage = $wgAccessControlLocalSubPath."/index.php/No_Access"; // To this page will these users redirected who ar not allowed to see the page. Dazu in accesscontrol.php folgende Änderungen. In Zeile 388 folgendes eingefügt: global $wgAccessControlLocalSubPath; Zeile 421 ersetzt durch: return "$linkName"; Die Zeilennummern beziehen sich immer auf die Zeile vor der Änderung. Habe aber noch das Problem, dass auf einer geschützten Seite die Links in der Zeile "Diese Seite ist nur für die Gruppen %s zugänglich!!!" falsch sind. Laut Debugausgabe liefert die Funktion displayGroups() aber den richtigen Link zurück. Ändert MediaWiki diesen nocheinmal selber? Vielen Dank für diese tolle Erweiterung!! Thomas
#18
on
2008-01-31 20:25
So does every article need a tag?
Wouldn't it be better if there is no tag, everybody can see the article? It's bothersome to add a large amount of groups to an article.
#19
on
2008-02-11 00:45
No, just the articles that should be protected need a tag. If no tag is set, then the page is visible to all.
#19.1
on
2008-03-22 14:42
Here is a patch to automatically redirect to the login page and after the user is logged in, give them an easy link to get back to the page they wanted to access. You can set the options in the Settings file. For this to work you have to set $wgAccessControlNoAccessPage to /index.php/Special:Userlogin. I don't know what page it is in German to give an example.
diff -Naur accesscontrol-0.8/accesscontrol.php accesscontrol-0.8.new/accesscontrol.php --- accesscontrol-0.8/accesscontrol.php 2008-02-13 14:14:04.000000000 -0700 +++ accesscontrol-0.8.new/accesscontrol.php 2008-02-15 15:20:10.000000000 -0700 @@ -232,11 +232,17 @@ function doRedirect() { global $wgOut; + global $wgTitle; global $wgAccessControlNoAccessPage; + global $wgAccessControlReturnToPage; // some first initialisations if (trim($wgAccessControlNoAccessPage)=="") $wgAccessControlNoAccessPage="/index.php/No_Access"; + if ($wgAccessControlReturnToPage) { + $wgAccessControlNoAccessPage .= "?returnto=" . $wgTitle->getPrefixedText(); + } + // make direct redirect, if $wgOut isn't already set (bypassing the cache), bad hack if ((is_object( $wgOut )) && (is_a( $wgOut, 'StubObject' ))) { diff -Naur accesscontrol-0.8/accesscontrolSettings.php accesscontrol-0.8.new/accesscontrolSettings.php --- accesscontrol-0.8/accesscontrolSettings.php 2008-02-13 14:14:04.000000000 -0700 +++ accesscontrol-0.8.new/accesscontrolSettings.php 2008-02-15 16:01:38.000000000 -0700 @@ -11,17 +11,18 @@ ########################################## # deutsche version ########################################## - $wgAccessControlGroupPrefix = "Benutzergruppe"; - $wgAccessControlNoAccessPage = "/index.php?title=Kein_Zugriff"; - $wgGroupLineText ="Diese Seite ist nur für die Gruppe %s zugänglich!!!"; - $wgGroupsLineText ="Diese Seite ist nur für die Gruppen %s zugänglich!!!"; + //$wgAccessControlGroupPrefix = "Benutzergruppe"; + //$wgAccessControlNoAccessPage = "/index.php?title=Kein_Zugriff"; + //$wgGroupLineText ="Diese Seite ist nur für die Gruppe %s zugänglich!!!"; + //$wgGroupsLineText ="Diese Seite ist nur für die Gruppen %s zugänglich!!!"; ########################################## # english version ########################################## - // $wgAccessControlGroupPrefix = "Usergroup"; // The prefix for the Usergroup pages - // $wgAccessControlNoAccessPage = "/index.php/No_Access"; // To this page will these users redirected who ar not allowed to see the page. - // $wgGroupLineText = "This page is only accessible for group %s !!!"; // The text for the showing on the restricted pages, for one group - // $wgGroupsLineText = "This page is only accessible for the groups %s !!!"; // The text for the showing on the restricted pages, for more than one group + $wgAccessControlGroupPrefix = "Usergroup"; // The prefix for the Usergroup pages + $wgAccessControlNoAccessPage = "/index.php/Special:Userlogin"; // To this page will these users redirected who ar not allowed to see the page. + $wgAccessControlReturnToPage = true; // After login will provide link for user to get back to requested page + $wgGroupLineText = "This page is only accessible for group %s !!!"; // The text for the showing on the restricted pages, for one group + $wgGroupsLineText = "This page is only accessible for the groups %s !!!"; // The text for the showing on the restricted pages, for more than one group ?>
Hallo Martin,
ich bin sehr froh, dass es deine Extension gibt und möchte mich an dieser Stelle für deine Arbeit bedanken! Ich habe weiter oben auch gelesen, dass du momentan wenig Zeit für weitere Arbeiten daran findest. Dennoch möchte ich ein paar Anregungen für die zukünftige Weiterentwicklung geben, die die Extension noch besser handhabbar machen und besser in die MW-Oberfläche integrieren sollen: - Integration von ordentlichen Sprachfiles, die über die Betawiki in weitere Sprachen übersetzt werden können - Umstellung der Usergroup Definitionsseiten auf eine (zugriffsbeschränkte...) Specialpage, bei der eine neue Gruppe über eine Überschrift definiert wird und die User über eine bulleted list - Anzeige einer Zugriffsbeschränkung als Vorhängeschlosssymbol neben dem Page Title, bei dem die definierten Gruppen als Tooltip bei Mouseover erscheinen. Dominik P.S. Sollte ich diese Nachricht vielleicht auf englisch hier oder woanders posten, falls jemand dabei mithelfen will?
#21
on
2008-03-13 07:27
Do you anything new to fix the problem to see some parts of the protected pages?
Thanks
I found a flaw on this extension. Say page [[ABC]] is restricted. People can just easily create new page and transclude page [[ABC]] to view it ({{:ABC}})
Hi,
I just install a clean version of mediawiki 1.12.0 I think i done all the steps for a good installation of your extension and I got an error when i try to do the third step : - Create a Wiki-Page with the Name Usergroup:test (for example) the error is : - Parse error: syntax error, unexpected '=', expecting ')' in /www/wiki/extensions/accesscontrol.php on line 115 Any tips to make your extension working. I really need to close some pages for read. If I can't i will have to choose another tool. Thanks in advance
#24
on
2008-04-20 19:52
Hello,
I need to restrict read access to some pages in my wiki, but I did not manage to do it with your extension ? Looking at the code (I'm not a php/mediawiki expert), I saw that you hook into userCan, but in fact the hook function hookUserCan is never called with the "read" action, so at the end the body of the function is never executed. Thank you for your assistance. Eric
#25
on
2008-04-21 17:53
Hi all,
I was just wondering how one can remove the tag within a page. When editing a page having such a tag I don't see it in the MediaWiki's editor. Any ideas? Cheers Vincent
#26
on
2008-04-29 13:27
If you search for a non existing page and your search results include a page that has the accesscontrol-tags at the top of the page you will be redirected to the No_Access page and cannot create a new page!
Hi Martin,
I installed your extension and I am happy so far. thank you very much. However, I would like to know if there is any way to protect documents stored in the Image Namespace the same way? I.e. restrict access to media document using tags, groups etc... If you know of any free or commercial way, stable or beta... Thank you very much in advance, Jean Francois
#28
on
2008-07-16 14:56
Hallo,
ich benutze MediaWiki 1.13 und probiere gerade alle Hacks aus, die hier vorgeschlagen werden. Aber irgendwie wollen die alle nicht funktionieren. Das wiki ist bei mir auch in einem Unterverzeichnis. Was könnte ich noch ändern um Accesscontrol anwenden zu können? Bin für jede Hilfe dankbar
#29
on
2008-09-29 15:32
Hi There,
it seems to have a problem with Category Pages. Is that possible? Cheers, Julian
#30
on
2008-10-10 22:58
Hello,
I have problems using AccessControl with Collection extension. My problem is similar to one described here: http://www.mail-archive.com/mwlib@googlegroups.com/msg00211.html The error message is Fatal error: Call to a member function getText() on a non-object in /var/www/wiki/extensions/accesscontrol.php on line 594 when accessing page api.php?redirects=1&titles=Makler&format=json&action=query&rvprop=content&prop=revisions Could you please fix that behaviour in the next release or point some way of solving the problem? Kind regards, Piotr
#31
on
2009-01-27 13:54
Hi Martin!
Ich habe das gleiche Problem wie ein paar Leute hier auch schon. Ich verwende MediaWiki 1.14.0 und AccessControl 1.0. Wenn man nach einem Begriff sucht, der in einer gesperrten Seite vorkommt, bugt die Suche. Kannst Du mir sagen, wie ich das fixen kann, so dass man den Suchbegriff auf den Seiten, zu denen man Zugang hat, findet, und auf den gesperrten nicht? Beste Grüße, Markus
#32
on
2009-03-26 11:48
As I cant find an E-Mail address of yours, ill just post it as a comment:
Your Plugin works fine, but it totally messes up wiki search. See my fixes: function doRedirect() { global $wgOut; global $wgAccessControlNoAccessPage; //aliedit so user can search global $wgTitle, $wgSearchPageName; if ($wgTitle==$wgSearchPageName) return; //aliedit end AND function hookUserCan( &$title, &$wgUser, $action, &$result ) { [....] else $allowAccess = controlUserAccess( $allowedGroups, true ); //aliedit //controlUserAccess( $allowedGroups, true ); } } } if ($allowAccess) return true; } This seams to work and does not show entries the user has no right to read as search results. If this fix is not applied any user can read any document by multiply using search...
#33
on
2009-08-01 18:21
Hi,
I would like to restrict the information on the members (Special:Listusers) of a group to only members of that group. Is it possible to do it with your extension? Many thanks for any information.
#34
on
2009-10-02 00:44
Version 0.8 contains assumption that mediawiki is installed into the root directory of the webserver. Patch for correcting this bug follows:
--- accesscontrol.php 2007-09-29 12:20:00.000000000 +0200 +++ /var/lib/mediawiki/extensions/GroupBasedAccessControl/accesscontrol.php 2010-02-17 18:15:32.000000000 +0100 @@ -233,9 +233,10 @@ { global $wgOut; global $wgAccessControlNoAccessPage; + global $wgScriptPath; // some first initialisations - if (trim($wgAccessControlNoAccessPage)=="") $wgAccessControlNoAccessPage="/index.php/No_Access"; + if (trim($wgAccessControlNoAccessPage)=="") $wgAccessControlNoAccessPage="$wgScriptPath/index.php/No_Access"; // make direct redirect, if $wgOut isn't already set (bypassing the cache), bad hack if ((is_object( $wgOut )) && (is_a( $wgOut, 'StubObject' ))) @@ -385,6 +386,8 @@ // Parses a Wiki-Link and generates a HTML-Link (this is quite a bad hack) function parseLink($link) { + global $wgScriptPath; + // Check if Link is marked "Read Only" if (strpos( $link, "(ro)")) { @@ -417,7 +420,7 @@ } // return the HTML link - return "$linkName"; + return "$linkName"; } Have fun, Attila PS: Spam prevention is very bad. I was unable to read 2 strings. The author does not allow comments to this entry
|
Calendar
QuicksearchArchivesKategorienBlog Administration |
|||||||||||||||||||||||||||||||||||||||||||||||||