Open GoogleCodeExporter opened 9 years ago
Use this function in "accessHookSupport.php"
function efIACUserCanAccessMediaWikiGroups( &$user, &$accessGroups, $action ){
global $egReadOnlyActionAccess;
global $wgUser;
$explodedGroups = explode( ',,', $accessGroups );
$userGroups = $wgUser->mGroups;
$userName = trim($user->getName());
if(in_array($userName, $explodedGroups))
{
efIACDebugLog("(efIACUserCanAccessPageGroups)"."full access granted
");
return true;
}
if(in_array($userName."(ro)", $explodedGroups) && in_array( $action,
$egReadOnlyActionAccess ))
{
efIACDebugLog( "(efIACUserCanAccessPageGroups)"."read-only access
granted ");
return true;
}
foreach($userGroups as $usergroup)
{
if(in_array($usergroup, $explodedGroups))
{
efIACDebugLog("(efIACUserCanAccessPageGroups)"."full access
granted ");
return true;
}
else if(in_array($usergroup."(ro)", $explodedGroups) && in_array
( $action, $egReadOnlyActionAccess ))
{
efIACDebugLog( "(efIACUserCanAccessPageGroups)"."read-only
access granted ");
return true;
}
}
return false;
}
Original comment by quochoa....@gmail.com
on 29 May 2009 at 1:23
On my wiki it doesn´t work with user, and also it doesnt´t work with
Mediawiki groups (although we have put this code in accessHookSupport.php).
Can you help me?
Original comment by Mediawik...@googlemail.com
on 14 Dec 2011 at 10:19
Original issue reported on code.google.com by
eisenst...@gmail.com
on 10 Nov 2008 at 7:44