2016-02-27

Created page with "== ডাউনলোড =="

New page

<languages/>

{{TNT|Extension

|name = CheckUser

|status = stable

|type1 = special

|type2 = user identity

|author = [[User:Tim Starling|Tim Starling]], [[User:Voice of All|Aaron Schulz]]

|image = CheckUser1.png

|version = 2.4

|update = <!-- need update date -->

|mediawiki = 1.23+

|license = GPL-2.0+

|download = {{TNT|WikimediaDownload|CheckUser}}

|needs-updatephp = yes

|readme =

|changelog =

|description = CheckUser function allows a user with permissions to check which IPs are used by a given username and which usernames are used by a given IP, without having to run queries directly against the database by hand.

|parameters =

|rights = checkuser<br/>checkuser-log

|example =

|hook1 = RecentChange_save

|hook2 = EmailUser

<!-- |hook3 = User::mailPasswordInternal // Fix Template:Extension/HookInUse first! -->

|hook4 = AuthPluginAutoCreate

|hook5 = ParserTestTables

|hook6 = LoadExtensionSchemaUpdates

|hook7 = ContributionsToolLinks

|hook8 = ArticleEditUpdatesDeleteFromRecentchanges

|hook9 = LoggableUserIPData

|hook10 = AddNewAccount

|phabricator = MediaWiki-extensions-CheckUser

|pagedrive1 = true

|table1 = cu_changes

|table2 = cu_log

}}

:''This page is about the extension itself. For the Wikimedia Foundation CheckUser policy, see [[m:CheckUser policy]].''

'''CheckUser''' is an extension that allows a user (with the ''[[m:CheckUser policy|checkuser]]'' permission) to check which IPs are used by a given username and which usernames are used by a given IP, without having to run queries directly against the database by hand.

The extension is running live on all Wikimedia wikis.

== ডাউনলোড ==

{{TNT|WikimediaGitCheckout}}

== Installation ==

The extension is released under the GNU General Public License 2.0 or later.

The software is provided as-is.

Updates will be made according to the needs of Wikimedia wikis; or where critical vulnerabilities are discovered.

===On an existing wiki===

==== Basic ====

* If you have installed other extensions without running <code>php maintenance/update.php</code>, run that first.

{{TNT|ExtensionInstall

| custom-steps = * Using a telnet/ssh client program such as [[w:PuTTY|PuTTY]], navigate to the extensions/CheckUser folder and run <code>php install.php</code>. Ensure that you are running a PHP version 5.x install, otherwise this script will not run. The result will be something similar to this:

<pre>

...cu_changes table added.

...doing rc_id from 368856 to 368955....

...

...cu_changes table added and populated.

...cu_log added

...logging disabled, skipping log import.

</pre>

| registration = yes

}}

===== Installing without command prompt access =====

Many hosting providers don't allow direct shell access, but allow creation of cron jobs (e.g. via cPanel web interface).

For those hosting providers a temporary cron job can be used to run <code>php /path/to/install.php</code> (naturally <tt>/path/to</tt> should be replaced with real full path to install.php).

If you are using a remote server and do not have command prompt access (nor cron job solution is suitable for you), but do have access through [[w:phpMyAdmin|phpMyAdmin]], substitute these steps for step #2 above:

#Download {{git file|project=mediawiki/extensions/CheckUser|file=cu_changes.sql}} and {{git file|project=mediawiki/extensions/CheckUser|file=cu_log.sql}}

#In phpMyAdmin, click the database you're using for mediawiki along the left side

#On the next screen, click the "Import" tab at the top.

#At "Location of the text file", choose one of the files, select compression "None", and click the bottom "Go" button.

#:If your phpMyAdmin screen has only a text field and no text file chooser, click the "SQL" button in the left-side column, under the phpMyAdmin logo, and click the "import files" tab in the new window that opens.

#Repeat for the second file

===On a new wiki===

Follow step 1 as above, then run the MediaWiki installation.

The MediaWiki installer automatically will do installation tasks if you select the checkbox for CheckUser when prompted for which extensions to install.

=== Configuration ===

This tool migrates recent changes data to a separate <code>cu_changes</code> table, and adds to that when new entries are added. If <tt>{{ll|Manual:$wgPutIPinRC|$wgPutIPinRC}}</tt> 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 <tt>{{ll|Manual:$wgRCMaxAge|$wgRCMaxAge}}</tt> to make recentchanges shorter, without affecting checkuser. Use <code>$wgCUDMaxAge</code> 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 {{ll|Manual:$wgBlockCIDRLimit|$wgBlockCIDRLimit}}.

Otherwise, the default limit (for all versions) is /32 for IPv6 checks and /16 for IPv4 checks.

CheckUsers using [[w:Mozilla_Firefox|Mozilla Firefox]] can add [[w:User:Voice_of_All/UsefulJS#CheckUser_.28or_clerk.29_Only_JS_.28Requires_dropdown_menu_CSS_script.29.28Requires_Addtab.29|this JS script]] to their .js file.

It makes retrieving IP WHOIS data easier.

It requires <CODE>applets.codebase.principle</CODE> support (about:config) enabled.

(This can be <CODE>signed.applets.codebase_principle_support</CODE> in Firefox 3)

=== Granting right to use CheckUser ===

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:

<syntaxhighlight lang="php">

$wgGroupPermissions['sysop']['checkuser'] = true;

$wgGroupPermissions['sysop']['checkuser-log'] = true;

</syntaxhighlight>

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

<syntaxhighlight lang="php">

$wgAddGroups['sysop'][] = 'checkuser';

$wgRemoveGroups['sysop'][] = 'checkuser';

</syntaxhighlight>

== Configuration ==

{{clear}}

{| class="wikitable"

|+ Configuration settings in {{git file|project=mediawiki/extensions/CheckUser|file=CheckUser.php|branch=HEAD|text=CheckUser.php}}

|--

! parameter

! default

! comment

|---

| $wgCheckUserLog

| '/home/wikipedia/logs/checkuser.log'

| Legacy variable, no longer used. Used to point to a file in the server where

CheckUser would log all queries done through Special:CheckUser.

If this file exists, the installer will try to import data from this file to the 'cu_log' table in the database.

|--

| $wgCUDMaxAge

| 3 * 30 * 24 * 3600; // 3 months

| How long to keep CU data (in seconds)?

|---

| $wgCheckUserMaxBlocks

| 200;

| Mass block limits

|---

| $wgCheckUserForceSummary

| false

| Set this to true if you want to force checkusers into giving a reason for each check they do through Special:CheckUser. (Not very useful, given that checkusers could simply give a summary such as "they need to be checked" or "I feel like it" and the software would not know.)

|---

| $wgCheckUserCIDRLimit

|

$wgCheckUserCIDRLimit = array(

'IPv4' => 16,

'IPv6' => 32,

);

| Shortest CIDR limits that can be checked in any individual range check

|---

| $wgCUPublicKey

| <<<CUPUBLICKEY

CUPUBLICKEY;

| Public key to encrypt private data that may need to be read later Generate a public key with something like:

`openssl genrsa -out cu.key 2048; openssl rsa -in cu.key -pubout > cu.pub` and paste the contents of cu.pub here

|}

== Usage ==

=== Basic interface ===

# Go to [[Special:CheckUser]].

# In the ''user'' field, type in the username (without the 'user:' prefix), IP address, or CIDR range.

#* IP: any IPv4 or IPv6 address.

#* 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*10<sup>19</sup> addresses) before [https://gerrit.wikimedia.org/r/#/c/7352/ revision 7352], up to /48 for IPv6 (~1.2089*10<sup>24</sup> addresses or 65536 /64s - controlled by $wgCheckUserCIDRLimit in the latest version) after revision 7352, and up to /32 (65536 /48's) after [https://phabricator.wikimedia.org/rECHU9d7c239bf88866eca577f3241194d440f94fa014 revision rECHU9d7c239bf88866eca577f3241194d440f94fa014]). For notation, see [[Help:Range blocks|Range blocks]].

#* XFF: you can check a '''client''' IP address provided by X-Forwarded-For headers by appending ''/xff'' (for example, ''127.0.0.1/xff'').

# Select the information you want to retrieve.

#* ''Get IPs'': returns IP addresses used by a registered user.

#* ''Get edits from IP:'' returns all edits made by a user (registered or anonymous) from an IP address or range.

#* ''Get users'': returns user accounts that have edited from an IP or range.

# 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.

<gallery caption="Screenshots" widths="450px" heights="400px">

File:CheckUser1.png|Basic CheckUser interface

File:CheckUser3.png|Example username check

File:CheckUser2.png|Example IP check

File:CheckUser log.png|Example log

</gallery>

=== Information returned ===

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

<div style="margin:0 1em; border:1px solid #CCC; background:#EEE; font-style:italic;">

* [[user:Example|Example]] ([[user talk:Example|Talk]] | [[Special:Contributions|contribs]]) (20:11, {{#time:d F Y|-1 day}} -- 20:12, {{#time:d F Y|-1 day}}) '''[5]'''

*# 127.0.0.37 '''XFF''': 127.0.0.1, 127.0.0.5

</div>

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:

<div style="margin:0 1em; border:1px solid #CCC; background:#EEE; font-style:italic;">

* username (user links) (time period when they edited from the given IP or range) '''[number of edits from the IP or range]'''

*# IP address edited from '''XFF''': XFF information provided (can be spoofed)<br />

</div>

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 Format ===

XFF ([[:en:X-Forwarded-For|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 [[Manual:$wgSquidServersNoPurge|$wgSquidServersNoPurge]] in the [http://noc.wikimedia.org/conf/highlight.php?file=CommonSettings.php Wikimedia configuration file]).

In this example:

<div style="margin:0 1em; padding: 2px; border:1px solid #CCC; background:#EEE; font-style:italic;">

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

</div>

* 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 [[Manual:$wgUsePrivateIPs|$wgUsePrivateIPs]], [[Manual:$wgSquidServers|$wgSquidServers]], [[Manual:$wgSquidServersNoPurge|$wgSquidServersNoPurge]] and [[:Category:IsTrustedProxy extensions|extensions using]] the [[Manual:Hooks/IsTrustedProxy|IsTrustedProxy]] hook (such as [[Extension:TrustedXFF]]) change the way an actual IP address used to attribute edits is selected.

== Error messages ==

; database query syntax error

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

<pre>

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

(SQL query hidden)

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

</pre>

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

==API==

CheckUser also provides an [[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

== Notes ==

<references/>

{{TNT|OnWikimedia}}

{{languages|Extension:CheckUser}}

[[Category:Log extensions{{translation}}]]

[[Category:API extensions{{translation}}]]

Show more