MediaWiki从1.4.x升级至1.5.6后匿名编辑等权限设置失效的修复
前一阵子将几个MediaWiki的站点从1.4.7升级到1.5.6。最近发现了一个问题,即原先是设置为不允许匿名编辑和不允许自由注册的,但是这个设置现在失效了。
Google了一下MediaWiki的安装设置,找到几个网站,发现所说的方法都是用旧版本的方法(即通过$wgWhitelistEdit和$wgWhitelistAccount)。
怎样才能找到新版本下的设置方法呢?忽然想起新的软件包下的UPGRADE有提到LocalSettings.php文件的几个参数要修改的问题。于是重新翻看UPGRADE,终于找到了答案:
$wgDisableUploads has been replaced with $wgEnableUploads.
$wgWhitelistAccount has been replaced by the ‘createaccount’ permission
key in $wgGroupPermissions. To emulate the old effect of setting:
$wgWhitelistAccount['user'] = 0;
set:
$wgGroupPermissions['*']['createaccount'] = false;
$wgWhitelistEdit has been replaced by the ‘edit’ permission key.
To emulate the old effect of setting:
$wgWhitelistEdit = true;
set:
$wgGroupPermissions['*']['edit'] = false;
If $wgWhitelistRead is set, you must also disable the ‘read’ permission
for it to take affect on anonymous users:
$wgWhitelistRead = array( “Main Page”, “Special:Userlogin” );
$wgGroupPermissions['*']['read'] = false;
Note that you can disable/enable several other permissions by modifying
this configuration array in your LocalSettings.php; see DefaultSettings.php
for the complete default permission set.
If using Memcached, you must enabled it differently now:
$wgUseMemCached = true;
should be replaced with:
$wgMainCacheType = CACHE_MEMCACHED;
根据文中所说的去修改,设置又恢复正常了。
附几个搜索中找到的,有比较多MediaWiki安装设置以及使用帮助的网站:
