Merge "rdbms: specify DB name and table prefix even for the local domain"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 16 Jan 2018 21:04:35 +0000 (21:04 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 16 Jan 2018 21:04:35 +0000 (21:04 +0000)
includes/DefaultSettings.php
includes/specials/SpecialEmailuser.php
includes/user/User.php
languages/i18n/en.json
languages/i18n/qqq.json
tests/phpunit/maintenance/MaintenanceTest.php
tests/selenium/README.md

index ee10a6d..ab01c5f 100644 (file)
@@ -5158,7 +5158,6 @@ $wgGroupPermissions['user']['sendemail'] = true;
 $wgGroupPermissions['user']['applychangetags'] = true;
 $wgGroupPermissions['user']['changetags'] = true;
 $wgGroupPermissions['user']['editcontentmodel'] = true;
-$wgGroupPermissions['user']['sendemail-new-users'] = true;
 
 // Implicit group for accounts that pass $wgAutoConfirmAge
 $wgGroupPermissions['autoconfirmed']['autoconfirmed'] = true;
index 06ca04f..f322ac4 100644 (file)
@@ -238,35 +238,12 @@ class SpecialEmailUser extends UnlistedSpecialPage {
                        return 'nowikiemail';
                }
 
-               if ( $target->getEditCount() === 0 &&
-                       ( $sender === null || !$sender->isAllowed( 'sendemail-new-users' ) )
-               ) {
-                       // Determine if target has any other logged actions.
-                       $dbr = wfGetDB( DB_REPLICA );
-                       $log_id = $dbr->selectField(
-                               'logging',
-                               'log_id',
-                               [
-                                       'log_user' => $target->getId(),
-                                       "NOT (log_type = 'newusers' AND log_action = 'autocreate')",
-                               ],
-                               __METHOD__,
-                               [ 'LIMIT' => 1 ]
-                       );
-
-                       if ( !$log_id ) {
-                               wfDebug( "User has no logged actions on this wiki.\n" );
-
-                               return 'nowikiemail';
-                       }
-               }
-
                if ( $sender !== null && !$target->getOption( 'email-allow-new-users' ) &&
                        $sender->isNewbie()
                ) {
-                               wfDebug( "User does not allow user emails from new users.\n" );
+                       wfDebug( "User does not allow user emails from new users.\n" );
 
-                               return 'nowikiemail';
+                       return 'nowikiemail';
                }
 
                if ( $sender !== null ) {
index a9fe5f8..7684d2e 100644 (file)
@@ -179,7 +179,6 @@ class User implements IDBAccessObject, UserIdentity {
                'reupload-shared',
                'rollback',
                'sendemail',
-               'sendemail-new-users',
                'siteadmin',
                'suppressionlog',
                'suppressredirect',
index 2b48338..42ea35c 100644 (file)
        "right-siteadmin": "Lock and unlock the database",
        "right-override-export-depth": "Export pages including linked pages up to a depth of 5",
        "right-sendemail": "Send email to other users",
-       "right-sendemail-new-users": "Send email to users with no logged actions",
        "right-managechangetags": "Create and (de)activate [[Special:Tags|tags]]",
        "right-applychangetags": "Apply [[Special:Tags|tags]] along with one's changes",
        "right-changetags": "Add and remove arbitrary [[Special:Tags|tags]] on individual revisions and log entries",
index 8f8d871..6621e72 100644 (file)
        "right-siteadmin": "{{doc-right|siteadmin}}",
        "right-override-export-depth": "{{doc-right|override-export-depth}}",
        "right-sendemail": "{{doc-right|sendemail}}",
-       "right-sendemail-new-users": "{{doc-right|sendemail-new-users}}",
        "right-managechangetags": "{{doc-right|managechangetags}}",
        "right-applychangetags": "{{doc-right|applychangetags}}",
        "right-changetags": "{{doc-right|changetags}}",
index e21e726..253327b 100644 (file)
@@ -1,29 +1,31 @@
 <?php
 
-// It would be great if we were able to use PHPUnit's getMockForAbstractClass
-// instead of the MaintenanceFixup hack below. However, we cannot do
-// without changing the visibility and without working around hacks in
-// Maintenance.php
-// For the same reason, we cannot just use FakeMaintenance.
 use MediaWiki\MediaWikiServices;
 
 /**
- * makes parts of the API of Maintenance that is hidden by protected visibily
- * visible for testing, and makes up for a stream closing hack in Maintenance.php.
+ * Makes parts of Maintenance class API visible for testing, and makes up for a
+ * stream closing hack in Maintenance.php.
  *
  * This class is solely used for being able to test Maintenance right now
  * without having to apply major refactorings to fix some design issues in
  * Maintenance.php. Before adding more functions here, please consider whether
- * this approach is correct, or a refactoring Maintenance to separate concers
+ * this approach is correct, or a refactoring Maintenance to separate concerns
  * is more appropriate.
  *
- * Upon refactoring, keep in mind that besides the maintenance scrits themselves
- * and tests right here, also at least Extension:Maintenance make use of
- * Maintenance.
+ * Upon refactoring, keep in mind that besides the maintenance scripts themselves
+ * and tests right here, some extensions including Extension:Maintenance make
+ * use of the Maintenance class.
  *
  * Due to a hack in Maintenance.php using register_shutdown_function, be sure to
- * finally call simulateShutdown on MaintenanceFixup instance before a test
- * ends.
+ * call simulateShutdown on MaintenanceFixup instance before a test ends.
+ *
+ * FIXME:
+ * It would be great if we were able to use PHPUnit's getMockForAbstractClass
+ * instead of the MaintenanceFixup hack below. However, we cannot do so
+ * without changing method visibility and without working around hacks in
+ * Maintenance.php
+ *
+ * For the same reason, we cannot just use FakeMaintenance.
  */
 class MaintenanceFixup extends Maintenance {
 
@@ -42,7 +44,7 @@ class MaintenanceFixup extends Maintenance {
        private $testCase;
 
        /**
-        * shutdownSimulated === true if simulateShutdown has done it's work
+        * shutdownSimulated === true if simulateShutdown has done its work
         *
         * @var bool
         */
index 6fad6fe..1628377 100644 (file)
@@ -23,9 +23,7 @@ Set up MediaWiki-Vagrant:
 
 To run only one file (for example page.js), you first need to spawn the chromedriver:
 
-    chromedriver --url-base=/wd/hub --port=4444
-
-Note: On Windows you may need to use "--url-base=wd/hub"
+    chromedriver --url-base=wd/hub --port=4444
 
 Then in another terminal: