allwiki首页  
天下维客 你可以修改的网络知识库
首页最近更改优秀条目专题展示电脑科技词典软件学习网络知识电脑安全明星时尚天下百科
 

MediaWiki修改:页面访问限制

天下维客,你可以修改的网络知识库

Jump to: navigation, search
MediaWiki扩展简明教程 Inputbox帮助文档 使用Spam黑名单 内容折叠隐藏 动态文章列表 指定图片链接
代码高亮处理 预置初始编辑文本 页面访问限制 所见即所得编辑器 QQ在线信息
交流:扩展使用 投票与评分 内容随机展示 wikitex 改进设想 ...更多
加入google地图和51地图标注功能 Ajax五颗星评分插件

本文取自元维基,欢迎共同翻译、整理与大家共享,促进中文wiki发展^_^

我编了个mediawiki的补丁用来进行页面访问限制、分类。它新添加了标签"restrict"允许"restrict"用户组成员限制页面访问。对于相应的"viewrestrict"用户组成员登录的用户可以阅读(或者修改)被限制的页面。其他的用户不能看见、搜索、导出这个受限页面。同时,你还可以使用"protect"标签来避免页面被非法编辑。受限页面用一个红色背景的标签区别出来,你有一个特殊页面可以列出所有(文中没有all,“所有”只是我猜的^_^)受限的页面。所有限制/非限制行为都会被wiki日志记录。它同时还可以……。(大意是不是,提供了表达式数组可以使新建网页的时候默认就是受限的)。当然,不光是管理员,用户的受限页面是也可以由用户自己来定义的。

剩下的就是语言支持啊,适用范围啊blabla。

I made a patch to enable page restriction under the MediaWiki software. Pages can be articles or categories. It adds a new |restrict| tab link allowing members of the group restrict to restrict pages. Users member of the group viewrestrict can read (and modify) the restricted pages. Other users cannot see, search, export, etc, the restricted pages. You can still |protect| them for editing. A restricted page is distinguished by a red background tab, and you have a special page (Special:Restrictedpages) to list the restricted pages. All restriction/unrestriction actions are logged in the wiki log. It is also possible to restrict pages by providing a regular expression array matching titles, and to restrict new pages by default. Optionally the user's pages can be restricted to their owner. Currently it is localized in English, German, Dutch, Swedish, Catalan, Finnish, Russian, Hebrew and French.

This feature is mainly useful for intranet relying on MediaWiki as a non-encyclopedic content management system, like e-learning platforms or informational systems. To respect the wiki philosophy, it is not appropriate to use it to restrict public access!

--Jej

More information at this site.

目录

Get the patch

Download the patch, how to install, changelog, screenshots and comments here :

Quick summary of what I did to get this running

  • Download the patch from the above site.
  • Add and customize this code to LocalSettings.php
  /**
  * If true, a new menu action allows to restrict pages access to 'restrict' group users. If false, all previously restricted pages are accessible again.
  */
  $wgEnableRestrict = true;
  
  /**
  * If true, new pages are restricted by default for 'restrict' group users.
  */
  $wgRestrictNewPages = false;
  
  /**
  * If true restrict user pages to their owner (as well as viewrestrict/restrict members)
  */
  $wgUserPageRestrict = false;
  
  /**
  * Regular expression array to restrict matching pages
  * eg. $wgRegexRestrict = array("^Secure:", "^Secret "); // restrict all pages where title is like 'Secure:...' or 'Secret ...'
  */
  $wgRegexRestrict = array();
  
  /**
   * If true do not add recent changes entry for restricted pages
   */
  $wgNoRecentChangesRestrict = true;
  
  /**
   * If true hide log entries related to restriction, except for 'restrict' or 'viewrestrict' users (Special:Log page)
   */
  $wgHideRestrictLog = true;
  • Apply the patch:
mv restriction-version.mediawiki-version.patch ./mediawiki-version
cd ./mediawiki-version
patch -p0 < restriction-version.mediawiki-version.patch

以上这段怎么理解呢?谁能解释一下mv是move?还是命令?谢谢!
-- mv 就是move命令

  • If necessary, reassign rights to the files that it patched:
cd ./mediawiki-version
chown -R root:apache *

How to help

  • You can test, report bugs, and try to find security holes (related to this restrict feature).
  • You can propose ideas, improvements, etc.
  • There is work to do to translate the messages in different languages. The texts to translate are :
'restrict' => 'Restrict',
'restrictthispage' => 'Restrict this page',
'unrestrict'    => 'Unrestrict',
'unrestrictthispage' => 'Unrestrict this page',
'restricttitle' => 'Restricted page',
'restricttext'  => 'This page is restricted. To view it you have to be member of the \'restrict\' group or \'viewrestrict\' group.',
'restrictedpages' => 'Restricted pages',
'restrictlogpage' => 'Restriction_log',
'restrictlogtext' => 'Below is a list of page restrictions. See [[{{ns:4}}:Restricted page]] for more information.',
'restrictedarticle' => 'restricted [[$1]]',
'unrestrictedarticle' => 'unrestricted [[$1]]',
'restrictsub' => '(Restrict \'[[$1]]\')',
'confirmrestrict' => 'Confirm the restriction',
'confirmrestricttext' => 'Do you really want to restrict this page?',
'restrictcomment' => 'Reason for restricting',
'unrestrictsub' => '(Unrestrict \'[[$1]]\')',
'confirmunrestricttext' => 'Do you really want to unrestrict this page?',
'confirmunrestrict' => 'Confirm unrestriction',
'unrestrictcomment' => 'Reason for unrestricting',
'restrictreason' => '(give a reason)',
'tooltip-restrict' => 'Restrict this page',
'notallowedtomoverestrictedpagetext' => 'To move this page, you have to be member of the \'restrict\' group.',
'restrictedpagespagetext' => 'This page lists all restricted pages in the wiki. ',
'regexrestrictedpagespagetext' => 'All page titles matching this/these regular expression(s) are also restricted : ',

Have a look in the language file : /languages/MessagesXx.php where Xx is the country/language code. Becareful, the charset is UTF-8. Please work on the last Mediawiki stable version.

Currently available :

  • English
  • French
  • German (thanks to Dr. Walter H. Schreiber)
  • Dutch (thanks to Peter De Baets)
  • Swedish (thanks to Samuel Lampa).
  • Catalan (thanks to Pau Cabot)
  • Finnish (thanks to Tuomas Helin)
  • Russian (thanks to T O X I N)
  • Hebrew (thanks to Yuval Hager)

You can send your contribs to restrict-mediawiki /at/ conseil-recherche-innovation.net. Please subscribe to the mailing list so I can contact users and contributors easily (restrict-mediawiki-list-subscribe /at/ conseil-recherche-innovation.net).

Todo

  • Texts translation.
  • Images are not protected.
  • Restrict new pages to their author only (or to be able to restrict any page to a single user)
  • Inverse restriction: all pages restricted except the marked ones.
  • Being able to define other groups than sysop, bureaucrat : ex. group A of students, group B...
  • Exclude regex restricted pages from the full text search
  • ...

See also

原文参见: Page access restriction with MediaWiki

MediaWiki扩展简明教程 Inputbox帮助文档 使用Spam黑名单 内容折叠隐藏 动态文章列表 指定图片链接
代码高亮处理 预置初始编辑文本 页面访问限制 所见即所得编辑器 QQ在线信息
交流:扩展使用 投票与评分 内容随机展示 wikitex 改进设想 ...更多
加入google地图和51地图标注功能 Ajax五颗星评分插件
mediawiki图标

MediaWiki是全球最著名和最流行的开源wiki程序,运行于PHP+MySQL环境。MediaWiki从2002年2月25日被维基百科全书选用,并有大量其他应用实例。

MediaWiki功能齐备,中文支持良好,且学习资源丰富,是建立wiki网站的首选后台程序。目前国内的天下维客等站点都采用这套系统。

MediaWiki的开发得到维基媒体基金会的支持,一直保值着持续更新。目前最新版本为1.12.x。

mediawiki知识


mediawiki建站

mediawiki资源

国外站需代理访问

→ 更多mediawiki资料  相关资源:wiki知识 wiki文摘  QQ群:22134343 / 3680101-wiki建站与应用 5903157-电脑使用


结果

我制造了片使在 MediaWiki 软件下面的页限制能够。 页可能是文章或种类。 它增加允许团体的成员的新的 |限制| 定位键联编 限制 限制页。 团体 viewrestrict' 的使用者成员' 能读 (而且修正) 被限制的页。其他的使用者及其他不能够见到,搜寻,输出被限制的页。 你能安静 | 保护| 他们为编辑。 被限制的页被红色背面区别

Personal tools
工具
金银币拍卖 金币拍卖预展  金银币网店 熊猫金银币 生肖金银币