Browse Source

remove extensions that we can pull from mediawiki repo

dev
Adrian Malacoda 2 years ago
parent
commit
7eb613d31a
2088 changed files with 5 additions and 83987 deletions
  1. +5
    -0
      Dockerfile
  2. +0
    -339
      application/w/extensions/CheckUser/COPYING
  3. +0
    -463
      application/w/extensions/CheckUser/CheckUser.alias.php
  4. +0
    -472
      application/w/extensions/CheckUser/CheckUser.hooks.php
  5. +0
    -53
      application/w/extensions/CheckUser/CheckUser.php
  6. +0
    -65
      application/w/extensions/CheckUser/CheckUserEncryptedData.php
  7. +0
    -115
      application/w/extensions/CheckUser/CheckUserLogPager.php
  8. +0
    -39
      application/w/extensions/CheckUser/Gruntfile.js
  9. +0
    -259
      application/w/extensions/CheckUser/api/ApiQueryCheckUser.php
  10. +0
    -133
      application/w/extensions/CheckUser/api/ApiQueryCheckUserLog.php
  11. +0
    -8
      application/w/extensions/CheckUser/archives/patch-cu_changes_indexes.sql
  12. +0
    -4
      application/w/extensions/CheckUser/archives/patch-cu_changes_indexes2.sql
  13. +0
    -3
      application/w/extensions/CheckUser/archives/patch-cu_changes_privatedata.sql
  14. +0
    -10
      application/w/extensions/CheckUser/composer.json
  15. +0
    -31
      application/w/extensions/CheckUser/cu_changes.pg.sql
  16. +0
    -58
      application/w/extensions/CheckUser/cu_changes.sql
  17. +0
    -25
      application/w/extensions/CheckUser/cu_log.pg.sql
  18. +0
    -37
      application/w/extensions/CheckUser/cu_log.sql
  19. +0
    -91
      application/w/extensions/CheckUser/cu_log_import.inc
  20. +0
    -110
      application/w/extensions/CheckUser/extension.json
  21. +0
    -1
      application/w/extensions/CheckUser/gitinfo.json
  22. +0
    -73
      application/w/extensions/CheckUser/i18n/af.json
  23. +0
    -11
      application/w/extensions/CheckUser/i18n/am.json
  24. +0
    -40
      application/w/extensions/CheckUser/i18n/an.json
  25. +0
    -4
      application/w/extensions/CheckUser/i18n/ang.json
  26. +0
    -80
      application/w/extensions/CheckUser/i18n/ar.json
  27. +0
    -18
      application/w/extensions/CheckUser/i18n/arc.json
  28. +0
    -67
      application/w/extensions/CheckUser/i18n/arz.json
  29. +0
    -12
      application/w/extensions/CheckUser/i18n/as.json
  30. +0
    -103
      application/w/extensions/CheckUser/i18n/ast.json
  31. +0
    -22
      application/w/extensions/CheckUser/i18n/avk.json
  32. +0
    -30
      application/w/extensions/CheckUser/i18n/az.json
  33. +0
    -12
      application/w/extensions/CheckUser/i18n/azb.json
  34. +0
    -104
      application/w/extensions/CheckUser/i18n/ba.json
  35. +0
    -37
      application/w/extensions/CheckUser/i18n/bcc.json
  36. +0
    -73
      application/w/extensions/CheckUser/i18n/bcl.json
  37. +0
    -74
      application/w/extensions/CheckUser/i18n/be-tarask.json
  38. +0
    -8
      application/w/extensions/CheckUser/i18n/be.json
  39. +0
    -66
      application/w/extensions/CheckUser/i18n/bg.json
  40. +0
    -88
      application/w/extensions/CheckUser/i18n/bn.json
  41. +0
    -74
      application/w/extensions/CheckUser/i18n/br.json
  42. +0
    -71
      application/w/extensions/CheckUser/i18n/bs.json
  43. +0
    -83
      application/w/extensions/CheckUser/i18n/ca.json
  44. +0
    -8
      application/w/extensions/CheckUser/i18n/cdo.json
  45. +0
    -42
      application/w/extensions/CheckUser/i18n/ce.json
  46. +0
    -9
      application/w/extensions/CheckUser/i18n/ch.json
  47. +0
    -50
      application/w/extensions/CheckUser/i18n/ckb.json
  48. +0
    -6
      application/w/extensions/CheckUser/i18n/co.json
  49. +0
    -85
      application/w/extensions/CheckUser/i18n/cs.json
  50. +0
    -9
      application/w/extensions/CheckUser/i18n/csb.json
  51. +0
    -15
      application/w/extensions/CheckUser/i18n/cu.json
  52. +0
    -10
      application/w/extensions/CheckUser/i18n/cv.json
  53. +0
    -73
      application/w/extensions/CheckUser/i18n/cy.json
  54. +0
    -81
      application/w/extensions/CheckUser/i18n/da.json
  55. +0
    -12
      application/w/extensions/CheckUser/i18n/de-formal.json
  56. +0
    -109
      application/w/extensions/CheckUser/i18n/de.json
  57. +0
    -76
      application/w/extensions/CheckUser/i18n/diq.json
  58. +0
    -72
      application/w/extensions/CheckUser/i18n/dsb.json
  59. +0
    -10
      application/w/extensions/CheckUser/i18n/ee.json
  60. +0
    -82
      application/w/extensions/CheckUser/i18n/el.json
  61. +0
    -89
      application/w/extensions/CheckUser/i18n/en-gb.json
  62. +0
    -104
      application/w/extensions/CheckUser/i18n/en.json
  63. +0
    -74
      application/w/extensions/CheckUser/i18n/eo.json
  64. +0
    -123
      application/w/extensions/CheckUser/i18n/es.json
  65. +0
    -67
      application/w/extensions/CheckUser/i18n/et.json
  66. +0
    -46
      application/w/extensions/CheckUser/i18n/eu.json
  67. +0
    -9
      application/w/extensions/CheckUser/i18n/ext.json
  68. +0
    -85
      application/w/extensions/CheckUser/i18n/fa.json
  69. +0
    -85
      application/w/extensions/CheckUser/i18n/fi.json
  70. +0
    -13
      application/w/extensions/CheckUser/i18n/fo.json
  71. +0
    -116
      application/w/extensions/CheckUser/i18n/fr.json
  72. +0
    -27
      application/w/extensions/CheckUser/i18n/frc.json
  73. +0
    -71
      application/w/extensions/CheckUser/i18n/frp.json
  74. +0
    -9
      application/w/extensions/CheckUser/i18n/frr.json
  75. +0
    -11
      application/w/extensions/CheckUser/i18n/fy.json
  76. +0
    -50
      application/w/extensions/CheckUser/i18n/ga.json
  77. +0
    -5
      application/w/extensions/CheckUser/i18n/gan-hans.json
  78. +0
    -9
      application/w/extensions/CheckUser/i18n/gan-hant.json
  79. +0
    -107
      application/w/extensions/CheckUser/i18n/gl.json
  80. +0
    -6
      application/w/extensions/CheckUser/i18n/got.json
  81. +0
    -19
      application/w/extensions/CheckUser/i18n/grc.json
  82. +0
    -74
      application/w/extensions/CheckUser/i18n/gsw.json
  83. +0
    -14
      application/w/extensions/CheckUser/i18n/gu.json
  84. +0
    -10
      application/w/extensions/CheckUser/i18n/gv.json
  85. +0
    -7
      application/w/extensions/CheckUser/i18n/ha.json
  86. +0
    -9
      application/w/extensions/CheckUser/i18n/hak.json
  87. +0
    -11
      application/w/extensions/CheckUser/i18n/haw.json
  88. +0
    -106
      application/w/extensions/CheckUser/i18n/he.json
  89. +0
    -78
      application/w/extensions/CheckUser/i18n/hi.json
  90. +0
    -42
      application/w/extensions/CheckUser/i18n/hif-latn.json
  91. +0
    -10
      application/w/extensions/CheckUser/i18n/hil.json
  92. +0
    -77
      application/w/extensions/CheckUser/i18n/hr.json
  93. +0
    -72
      application/w/extensions/CheckUser/i18n/hsb.json
  94. +0
    -84
      application/w/extensions/CheckUser/i18n/hu.json
  95. +0
    -9
      application/w/extensions/CheckUser/i18n/hy.json
  96. +0
    -72
      application/w/extensions/CheckUser/i18n/ia.json
  97. +0
    -81
      application/w/extensions/CheckUser/i18n/id.json
  98. +0
    -26
      application/w/extensions/CheckUser/i18n/ig.json
  99. +0
    -72
      application/w/extensions/CheckUser/i18n/ilo.json
  100. +0
    -9
      application/w/extensions/CheckUser/i18n/inh.json

+ 5
- 0
Dockerfile View File

@ -27,6 +27,11 @@ RUN cd /tmp && wget $MW_SOURCE && tar -xvf mediawiki-*.tar.gz && \
mkdir smf && cd smf && wget $SMF_SOURCE && tar -xvf smf_*.tar.gz && \
rm -rf Settings.php attachments smf_*.tar.gz && cp -Rv * $FORUMS_SOURCE
# Install additional extensions
RUN ./add_extension.sh FlaggedRevs $MW_VERSION && \
./add_extension.sh CheckUser $MW_VERSION && \
./add_extension.sh Contributors $MW_VERSION
RUN chown -R www-data:www-data /application
ADD --chown=www-data:www-data application application
RUN cd $WIKI_SOURCE && composer update --no-dev

+ 0
- 339
application/w/extensions/CheckUser/COPYING View File

@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

+ 0
- 463
application/w/extensions/CheckUser/CheckUser.alias.php View File

@ -1,463 +0,0 @@
<?php
/**
* Aliases for Special:CheckUser
*
* @file
* @ingroup Extensions
*/
// @codingStandardsIgnoreFile
$specialPageAliases = array();
/** English (English) */
$specialPageAliases['en'] = array(
'CheckUser' => array( 'CheckUser' ),
'CheckUserLog' => array( 'CheckUserLog' ),
);
/** Arabic (العربية) */
$specialPageAliases['ar'] = array(
'CheckUser' => array( 'تدقيق_مستخدم' ),
'CheckUserLog' => array( 'سجل_تدقيق_المستخدم' ),
);
/** Egyptian Arabic (مصرى) */
$specialPageAliases['arz'] = array(
'CheckUser' => array( 'تدقيق_يوزر' ),
'CheckUserLog' => array( 'سجل_التشيك-يوزر' ),
);
/** Assamese (অসমীয়া) */
$specialPageAliases['as'] = array(
'CheckUser' => array( 'সদস্যৰ_অনুসন্ধান_কৰক' ),
'CheckUserLog' => array( 'সদস্যৰ_অভিলেখ_চাওক' ),
);
/** Avaric (авар) */
$specialPageAliases['av'] = array(
'CheckUser' => array( 'Проверить_участника' ),
'CheckUserLog' => array( 'Журнал_проверок_участников' ),
);
/** Bashkir (башҡортса) */
$specialPageAliases['ba'] = array(
'CheckUser' => array( 'CheckUser' ),
'CheckUserLog' => array( 'CheckUserLog' ),
);
/** Bulgarian (български) */
$specialPageAliases['bg'] = array(
'CheckUser' => array( 'Проверка_на_потребител' ),
);
/** Western Balochi (بلوچی رخشانی) */
$specialPageAliases['bgn'] = array(
'CheckUser' => array( 'کارمرزوکی_تلاشی_کورتین' ),
'CheckUserLog' => array( 'کارمرزوکی_تلاشی_ئی_سیاهه' ),
);
/** Banjar (Bahasa Banjar) */
$specialPageAliases['bjn'] = array(
'CheckUser' => array( 'Tukui_pamakai' ),
);
/** Breton (brezhoneg) */
$specialPageAliases['br'] = array(
'CheckUser' => array( 'GwiriañAozer' ),
);
/** Bosnian (bosanski) */
$specialPageAliases['bs'] = array(
'CheckUser' => array( 'ProvjeraKorisnika' ),
);
/** Catalan (català) */
$specialPageAliases['ca'] = array(
'CheckUser' => array( 'Verificació_de_comptes_d\'usuari' ),
'CheckUserLog' => array( 'Registres_de_les_verificacions_de_comptes_d\'usuari' ),
);
/** Min Dong Chinese (Mìng-dĕ̤ng-ngṳ̄) */
$specialPageAliases['cdo'] = array(
'CheckUser' => array( '檢查用戶' ),
'CheckUserLog' => array( '檢查用戶日誌' ),
);
/** Chechen (нохчийн) */
$specialPageAliases['ce'] = array(
'CheckUser' => array( 'Декъашхочунга_хьажар' ),
'CheckUserLog' => array( 'Декъашхойн_нисдарийн_тептар' ),
);
/** German (Deutsch) */
$specialPageAliases['de'] = array(
'CheckUser' => array( 'Checkuser' ),
'CheckUserLog' => array( 'Checkuser-Logbuch' ),
);
/** Zazaki (Zazaki) */
$specialPageAliases['diq'] = array(
'CheckUser' => array( 'KontrolkarKarber' ),
'CheckUserLog' => array( 'KontrolkarKarberCıkewtış' ),
);
/** Lower Sorbian (dolnoserbski) */
$specialPageAliases['dsb'] = array(
'CheckUser' => array( 'Kontrolny_wužywaŕ' ),
);
/** Greek (Ελληνικά) */
$specialPageAliases['el'] = array(
'CheckUser' => array( 'ΈλεγχοςΧρήστη' ),
);
/** Esperanto (Esperanto) */
$specialPageAliases['eo'] = array(
'CheckUser' => array( 'Kontroli_uzanton' ),
'CheckUserLog' => array( 'Protokoloj_de_kontrolado_de_uzantoj' ),
);
/** Spanish (español) */
$specialPageAliases['es'] = array(
'CheckUser' => array( 'VerificarUsuario', 'ComprobarUsuario', 'Comprobar_usuario' ),
);
/** Persian (فارسی) */
$specialPageAliases['fa'] = array(
'CheckUser' => array( 'بازرسی_کاربر' ),
'CheckUserLog' => array( 'سیاهه_بازرس_کاربر' ),
);
/** Finnish (suomi) */
$specialPageAliases['fi'] = array(
'CheckUser' => array( 'Tarkasta_käyttäjä' ),
'CheckUserLog' => array( 'Osoitepaljastusloki' ),
);
/** French (français) */
$specialPageAliases['fr'] = array(
'CheckUser' => array( 'Vérificateur_d\'utilisateur', 'Vérificateur_d\'utilisateurs', 'VérificateurUtilisateur', 'VérificateurUtilisateurs', 'Vérificateur_d’adresse' ),
);
/** Arpitan (arpetan) */
$specialPageAliases['frp'] = array(
'CheckUser' => array( 'Controlor_d\'usanciér', 'ControlorDUsanciér' ),
);
/** Galician (galego) */
$specialPageAliases['gl'] = array(
'CheckUser' => array( 'Verificador_de_usuarios' ),
'CheckUserLog' => array( 'Rexistro_de_verificación_de_usuarios' ),
);
/** Swiss German (Alemannisch) */
$specialPageAliases['gsw'] = array(
'CheckUser' => array( 'Benutzerpriefig' ),
);
/** Gujarati (ગુજરાતી) */
$specialPageAliases['gu'] = array(
'CheckUser' => array( 'સભ્યચકાસણી' ),
);
/** Hebrew (עברית) */
$specialPageAliases['he'] = array(
'CheckUser' => array( 'בדיקת_משתמש' ),
'CheckUserLog' => array( 'יומן_בדיקת_משתמשים' ),
);
/** Hindi (हिन्दी) */
$specialPageAliases['hi'] = array(
'CheckUser' => array( 'सदस्य_जाँच' ),
'CheckUserLog' => array( 'सदस्य_जाँच_लॉग' ),
);
/** Croatian (hrvatski) */
$specialPageAliases['hr'] = array(
'CheckUser' => array( 'Provjeri_suradnika' ),
);
/** Upper Sorbian (hornjoserbsce) */
$specialPageAliases['hsb'] = array(
'CheckUser' => array( 'Kontrolny_wužiwar' ),
);
/** Xiang Chinese (湘语) */
$specialPageAliases['hsn'] = array(
'CheckUser' => array( '检查用户' ),
);
/** Haitian (Kreyòl ayisyen) */
$specialPageAliases['ht'] = array(
'CheckUser' => array( 'TchekeItilizatè' ),
);
/** Hungarian (magyar) */
$specialPageAliases['hu'] = array(
'CheckUser' => array( 'IP-ellenőr' ),
);
/** Interlingua (interlingua) */
$specialPageAliases['ia'] = array(
'CheckUser' => array( 'Verificar_usator' ),
'CheckUserLog' => array( 'Verificar_registro_de_usatores' ),
);
/** Indonesian (Bahasa Indonesia) */
$specialPageAliases['id'] = array(
'CheckUser' => array( 'Periksa_pengguna', 'PeriksaPengguna', 'Pemeriksaan' ),
'CheckUserLog' => array( 'Catatan_pemeriksaan' ),
);
/** Italian (italiano) */
$specialPageAliases['it'] = array(
'CheckUser' => array( 'CU' ),
'CheckUserLog' => array( 'RegistroCheckUser' ),
);
/** Japanese (日本語) */
$specialPageAliases['ja'] = array(
'CheckUser' => array( 'チェックユーザー', 'チェックユーザ', '利用者調査' ),
'CheckUserLog' => array( 'チェックユーザー記録', '利用者調査記録' ),
);
/** Georgian (ქართული) */
$specialPageAliases['ka'] = array(
'CheckUser' => array( 'ჩეკიუზერი' ),
);
/** Khmer (ភាសាខ្មែរ) */
$specialPageAliases['km'] = array(
'CheckUser' => array( 'ត្រួតពិនិត្យអ្នកប្រើប្រាស់' ),
);
/** Korean (한국어) */
$specialPageAliases['ko'] = array(
'CheckUser' => array( '사용자검사', '사용자확인' ),
'CheckUserLog' => array( '사용자검사기록', '사용자확인기록' ),
);
/** Colognian (Ripoarisch) */
$specialPageAliases['ksh'] = array(
'CheckUser' => array( 'Metmaacher_Pröve', 'Metmaacher_Pröfe' ),
);
/** Cornish (kernowek) */
$specialPageAliases['kw'] = array(
'CheckUser' => array( 'CheckyaDevnydhyer' ),
'CheckUserLog' => array( 'CheckyaKovnotenAnDevnydhyer' ),
);
/** Ladino (Ladino) */
$specialPageAliases['lad'] = array(
'CheckUser' => array( 'KontrolarUsador' ),
);
/** Luxembourgish (Lëtzebuergesch) */
$specialPageAliases['lb'] = array(
'CheckUser' => array( 'Benotzerkontroll' ),
'CheckUserLog' => array( 'Logbuch_vun_der_Benotzerkontroll' ),
);
/** Northern Luri (لۊری شومالی) */
$specialPageAliases['lrc'] = array(
'CheckUser' => array( 'ڤارئسی_کاریار' ),
'CheckUserLog' => array( 'پئھرئستنوٙمە_ڤارئسی_کاریار' ),
);
/** Malagasy (Malagasy) */
$specialPageAliases['mg'] = array(
'CheckUser' => array( 'Mpanamarina_mpikambana', 'MpanamarinaMpikambana' ),
'CheckUserLog' => array( 'LaogimpanamarinaMpikambana' ),
);
/** Minangkabau (Baso Minangkabau) */
$specialPageAliases['min'] = array(
'CheckUser' => array( 'ParesoPangguno' ),
'CheckUserLog' => array( 'LogPamaresoan' ),
);
/** Macedonian (македонски) */
$specialPageAliases['mk'] = array(
'CheckUser' => array( 'ПроверкаНаКорисник' ),
'CheckUserLog' => array( 'ПроверкаНаКорисникДневник' ),
);
/** Malayalam (മലയാളം) */
$specialPageAliases['ml'] = array(
'CheckUser' => array( 'ചെക്ക്‌‌യൂസർ' ),
'CheckUserLog' => array( 'ചെക്ക്‌യൂസർരേഖ' ),
);
/** Marathi (मराठी) */
$specialPageAliases['mr'] = array(
'CheckUser' => array( 'सदस्यतपासनिस' ),
);
/** Malay (Bahasa Melayu) */
$specialPageAliases['ms'] = array(
'CheckUser' => array( 'Perisik' ),
'CheckUserLog' => array( 'Log_perisik' ),
);
/** Erzya (эрзянь) */
$specialPageAliases['myv'] = array(
'CheckUser' => array( 'ВанкшномсКиеТеицясь' ),
);
/** Norwegian Bokmål (norsk bokmål) */
$specialPageAliases['nb'] = array(
'CheckUser' => array( 'IP-sjekk' ),
'CheckUserLog' => array( 'IP-sjekkingslogg' ),
);
/** Low Saxon (Netherlands) (Nedersaksies) */
$specialPageAliases['nds-nl'] = array(
'CheckUser' => array( 'Gebruker_opvragen' ),
'CheckUserLog' => array( 'Logboek_gebruker_naokieken' ),
);
/** Dutch (Nederlands) */
$specialPageAliases['nl'] = array(
'CheckUser' => array( 'GebruikerControleren' ),
'CheckUserLog' => array( 'LogboekGebruikerControleren' ),
);
/** Occitan (occitan) */
$specialPageAliases['oc'] = array(
'CheckUser' => array( 'Verificator_d’adreça', 'VerificatorAdreça', 'VerificatorAdreca' ),
);
/** Punjabi (ਪੰਜਾਬੀ) */
$specialPageAliases['pa'] = array(
'CheckUser' => array( 'ਚੈੱਕ_ਵਰਤੋਂਕਾਰ' ),
'CheckUserLog' => array( 'ਚੈੱਕ_ਵਰਤੋਂਕਾਰ_ਚਿੱਠਾ' ),
);
/** Portuguese (português) */
$specialPageAliases['pt'] = array(
'CheckUser' => array( 'Verificar_usuário' ),
'CheckUserLog' => array( 'Registo_de_verificação_de_usuário', 'Registro_de_verificação_de_usuário' ),
);
/** Brazilian Portuguese (português do Brasil) */
$specialPageAliases['pt-br'] = array(
'CheckUser' => array( 'Verificar_usuário' ),
'CheckUserLog' => array( 'Registro_de_verificação_de_usuário', 'Registo_de_verificação_de_usuário' ),
);
/** Quechua (Runa Simi) */
$specialPageAliases['qu'] = array(
'CheckUser' => array( 'RuraqtaLlanchiy' ),
);
/** Romanian (română) */
$specialPageAliases['ro'] = array(
'CheckUser' => array( 'Verifică_utilizator' ),
);
/** Russian (русский) */
$specialPageAliases['ru'] = array(
'CheckUser' => array( 'Проверить_участника' ),
'CheckUserLog' => array( 'Журнал_проверок_участников' ),
);
/** Sanskrit (संस्कृतम्) */
$specialPageAliases['sa'] = array(
'CheckUser' => array( 'योजकपरिक्षक' ),
);
/** Sicilian (sicilianu) */
$specialPageAliases['scn'] = array(
'CheckUser' => array( 'CU' ),
'CheckUserLog' => array( 'RegistroCU' ),
);
/** Slovak (slovenčina) */
$specialPageAliases['sk'] = array(
'CheckUser' => array( 'SkontrolovaťPoužívateľa' ),
);
/** Albanian (shqip) */
$specialPageAliases['sq'] = array(
'CheckUser' => array( 'KontrolloPërdorues' ),
);
/** Swedish (svenska) */
$specialPageAliases['sv'] = array(
'CheckUser' => array( 'Kolla_användare' ),
'CheckUserLog' => array( 'Kolla_användare_logg' ),
);
/** Swahili (Kiswahili) */
$specialPageAliases['sw'] = array(
'CheckUser' => array( 'MtumiajiMwangalizi' ),
);
/** Thai (ไทย) */
$specialPageAliases['th'] = array(
'CheckUser' => array( 'ตรวจสอบผู้ใช้' ),
'CheckUserLog' => array( 'ปูมตรวจสอบผู้ใช้' ),
);
/** Tagalog (Tagalog) */
$specialPageAliases['tl'] = array(
'CheckUser' => array( 'Suriin_ang_tagagamit' ),
);
/** Turkish (Türkçe) */
$specialPageAliases['tr'] = array(
'CheckUser' => array( 'Denetçi', 'KullanıcıDenetle' ),
'CheckUserLog' => array( 'DenetçiGünlüğü' ),
);
/** Ukrainian (українська) */
$specialPageAliases['uk'] = array(
'CheckUser' => array( 'Перевірити_користувача' ),
'CheckUserLog' => array( 'Журнал_перевірок_користувачів' ),
);
/** Urdu (اردو) */
$specialPageAliases['ur'] = array(
'CheckUser' => array( 'صارف_پڑتال' ),
'CheckUserLog' => array( 'نوشتہ_صارف_پڑتال' ),
);
/** Venetian (vèneto) */
$specialPageAliases['vec'] = array(
'CheckUser' => array( 'ControlaUtente' ),
);
/** Veps (vepsän kel’) */
$specialPageAliases['vep'] = array(
'CheckUser' => array( 'KodvdaKävutajad' ),
);
/** Vietnamese (Tiếng Việt) */
$specialPageAliases['vi'] = array(
'CheckUser' => array( 'Kiểm_tra_người_dùng' ),
'CheckUserLog' => array( 'Nhật_trình_kiểm_tra_người_dùng' ),
);
/** Chinese (中文) */
$specialPageAliases['zh'] = array(
'CheckUser' => array( '用户查核', '用戶查核', '使用者查核' ),
);
/** Simplified Chinese (中文(简体)‎) */
$specialPageAliases['zh-hans'] = array(
'CheckUser' => array( '用户查核' ),
'CheckUserLog' => array( '用户查核日志' ),
);
/** Traditional Chinese (中文(繁體)‎) */
$specialPageAliases['zh-hant'] = array(
'CheckUser' => array( '使用者查核' ),
'CheckUserLog' => array( '使用者查核日誌' ),
);
/** Chinese (Hong Kong) (中文(香港)‎) */
$specialPageAliases['zh-hk'] = array(
'CheckUser' => array( '用戶查核' ),
'CheckUserLog' => array( '用戶查核日誌' ),
);

+ 0
- 472
application/w/extensions/CheckUser/CheckUser.hooks.php View File

@ -1,472 +0,0 @@
<?php
class CheckUserHooks {
/**
* Hook function for RecentChange_save
* Saves user data into the cu_changes table
* Note that other extensions (like AbuseFilter) may call this function directly
* if they want to send data to CU without creating a recentchanges entry
* @param RecentChange $rc
* @return bool
*/
public static function updateCheckUserData( RecentChange $rc ) {
global $wgRequest;
/**
* RC_CATEGORIZE recent changes are generally triggered by other edits.
* Thus there is no reason to store checkuser data about them.
* @see https://phabricator.wikimedia.org/T125209
*/
if ( defined( 'RC_CATEGORIZE' ) && $rc->getAttribute( 'rc_type' ) == RC_CATEGORIZE ) {
return true;
}
/**
* RC_EXTERNAL recent changes are not triggered by actions on the local wiki.
* Thus there is no reason to store checkuser data about them.
* @see https://phabricator.wikimedia.org/T125664
*/
if ( defined( 'RC_EXTERNAL' ) && $rc->getAttribute( 'rc_type' ) == RC_EXTERNAL ) {
return true;
}
$attribs = $rc->getAttributes();
// Get IP
$ip = $wgRequest->getIP();
// Get XFF header
$xff = $wgRequest->getHeader( 'X-Forwarded-For' );
list( $xff_ip, $isSquidOnly ) = self::getClientIPfromXFF( $xff );
// Get agent
$agent = $wgRequest->getHeader( 'User-Agent' );
// Store the log action text for log events
// $rc_comment should just be the log_comment
// BC: check if log_type and log_action exists
// If not, then $rc_comment is the actiontext and comment
if ( isset( $attribs['rc_log_type'] ) && $attribs['rc_type'] == RC_LOG ) {
$target = Title::makeTitle( $attribs['rc_namespace'], $attribs['rc_title'] );
$context = RequestContext::newExtraneousContext( $target );
$formatter = LogFormatter::newFromRow( $rc->getAttributes() );
$formatter->setContext( $context );
$actionText = $formatter->getPlainActionText();
} else {
$actionText = '';
}
$dbw = wfGetDB( DB_MASTER );
$cuc_id = $dbw->nextSequenceValue( 'cu_changes_cu_id_seq' );
$rcRow = array(
'cuc_id' => $cuc_id,
'cuc_namespace' => $attribs['rc_namespace'],
'cuc_title' => $attribs['rc_title'],
'cuc_minor' => $attribs['rc_minor'],
'cuc_user' => $attribs['rc_user'],
'cuc_user_text' => $attribs['rc_user_text'],
'cuc_actiontext' => $actionText,
'cuc_comment' => $attribs['rc_comment'],
'cuc_this_oldid' => $attribs['rc_this_oldid'],
'cuc_last_oldid' => $attribs['rc_last_oldid'],
'cuc_type' => $attribs['rc_type'],
'cuc_timestamp' => $attribs['rc_timestamp'],
'cuc_ip' => IP::sanitizeIP( $ip ),
'cuc_ip_hex' => $ip ? IP::toHex( $ip ) : null,
'cuc_xff' => !$isSquidOnly ? $xff : '',
'cuc_xff_hex' => ( $xff_ip && !$isSquidOnly ) ? IP::toHex( $xff_ip ) : null,
'cuc_agent' => $agent
);
# On PG, MW unsets cur_id due to schema incompatibilites. So it may not be set!
if ( isset( $attribs['rc_cur_id'] ) ) {
$rcRow['cuc_page_id'] = $attribs['rc_cur_id'];
}
Hooks::run( 'CheckUserInsertForRecentChange', array( $rc, &$rcRow ) );
$dbw->insert( 'cu_changes', $rcRow, __METHOD__ );
return true;
}
/**
* Hook function to store password reset
* Saves user data into the cu_changes table
*
* @param User $user Sender
* @param string $ip
* @param User $account Receiver
* @return bool
*/
public static function updateCUPasswordResetData( User $user, $ip, $account ) {
global $wgRequest;
// Get XFF header
$xff = $wgRequest->getHeader( 'X-Forwarded-For' );
list( $xff_ip, $isSquidOnly ) = self::getClientIPfromXFF( $xff );
// Get agent
$agent = $wgRequest->getHeader( 'User-Agent' );
$dbw = wfGetDB( DB_MASTER );
$cuc_id = $dbw->nextSequenceValue( 'cu_changes_cu_id_seq' );
$rcRow = array(
'cuc_id' => $cuc_id,
'cuc_namespace' => NS_USER,
'cuc_title' => '',
'cuc_minor' => 0,
'cuc_user' => $user->getId(),
'cuc_user_text' => $user->getName(),
'cuc_actiontext' => wfMessage( 'checkuser-reset-action', $account->getName() )
->inContentLanguage()->text(),
'cuc_comment' => '',
'cuc_this_oldid' => 0,
'cuc_last_oldid' => 0,
'cuc_type' => RC_LOG,
'cuc_timestamp' => $dbw->timestamp( wfTimestampNow() ),
'cuc_ip' => IP::sanitizeIP( $ip ),
'cuc_ip_hex' => $ip ? IP::toHex( $ip ) : null,
'cuc_xff' => !$isSquidOnly ? $xff : '',
'cuc_xff_hex' => ( $xff_ip && !$isSquidOnly ) ? IP::toHex( $xff_ip ) : null,
'cuc_agent' => $agent
);
$dbw->insert( 'cu_changes', $rcRow, __METHOD__ );
return true;
}
/**
* Hook function to store email data
* Saves user data into the cu_changes table
* @param MailAddress $to
* @param MailAddress $from
* @param string $subject
* @param string $text
* @return bool
*/
public static function updateCUEmailData( $to, $from, $subject, $text ) {
global $wgSecretKey, $wgRequest, $wgCUPublicKey;
if ( !$wgSecretKey || $from->name == $to->name ) {
return true;
}
$userFrom = User::newFromName( $from->name );
$userTo = User::newFromName( $to->name );
$hash = md5( $userTo->getEmail() . $userTo->getId() . $wgSecretKey );
// Get IP
$ip = $wgRequest->getIP();
// Get XFF header
$xff = $wgRequest->getHeader( 'X-Forwarded-For' );
list( $xff_ip, $isSquidOnly ) = self::getClientIPfromXFF( $xff );
// Get agent
$agent = $wgRequest->getHeader( 'User-Agent' );
$dbw = wfGetDB( DB_MASTER );
$cuc_id = $dbw->nextSequenceValue( 'cu_changes_cu_id_seq' );
$rcRow = array(
'cuc_id' => $cuc_id,
'cuc_namespace' => NS_USER,
'cuc_title' => '',
'cuc_minor' => 0,
'cuc_user' => $userFrom->getId(),
'cuc_user_text' => $userFrom->getName(),
'cuc_actiontext' =>
wfMessage( 'checkuser-email-action', $hash )->inContentLanguage()->text(),
'cuc_comment' => '',
'cuc_this_oldid' => 0,
'cuc_last_oldid' => 0,
'cuc_type' => RC_LOG,
'cuc_timestamp' => $dbw->timestamp( wfTimestampNow() ),
'cuc_ip' => IP::sanitizeIP( $ip ),
'cuc_ip_hex' => $ip ? IP::toHex( $ip ) : null,
'cuc_xff' => !$isSquidOnly ? $xff : '',
'cuc_xff_hex' => ( $xff_ip && !$isSquidOnly ) ? IP::toHex( $xff_ip ) : null,
'cuc_agent' => $agent
);
if ( trim( $wgCUPublicKey ) != '' ) {
$privateData = $userTo->getEmail() . ":" . $userTo->getId();
$encryptedData = new CheckUserEncryptedData( $privateData, $wgCUPublicKey );
$rcRow = array_merge( $rcRow, array( 'cuc_private' => serialize( $encryptedData ) ) );
}
$dbw->insert( 'cu_changes', $rcRow, __METHOD__ );
return true;
}
/**
* Hook function to store registration and autocreation data
* Saves user data into the cu_changes table
*
* @param User $user
* @param boolean $autocreated
* @return true
*/
public static function onLocalUserCreated( User $user, $autocreated ) {
return self::logUserAccountCreation(
$user,
$autocreated ? 'checkuser-autocreate-action' : 'checkuser-create-action'
);
}
/**
* @param $user User
* @param $actiontext string
* @return bool
*/
protected static function logUserAccountCreation( User $user, $actiontext ) {
global $wgRequest;
// Get IP
$ip = $wgRequest->getIP();
// Get XFF header
$xff = $wgRequest->getHeader( 'X-Forwarded-For' );
list( $xff_ip, $isSquidOnly ) = self::getClientIPfromXFF( $xff );
// Get agent
$agent = $wgRequest->getHeader( 'User-Agent' );
$dbw = wfGetDB( DB_MASTER );
$cuc_id = $dbw->nextSequenceValue( 'cu_changes_cu_id_seq' );
$rcRow = array(
'cuc_id' => $cuc_id,
'cuc_page_id' => 0,
'cuc_namespace' => NS_USER,
'cuc_title' => '',
'cuc_minor' => 0,
'cuc_user' => $user->getId(),
'cuc_user_text' => $user->getName(),
'cuc_actiontext' => wfMessage( $actiontext )->inContentLanguage()->text(),
'cuc_comment' => '',
'cuc_this_oldid' => 0,
'cuc_last_oldid' => 0,
'cuc_type' => RC_LOG,
'cuc_timestamp' => $dbw->timestamp( wfTimestampNow() ),
'cuc_ip' => IP::sanitizeIP( $ip ),
'cuc_ip_hex' => $ip ? IP::toHex( $ip ) : null,
'cuc_xff' => !$isSquidOnly ? $xff : '',
'cuc_xff_hex' => ( $xff_ip && !$isSquidOnly ) ? IP::toHex( $xff_ip ) : null,
'cuc_agent' => $agent
);
$dbw->insert( 'cu_changes', $rcRow, __METHOD__ );
return true;
}
/**
* Hook function to prune data from the cu_changes table
*/
public static function maybePruneIPData() {
# Every 50th edit, prune the checkuser changes table.
if ( 0 == mt_rand( 0, 49 ) ) {
$fname = __METHOD__;
DeferredUpdates::addCallableUpdate( function() use ( $fname ) {
global $wgCUDMaxAge;
$dbw = wfGetDB( DB_MASTER );
$encCutoff = $dbw->addQuotes( $dbw->timestamp( time() - $wgCUDMaxAge ) );
$ids = $dbw->selectFieldValues( 'cu_changes',
'cuc_id',
array( "cuc_timestamp < $encCutoff" ),
$fname,
array( 'LIMIT' => 500 )
);
if ( $ids ) {
$dbw->delete( 'cu_changes', array( 'cuc_id' => $ids ), $fname );
}
} );
}
return true;
}
/**
* Locates the client IP within a given XFF string.
* Unlike the XFF checking to determine a user IP in WebRequest,
* this simply follows the chain and does not account for server trust.
*
* This returns an array containing:
* - The best guess of the client IP
* - Whether all the proxies are just squid/varnish
*
* @param string $xff XFF header value
* @return array (string|null, bool)
* @TODO: move this to a utility class
*/
public static function getClientIPfromXFF( $xff ) {
global $wgUsePrivateIPs;
if ( !strlen( $xff ) ) {
return array( null, false );
}
# Get the list in the form of <PROXY N, ... PROXY 1, CLIENT>
$ipchain = array_map( 'trim', explode( ',', $xff ) );
$ipchain = array_reverse( $ipchain );
$client = null; // best guess of the client IP
$isSquidOnly = false; // all proxy servers where site Squid/Varnish servers?
# Step through XFF list and find the last address in the list which is a
# sensible proxy server. Set $ip to the IP address given by that proxy server,
# unless the address is not sensible (e.g. private). However, prefer private
# IP addresses over proxy servers controlled by this site (more sensible).
foreach ( $ipchain as $i => $curIP ) {
$curIP = IP::canonicalize( $curIP );
if ( $curIP === null ) {
break; // not a valid IP address
}
$curIsSquid = IP::isConfiguredProxy( $curIP );
if ( $client === null ) {
$client = $curIP;
$isSquidOnly = $curIsSquid;
}
if (
isset( $ipchain[$i + 1] ) &&
IP::isIPAddress( $ipchain[$i + 1] ) &&
(
IP::isPublic( $ipchain[$i + 1] ) ||
$wgUsePrivateIPs ||
$curIsSquid // bug 48919
)
) {
$client = IP::canonicalize( $ipchain[$i + 1] );
$isSquidOnly = ( $isSquidOnly && $curIsSquid );
continue;
}
break;
}
return array( $client, $isSquidOnly );
}
public static function checkUserSchemaUpdates( DatabaseUpdater $updater ) {
$base = dirname( __FILE__ );
$updater->addExtensionUpdate( array( 'CheckUserHooks::checkUserCreateTables' ) );
if ( $updater->getDB()->getType() == 'mysql' ) {
$updater->addExtensionUpdate( array( 'addIndex', 'cu_changes',
'cuc_ip_hex_time', "$base/archives/patch-cu_changes_indexes.sql", true ) );
$updater->addExtensionUpdate( array( 'addIndex', 'cu_changes',
'cuc_user_ip_time', "$base/archives/patch-cu_changes_indexes2.sql", true ) );
$updater->addExtensionField(
'cu_changes', 'cuc_private', "$base/archives/patch-cu_changes_privatedata.sql" );
} elseif ( $updater->getDB()->getType() == 'postgres' ) {
$updater->addExtensionUpdate(
array( 'addPgField', 'cu_changes', 'cuc_private', 'BYTEA' ) );
}
return true;
}
public static function checkUserCreateTables( DatabaseUpdater $updater ) {
$base = dirname( __FILE__ );
$db = $updater->getDB();
if ( $db->tableExists( 'cu_changes' ) ) {
$updater->output( "...cu_changes table already exists.\n" );
} else {
require_once "$base/install.inc";
create_cu_changes( $db );
}
if ( $db->tableExists( 'cu_log' ) ) {
$updater->output( "...cu_log table already exists.\n" );
} else {
require_once "$base/install.inc";
create_cu_log( $db );
}
}
/**
* Tell the parser test engine to create a stub cu_changes table,
* or temporary pages won't save correctly during the test run.
* @param array $tables
* @return bool
*/
public static function checkUserParserTestTables( &$tables ) {
$tables[] = 'cu_changes';
return true;
}
/**
* Add a link to Special:CheckUser and Special:CheckUserLog
* on Special:Contributions/<username> for
* privileged users.
* @param $id Integer: user ID
* @param $nt Title: user page title
* @param $links array: tool links
* @return true
*/
public static function checkUserContributionsLinks( $id, $nt, &$links ) {
global $wgUser;
if ( $wgUser->isAllowed( 'checkuser' ) ) {
$links[] = Linker::linkKnown(
SpecialPage::getTitleFor( 'CheckUser' ),
wfMessage( 'checkuser-contribs' )->escaped(),
array(),
array( 'user' => $nt->getText() )
);
}
if ( $wgUser->isAllowed( 'checkuser-log' ) ) {
$links[] = Linker::linkKnown(
SpecialPage::getTitleFor( 'CheckUserLog' ),
wfMessage( 'checkuser-contribs-log' )->escaped(),
array(),
array(
'cuSearchType' => 'target',
'cuSearch' => $nt->getText()
)
);
}
return true;
}
/**
* Retroactively autoblocks the last IP used by the user (if it is a user)
* blocked by this Block.
*
* @param Block $block
* @param array &$blockIds
* @return bool
*/
public static function doRetroactiveAutoblock( Block $block, array &$blockIds ) {
$dbr = wfGetDB( DB_SLAVE );
$user = User::newFromName( (string)$block->getTarget(), false );
if ( !$user->getId() ) {
return array(); // user in an IP?
}
$options = array( 'ORDER BY' => 'cuc_timestamp DESC' );
$options['LIMIT'] = 1; // just the last IP used
$res = $dbr->select( 'cu_changes',
array( 'cuc_ip' ),
array( 'cuc_user' => $user->getId() ),
__METHOD__ ,
$options
);
# Iterate through IPs used (this is just one or zero for now)
foreach ( $res as $row ) {
if ( $row->cuc_ip ) {
$id = $block->doAutoblock( $row->cuc_ip );
if ( $id ) $blockIds[] = $id;
}
}
return false; // autoblock handled
}
public static function onUserMergeAccountFields( array &$updateFields ) {
$updateFields[] = array( 'cu_changes', 'cuc_user', 'cuc_user_text' );
$updateFields[] = array( 'cu_log', 'cul_user', 'cul_user_text' );
$updateFields[] = array( 'cu_log', 'cul_target_id' );
return true;
}
/**
* For integration with the Renameuser extension.
*
* @param RenameuserSQL $renameUserSQL
* @return bool
*/
public static function onRenameUserSQL( RenameuserSQL $renameUserSQL ) {
$renameUserSQL->tables['cu_changes'] = array( 'cuc_user_text', 'cuc_user' );
$renameUserSQL->tables['cu_log'] = array( 'cul_user_text', 'cul_user' );
return true;
}
}

+ 0
- 53
application/w/extensions/CheckUser/CheckUser.php View File

@ -1,53 +0,0 @@
<?php
if ( function_exists( 'wfLoadExtension' ) ) {
wfLoadExtension( 'CheckUser' );
// Keep i18n globals so mergeMessageFileList.php doesn't break
$wgMessagesDirs['CheckUser'] = __DIR__ . '/i18n';
$wgExtensionMessagesFiles['CheckUserAliases'] = __DIR__ . '/CheckUser.alias.php';
/* wfWarn(
'Deprecated PHP entry point used for CheckUser extension. ' .
'Please use wfLoadExtension instead, ' .
'see https://www.mediawiki.org/wiki/Extension_registration for more details.'
); */
return;
} else {
die( 'This version of the CheckUser extension requires MediaWiki 1.25+' );
}
// Global declarations and documentation kept for IDEs and PHP documentors.
// This code is never executed.
/**
* 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.
*/
$wgCheckUserLog = '/home/wikipedia/logs/checkuser.log';
/** How long to keep CU data (in seconds)? */
$wgCUDMaxAge = 3 * 30 * 24 * 3600; // 3 months
/** Mass block limits */
$wgCheckUserMaxBlocks = 200;
/**
* Set this to true if you want to force checkusers into giving a reason for
* each check they do through Special:CheckUser.
*/
$wgCheckUserForceSummary = false;
/** Shortest CIDR limits that can be checked in any individual range check */
$wgCheckUserCIDRLimit = array(
'IPv4' => 16,
'IPv6' => 32,
);
/**
* 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
*/
$wgCUPublicKey = '';

+ 0
- 65
application/w/extensions/CheckUser/CheckUserEncryptedData.php View File

@ -1,65 +0,0 @@
<?php
class CheckUserEncryptedData {
// The data symmetrically encrypted with a random key
public $encString;
// Symmetric key, encrypted with the public key
public $envKeys;
// algorithm name, passed into openssl 'method' param. Kept as a variable here in case
// the class definition needs to change, and we have serialized objects stored.
private $algName;
// Hash of the public key, in case you've used multiple keys, and need to identify the
// correct private key
private $keyHash;
/**
* Create an EncryptedData object from
*
* @param $data Mixed: data/object to be encryted
* @param $publicKey: public key for encryption
*/
public function __construct( $data, $publicKey, $algorithmName = 'rc4' ) {
$this->keyHash = crc32( $publicKey );
$this->algName = $algorithmName;
$this->encryptData( serialize( $data ), $publicKey );
}
/**
* Decrypt the text in this object
*
* @param $privateKey String with ascii-armored block, or the return of openssl_get_privatekey
* @return String plaintext
*/
public function getPlaintext( $privateKey ) {
$result = openssl_open(
$this->encString,
$plaintextData,
$this->envKeys,
$privateKey,
$this->algName
);
if ( $result == false ) {
return false;
}
return unserialize( $plaintextData );
}
/**
* Encrypt data with a public key
*
* @param $data String
* @param $publicKey String with ascii-armored block, or the return of openssl_get_publickey
* @return String plaintext
*/
private function encryptData( $data, $publicKey ) {
openssl_seal( $data, $encryptedString, $envelopeKeys, array( $publicKey ), $this->algName );
$this->encString = $encryptedString;
$this->envKeys = $envelopeKeys[0];
}
}

+ 0
- 115
application/w/extensions/CheckUser/CheckUserLogPager.php View File

@ -1,115 +0,0 @@
<?php
class CheckUserLogPager extends ReverseChronologicalPager {
/**
* @var array $searchConds
*/
protected $searchConds;
/**
* @param IContextSource $context
* @param array $opts Should include 'queryConds', 'year', and 'month' keys
*/
public function __construct( IContextSource $context, array $conds ) {
parent::__construct( $context );
$this->searchConds = $conds['queryConds'];
// getDateCond() actually *sets* the timestamp offset..
$this->getDateCond( $conds['year'], $conds['month'] );
}
function formatRow( $row ) {
$user = Linker::userLink( $row->cul_user, $row->user_name );
if ( $row->cul_type == 'userips' || $row->cul_type == 'useredits' ) {
$target = Linker::userLink( $row->cul_target_id, $row->cul_target_text ) .
Linker::userToolLinks( $row->cul_target_id, $row->cul_target_text );
} else {
$target = $row->cul_target_text;
}
// Give grep a chance to find the usages:
// checkuser-log-entry-userips, checkuser-log-entry-ipedits,
// checkuser-log-entry-ipusers, checkuser-log-entry-ipedits-xff
// checkuser-log-entry-ipusers-xff, checkuser-log-entry-useredits
return '<li>' .
$this->msg(
'checkuser-log-entry-' . $row->cul_type,
$user,
$target,
$this->getLanguage()->timeanddate( wfTimestamp( TS_MW, $row->cul_timestamp ), true )
)->text() .
Linker::commentBlock( $row->cul_reason ) .
'</li>';
}
/**
* @return string
*/
function getStartBody() {
if ( $this->getNumRows() ) {
return '<ul>';
} else {
return '';
}
}
/**
* @return string
*/
function getEndBody() {
if ( $this->getNumRows() ) {
return '</ul>';
} else {
return '';
}
}
/**
* @return string
*/
function getEmptyBody() {
return '<p>' . $this->msg( 'checkuser-empty' )->escaped() . '</p>';
}
function getQueryInfo() {
return array(
'tables' => array( 'cu_log', 'user' ),
'fields' => $this->selectFields(),
'conds' => array_merge( $this->searchConds, array( 'user_id = cul_user' ) )
);
}
function getIndexField() {
return 'cul_timestamp';
}
function selectFields() {
return array(
'cul_id', 'cul_timestamp', 'cul_user', 'cul_reason', 'cul_type',
'cul_target_id', 'cul_target_text', 'user_name'
);
}
/**
* Do a batch query for links' existence and add it to LinkCache
*
* @param ResultWrapper $result
*/
protected function preprocessResults( $result ) {
if ( $this->getNumRows() === 0 ) {
return;
}
$lb = new LinkBatch;
$lb->setCaller( __METHOD__ );
foreach ( $result as $row ) {
$lb->add( NS_USER, $row->user_name ); // Performer
if ( $row->cul_type == 'userips' || $row->cul_type == 'useredits' ) {
$lb->add( NS_USER, $row->cul_target_text );
$lb->add( NS_USER_TALK, $row->cul_target_text );
}
}
$lb->execute();
$result->seek( 0 );
}
}

+ 0
- 39
application/w/extensions/CheckUser/Gruntfile.js View File

@ -1,39 +0,0 @@
/*!
* Grunt file
*
* @package CheckUser
*/
/*jshint node:true */
module.exports = function ( grunt ) {
var conf = grunt.file.readJSON( 'extension.json' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-jscs' );
grunt.initConfig( {
jshint: {
options: {
jshintrc: true
},
all: [
'*.js'
]
},
jscs: {
src: '<%= jshint.all %>'
},
banana: conf.MessagesDirs,
jsonlint: {
all: [
'*.json',
'**/*.json',
'!node_modules/**'
]
}
} );
grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana' ] );
grunt.registerTask( 'default', 'test' );
};

+ 0
- 259
application/w/extensions/CheckUser/api/ApiQueryCheckUser.php View File

@ -1,259 +0,0 @@
<?php
/**
* CheckUser API Query Module
*/
class ApiQueryCheckUser extends ApiQueryBase {
public function __construct( $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'cu' );
}
public function execute() {
global $wgCheckUserForceSummary;
$db = $this->getDB( DB_SLAVE );
$params = $this->extractRequestParams();
list( $request, $target, $reason, $timecond, $limit, $xff ) = array(
$params['request'], $params['target'], $params['reason'],
$params['timecond'], $params['limit'], $params['xff'] );
if ( !$this->getUser()->isAllowed( 'checkuser' ) ) {
$this->dieUsage( 'You need the checkuser right', 'permissionerror' );
}
if ( $wgCheckUserForceSummary && is_null( $reason ) ) {
$this->dieUsage( 'You must define reason for check', 'missingdata' );
}
$reason = $this->msg( 'checkuser-reason-api', $reason )->inContentLanguage()->text();
$timeCutoff = strtotime( $timecond ); // absolute time
if ( !$timeCutoff ) {
$this->dieUsage( 'You need use correct time limit (like "-2 weeks" or "2 weeks ago")', 'invalidtime' );
}
$this->addTables( 'cu_changes' );
$this->addOption( 'LIMIT', $limit + 1 );
$this->addOption( 'ORDER BY', 'cuc_timestamp DESC' );
$this->addWhere( "cuc_timestamp > " . $db->addQuotes( $db->timestamp( $timeCutoff ) ) );
switch ( $request ) {
case 'userips':
$user_id = User::idFromName( $target );
if ( !$user_id ) {
$this->dieUsage( 'Target user does not exist', 'nosuchuser' );
}
$this->addFields( array( 'cuc_timestamp', 'cuc_ip', 'cuc_xff' ) );
$this->addWhereFld( 'cuc_user_text', $target );
$res = $this->select( __METHOD__ );
$result = $this->getResult();
$ips = array();
foreach ( $res as $row ) {
$timestamp = wfTimestamp( TS_ISO_8601, $row->cuc_timestamp );
$ip = strval( $row->cuc_ip );
if ( !isset( $ips[$ip] ) ) {
$ips[$ip]['end'] = $timestamp;
$ips[$ip]['editcount'] = 1;
} else {
$ips[$ip]['start'] = $timestamp;
$ips[$ip]['editcount']++;
}
}