$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;
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 ) {
'reupload-shared',
'rollback',
'sendemail',
- 'sendemail-new-users',
'siteadmin',
'suppressionlog',
'suppressredirect',
"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",
"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}}",
<?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 {
private $testCase;
/**
- * shutdownSimulated === true if simulateShutdown has done it's work
+ * shutdownSimulated === true if simulateShutdown has done its work
*
* @var bool
*/
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: