Some Personal DataEdit

I live in Uruguay and I'm a teacher at the state university (Universidad de la República) in the Computer Institute of Ingeneering School (Instituto de Computación, Facultad de Ingeniería).

Why I use MediaWikiEdit

I'm trying to use MediaWiki as communication way for several projects. As an effective replacement to BSCW.

Extension in UseEdit

I'm using extension:PageSecurity and User:Hex2bit/Calendar. Also I have a "dirty" extensions to protect SpecialPages based on groups.

I need...Edit

  • Lean php, a lot more.
  • An english course! (yes, I know !!!! sorry :-) )
  • A lot of other things...


  • A modified version of PageSecurity which allows a user if he belongs to an allowed group... or not... If the variable $wgPageSecurityAllowGroupAccept is false or not set, then is the normal PageSecurity. If the variable is true then a user is allow if belongs to an allowed group. The modified code is here.
  • An extension that can control the access to SpecialPages based on groups. The code is here.

I need help pls, where shall I paste this? end of specialpage.php? I am trying to access the specail page but say Thanks Dean <?php

// This is an attempt to control which SpecialPages can run each group
// The intention is set the SpecialPageExecuteBeforePage and if some conditions are not verified, display an error page.
$pageSpecialSecurityVersion = '0.0.1';
$wgExtensionFunctions[] = "wfSetSpecialPageSecurity";
global $wgExtensionCredits,$wgHooks;
$wgExtensionCredits['parserhook'][] = array(
    'author'=>'Fernando Carpani',
    'description' => 'Restricts access to special pages according to security definitions'
$wgHooks['SpecialPageAuthCheck'][]="SpecialPageAuthCheck"; /* Must be a boolean function. */     

// The array $wgSpecialPageAuth have list of group that can execute this special page. 
// The variable $wgSpecialPageAuthEnable control de check (if true, then the do the check

// global $wgSpecialPageAuth; is an array indexed by group and has a regular expression of allowed special page names.
// global $wgSpecialPageAuthEnable; 

function wfSetSpecialPageSecurity() {
  global $wgSpecialPageAuth,$wgSpecialPageAuthEnable;
  if ($wgSpecialPageAuth==NULL){
  if ($wgSpecialPageAuthEnable==NULL){

// The implementation is based on a new hook SpecialPageAuthCheck 

function SpecialPageAuthCheck(){
  global $wgSpecialPageAuthErrorPage,$wgUser,$wgTitle,$wgOut; 

  if (!SpecialPageAuthTest($wgTitle,$wgUser)){
    if (empty($wgSpecialPageAuthErrorPage)) return false;
    $title = Title::newFromText($wgSpecialPageAuthErrorPage);
    $redirectURL = $title->getFullURL();
    wfDebug(sprintf("====>SpecialPageAuthCheck: %s user=%d no permitida\n",$wgTitle->mDbkeyform,$wgUser->mId));
    return false;
 return true;

function SpecialPageAuthTest(&$title,&$user){
  global $wgSpecialPageAuthEnable,$wgSpecialPageAuth;
  wfDebug(sprintf("===>SpecialPageAuthTest: title=%s , user=%d\n",$title->mDbkeyform,$user->mId));

    // get user groups
    wfDebug(sprintf("===>SpecialPageAuthCheck: AuthEnable title=%s,user=%d\n",$title->mDbkeyform,$user->mId));
    // Sysops can execute with basis in other checks.
    if (in_array("sysop", $user_groups)) {
                return true;  // sysop access override granted
    } else  {
           // if the user has a group that is allowed to execute this page, then true, else false.
        foreach($user_groups as $group){
          wfDebug(sprintf("===>SpecialPageAuthCheck: user %d in group=%s\n",$user->mId,$group));
          if(preg_match($wgSpecialPageAuth[$group], $title->mDbkeyform, $matches, PREG_OFFSET_CAPTURE)){
            wfDebug(sprintf("===>SpecialPageAuthCheck: return Allowed by group=%s\n",$group));
            return true;
        return false;

  } else  {
      return true;