Extension talk:NoAnonymous

Should there be a closing tag to match the  'NoAnonymous',        'version' => '',        'author' => 'Charles de Beauchesne',        'description' => 'Restrict acces to logged user',        'url' => 'http://www.mediawiki.org/wiki/Extension:NoAnonymous'        );
 * Add extension information to Special:Version

$wgGroupPermissions['*'   ]['createaccount']   = false; $wgGroupPermissions['*'   ]['read']            = false; $wgGroupPermissions['*'   ]['edit']            = false; $wgGroupPermissions['*'   ]['createpage']      = false; $wgGroupPermissions['*'   ]['createtalk']      = false;

$wgExtensionFunctions[] = "wfNoAnonymous";

function wfNoAnonymous {       global $wgHooks;

$wgHooks[ 'userCan' ][] = 'noAnonymousFoo'; }

function noAnonymousFoo( $title, $user, $action, $result ) {

if(!$user->isAnon) {               if($title->isSpecial( 'Userlogin' ) && !in_array("sysop", $user->getGroups)) header("Location:http://".$_SERVER["SERVER_NAME"]."/wiki/index.php/"); }       else {               global $wgWhitelistRead;

if( $title->isSpecial( 'Userlogin' ) || $title->isSpecial( 'Resetpass' ) ) return true; if(is_array($wgWhitelistRead) ) {                       $name = $title->getPrefixedText; $dbName = $title->getPrefixedDBKey; if( in_array($name,$wgWhitelistRead,true) || in_array($dbName,$wgWhitelistRead,true) ) return true; }

header("Location:http://".$_SERVER["SERVER_NAME"]."/wiki/index.php/special:Userlogin"); }

return true; }