Extension:CheckUser/zh


 * 這是一個關於擴展本身的頁面. 關於維基媒體基金會的用户查核政策，見CheckUser policy/zh. 

CheckUser是一个允许拥有checkuser权限的用户查核给定IP地址下的用户和给定用户使用的IP地址的，而无须手动在数据库运行查询的扩展. 這個擴展正運作在所有維基媒體的維基項目上.

安装
这个扩展在GNU GPL2.0或更新版协议下发布. 這個软件由As is提供. 更新会随着安装了MediaWiki的Wiki站点的需求来进行，或者是根据严格地检查出的有价值的可更新处.

基本
如果您已安装其他不需要运行 的扩展，请运行一次.

在无命令行访问下安装
很多的托管提供商不允许直接访问shell，但允许创建cron任务（例如通过cPanel的网页界面）. 对于这些提供了临时cron任务的托管提供商，可以用于运行 （自然/path/to需要被替换成完整的install.php路径）. 若您使用远程服务器且没有命令行访问权限（且使用cron任务的方案不适用于您），但是还是可以访问phpMyAdmin，跳过步骤＃2的这些步骤：


 * 下载和
 * 1) 在phpMyAdmin中，点击左侧您MediaWiki使用的数据库
 * 2) 在下一屏幕上，点击顶部导入标签.
 * 3) 在“从计算机中上传”，选择要上传的文件之一，将压缩选项选为“无”，并点击“执行”按钮.
 * 若您的phpMyAdmin只显示一个文本域且没有文件选择，点击左上角栏上的“SQL”，在phpMyAdmin的Logo下方，然后在打开的新窗口中单击“导入文件”选项卡.
 * 1) 重复第二个文件

在新的wiki上
按照上述步骤1，然后运行MediaWiki安装. MediaWiki安装程序将自动执行安装任务，若您在选择安装哪些扩展时选中了CheckUser.

配置
This tool migrates recent changes data to a separate  table, and adds to that when new entries are added. If  was previously set to false, there will be no initial data to search but new edits will fill in as soon as the extension is set up.

After you run the queries, you can reduce  to make recentchanges shorter, without affecting checkuser. Use  to set how far back checkuser data can go, in seconds.

In versions for MediaWiki 1.22 and later, the CheckUser-specific setting $wgCheckUserCIDRLimit determines the largest range that can be checked in a single check. Its format is the same as. Otherwise, the default limit (for all versions) is /32 for IPv6 checks and /16 for IPv4 checks.

CheckUsers using Mozilla Firefox can add this JS script to their .js file. It makes retrieving IP WHOIS data easier. It requires  support (about:config) enabled. (This can be  in Firefox 3)

授权权限以使用用户查核
To grant the right to use the Check User function, a user with user rights management must go to Special:UserRights and enter the user's name in the box, then select the option "Check User". Once this is done, the Check User option will show up on the Special pages page for that user.

To turn on user rights management for sysops, put the following into LocalSettings.php:

To only allow the adding and removing of the checkuser permission, use the following instead:

基本界面

 * 1) Go to Special:CheckUser.
 * 2) In the user field, type in the username (without the 'user:' prefix), IP address, or CIDR range.
 * 3) * IP: any IPv4 or IPv6 address.
 * 4) * CIDR: you can check a range of IP addresses by appending the CIDR prefix (by default, up to /16 for IPv4 (65,536 addresses), up to /64 for IPv6 (~1.8446*1019 addresses) before revision 7352, up to /48 for IPv6 (~1.2089*1024 addresses or 65536 /64s - controlled by $wgCheckUserCIDRLimit in the latest version) after revision 7352, and up to /32 (65536 /48's) after revision rECHU9d7c239bf88866eca577f3241194d440f94fa014). For notation, see Range blocks.
 * 5) * XFF: you can check a client IP address provided by X-Forwarded-For headers by appending /xff (for example, 127.0.0.1/xff).
 * 6) Select the information you want to retrieve.
 * 7) * Get IPs: returns IP addresses used by a registered user.
 * 8) * Get edits from IP: returns all edits made by a user (registered or anonymous) from an IP address or range.
 * 9) * Get users: returns user accounts that have edited from an IP or range.
 * 10) In the reason field, type in the reason you are accessing the confidential data. Try to succinctly summarise the situation (for example, "cross-wiki spam"); this will be logged in a log visible only to users with the checkuser-log permission.

显示的信息
A typical entry in the CheckUser results for a user summary ("get users") is as follows:


 * Example (Talk | contribs) (20:11, -- 20:12, ) [5]
 * 127.0.0.37 XFF: 127.0.0.1, 127.0.0.5

This is formatted to fit a lot of information into a format that can very easily be listed and skimmed, but is difficult to read unless you know what the information provided is. The information is laid out as follows:


 * 用户名 (用户连接) (time period when they edited from the given IP or range) [number of edits from the IP or range]
 * 來自編輯的IP地址 XFF: XFF information provided (can be spoofed)

Each IP/XFF combination used to edit is listed, in order of use.

The last ten user agents (browser, operating system, system language, and versions) for each user for edits made in the IP or range are listed afterwards.

XFF格式
XFF (X-Forwarded-For) headers indicate the series of IP addresses used from the user's computer (first) to the last proxy server. In case of Wikimedia, the last proxy server is one of the Wikimedia proxies (listed under $wgSquidServersNoPurge in the Wikimedia configuration file).

另一个例子

aaa.aaa.aaa.aaa       XFF: 10.4.46.42, 127.0.0.1, aaa.aaa.aaa.aaa, 208.80.152.46


 * the first two addresses (10.4.46.42, 127.0.0.1) are private to the originating network and can't be reached directly from the public Internet,
 * the third address (aaa.aaa.aaa.aaa) is the "public face" of the editor, usually a broadband or dialup ISP, a company gateway, (but possibly an anonymizer or a malware-compromised server),
 * the last address (208.80.152.46) is one of the Wikimedia squids (sq36.wikimedia.org).

MediaWiki configuration settings $wgUsePrivateIPs, $wgSquidServers, $wgSquidServersNoPurge and extensions using the IsTrustedProxy hook (such as Extension:TrustedXFF) change the way an actual IP address used to attribute edits is selected.

Personal tool links
When you gets results from Special:CheckUser you can add personal user tool links via two interface messages:
 * for IP addresses (for example m:Mediawiki:checkuser-userlinks-ip)
 * for registered users (for example m:Mediawiki:Checkuser-userlinks)

錯誤消息

 * database query syntax error

If you receive an error message like this when you try to save a page:

A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:

（SQL查询已隐藏）

from within function "efUpdateCheckUserData". Database returned error "1146: Table 'cu_changes' doesn't exist (localhost)".

This means that CheckUser has not been installed correctly. In this case you forgot to create the necessary  table in your database.

API
用户查核也提供API.

api.php?action=query&list=checkuser&curequest=userips&cutarget=Jimbo_Wales api.php?action=query&list=checkuser&curequest=edits&cutarget=127.0.0.1/16&xff=1&cureason=Some_check

api.php?action=query&list=checkuserlog&culuser=WikiSysop&cullimit=25 api.php?action=query&list=checkuserlog&cultarget=127.0.0.1&culfrom=20111015230000