hi,
- i didnt find how to allow access to special pages only for sysop - i didnt find how to allow access to purge pages only for sysop - i didnt find where are stored templates
if some one could help it would be nice !
thanks
hi,
- i didnt find how to allow access to special pages only for sysop - i didnt find how to allow access to purge pages only for sysop - i didnt find where are stored templates
if some one could help it would be nice !
thanks
Purging is possible for everyone and can't be restricted. You could set the user right purge
to false for every user group you want, but that would only require the members to click "ok" for the purge action.
For preventing access to certain (special) pages, you should read Manual:Preventing_access, MediaWiki isn't designed for that.
hi,
the purge option only remove the confirmation message, so the purge stay available for anonymous user
i made a dirty script to fix what i was seeking for:
function disableSomeSpecialPages() { //Init Vars global $wgUser; $chkSO=false; $pInfo=isset($_SERVER["PATH_INFO"])?$_SERVER["PATH_INFO"]:; $pUri=isset($_SERVER["QUERY_STRING"])?$_SERVER["QUERY_STRING"]:; //getPath info $url=str_replace("é","e",$pInfo); //Case Special Page if(stripos($url,"/special:")!==false && stripos($url,":Connexion")===false && stripos($pUri,"connexion")===false){$chkSO=true;} //Case Purge if(stripos($pUri,"action=purge")!==false){$chkSO=true;} //Do the check if($chkSO && !in_array('sysop',$wgUser->getEffectiveGroups()))
{header('Location:../?title=Special:connexion');}
} $wgHooks['SpecialPage_initList'][]='disableSomeSpecialPages';
i still searching where template are stored !
thanks
Hi,
i repost the code to be better formated !
function disableSomeSpecialPages()
{
//Init Vars
global $wgUser;
$chkSO=false;
$pInfo=isset($_SERVER["PATH_INFO"])?$_SERVER["PATH_INFO"]:;
$pUri=isset($_SERVER["QUERY_STRING"])?$_SERVER["QUERY_STRING"]:;
//getPath info $url=str_replace("é","e",$pInfo);
//Case Special Page
if(stripos($url,"/special:")!==false && stripos($url,":Connexion")===false && stripos($pUri,"connexion")===false){$chkSO=true;}
//Case Purge
if(stripos($pUri,"action=purge")!==false){$chkSO=true;}
//Do the check
if($chkSO && !in_array('sysop',$wgUser->getEffectiveGroups()))
{header('Location:../?title=Special:connexion');}
}
$wgHooks['SpecialPage_initList'][]='disableSomeSpecialPages';
this code has to be set in LocalSetting.php
function disableSomeSpecialPages() { //Init Vars global $wgUser; $chkSO=false; $pInfo=isset($_SERVER["PATH_INFO"])?$_SERVER["PATH_INFO"]:; $pUri=isset($_SERVER["QUERY_STRING"])?$_SERVER["QUERY_STRING"]:; //getPath info $pInfo=str_replace("é","e",$pInfo); $pUri=str_replace("é","e",urldecode($pUri)); //Case Special Page if((stripos($pInfo,"/special:")!==false || stripos($pUri,"special:")!==false) && stripos($pInfo,":Connexion")===false && stripos($pUri,"connexion")===false){$chkSO=tru$ //Case Purge if(stripos($pUri,"action=purge")!==false){$chkSO=true;} //Banner case allow for annonymous if(stripos($pInfo,"Special:BannerLoader")!==false){$chkSO=false;} //Do the check if($chkSO && !in_array('sysop',$wgUser->getEffectiveGroups())) { if(stripos($pUri,"special:")!==false) {header('Location:./?title=Special:connexion');} else {header('Location:../?title=Special:connexion');} } } $wgHooks['SpecialPage_initList'][]='disableSomeSpecialPages';
updated: fix banner management
function disableSomeSpecialPages() { //Init Vars global $wgContLang; global $wgUser; $connPage=$wgContLang->mExtendedSpecialPageAliases["Userlogin"][0]; $specPage=$wgContLang->getNsText(-1); $chkSO=false; $pInfo=isset($_SERVER["PATH_INFO"])?$_SERVER["PATH_INFO"]:; $pUri=isset($_SERVER["QUERY_STRING"])?$_SERVER["QUERY_STRING"]:; //getPath info $pUri=urldecode($pUri); //Case Special Page if( (stripos($pInfo,"/".$specPage.":")!==false || stripos($pUri,$specPage.":")!==false) && stripos($pInfo,":".$connPage)===false && stripos($pUri,$connPage)===false) {$chkSO=true;} //Case Purge if(stripos($pUri,"action=purge")!==false){$chkSO=true;} //Banner case allow for annonymous if(stripos($pInfo,"Special:BannerLoader")!==false){$chkSO=false;} //Do the check if($chkSO && !in_array('sysop',$wgUser->getEffectiveGroups())) { if(stripos($pUri,"special:")!==false) {header('Location:./?title='.$specPage.':' . $connPage);} else {header('Location:../?title='.$specPage.':'. $connPage);} } } $wgHooks['SpecialPage_initList'][]='disableSomeSpecialPages';
fixed special page NS & login page Translation