Topic on Extension talk:ConfirmAccount

ConfirmAccount doesn't work with MW 1.33 and 1.34 [Solved]

2
Summary by Spas.Z.Spasov

The main troublemaker was the parameter $wgCaptchaClass = 'SimpleCaptcha';, which I was set according to Extension:ConfirmEdit's setup. Read my last replay below for more details.

Spas.Z.Spasov (talkcontribs)

Hello, last month I've updated to MW 1.33, since then the Extension:ConfirmAccount doesn't work.

  1. *Request account* is not displayed within the users interface while $wgGroupPermissions['*']['read'] = false;, no matter the other settings.
  1. Specal:RequestAccount returns HTTP ERROR 500 (actually I'm using bulgarian language and the name of the page is Специални:RequestAccount).

Im using the extension since MW 1.27, here is the relevant part of my `LocalSettings.php` (that serves well befotre MW 1.33 update):

require_once "$IP/extensions/ConfirmAccount/ConfirmAccount.php";
$wgConfirmAccountContact = 'my@e.mail';

$wgWhitelistRead[] = 'Начална_страница';
$wgWhitelistRead[] = 'Special:RequestAccount';
$wgWhitelistRead[] = 'Специални:RequestAccount';

// $wgConfirmAccountRequestFormItems['Biography']['enabled'] = false;
// $wgConfirmAccountRequestFormItems['Biography']['minWords'] = 5;
// $wgGroupPermissions['sysop']['createaccount'] = false;


$wgMakeUserPageFromBio = false;
$wgAutoWelcomeNewUsers = false;
$wgConfirmAccountRequestFormItems = array(
        'UserName'        => array( 'enabled' => true ),
        'RealName'        => array( 'enabled' => false ),
        'Biography'       => array( 'enabled' => false, 'minWords' => 5 ),
        'AreasOfInterest' => array( 'enabled' => false ),
        'CV'              => array( 'enabled' => false ),
        'Notes'           => array( 'enabled' => true, ),
        'Links'           => array( 'enabled' => false ),
        'TermsOfService'  => array( 'enabled' => false ),
);

// Add properly "Request Accaunt" ("Заявка за смерка") link in the user's interface
$wgHooks['PersonalUrls'][] = 'onPersonalUrls';
function onPersonalUrls( array &$personal_urls, Title $title, SkinTemplate $skin  ) {
    // Add a link to Special:RequestAccount if a link exists for login
    if ( isset( $personal_urls['login'] ) || isset( $personal_urls['anonlogin'] ) ) {
        $personal_urls['createaccount'] = array(
            'text' => wfMessage( 'requestaccount' )->text(),
            'href' => SpecialPage::getTitleFor( 'RequestAccount' )->getFullURL()
        );
    }
    return true;
}

Is there some solution?

Spas.Z.Spasov (talkcontribs)

Finally I managed to solve my issue.

The main troublemaker was the parameter $wgCaptchaClass = 'SimpleCaptcha';, which I was set according to Extension:ConfirmEdit's setup. I switched to wfLoadExtension( 'ConfirmEdit/MathCaptcha' ); and now Extension:ConfirmAccount works properly.

Another issue was the condition:

if ( isset( $personal_urls['login'] ) || isset( $personal_urls['anonlogin'] ) ) { ... }

Here is my current setup that works as it is expected with MW 1.33 and 1.34:

## Extension:ConfirmAccount -----
require_once "$IP/extensions/ConfirmAccount/ConfirmAccount.php";

$wgWhitelistRead = array_merge($wgWhitelistRead, array('Специални:Създаване_на_сметка', 'Special:RequestAccount', 'Специални:RequestAccount'));

$wgMakeUserPageFromBio = false;
$wgAutoWelcomeNewUsers = false;

$wgConfirmAccountRequestFormItems = array(
	'UserName'        => array( 'enabled' => true ),
	'RealName'        => array( 'enabled' => false ),
	'Biography'       => array( 'enabled' => false, 'minWords' => 5 ),
	'AreasOfInterest' => array( 'enabled' => false ),
	'CV'              => array( 'enabled' => false ),
	'Notes'           => array( 'enabled' => true, ),
	'Links'           => array( 'enabled' => false ),
	'TermsOfService'  => array( 'enabled' => false ),
);
// $wgConfirmAccountRequestFormItems['Biography']['enabled'] = false;
// $wgConfirmAccountRequestFormItems['Biography']['minWords'] = 5;
// $wgGroupPermissions['sysop']['createaccount'] = false;

$wgConfirmAccountContact = 'admin@trivictoria.org';

$wgHooks['PersonalUrls'][] = 'ConfirmAccountCustomHooks::onPersonalUrls';
class ConfirmAccountCustomHooks {
	public static function onPersonalUrls( array &$personal_urls, Title $title, SkinTemplate $skin ) {
	    if (isset($personal_urls['login-private']['text'])) {
		    $personal_urls['createaccount'] = array(
					'text' => wfMessage( 'requestaccount' )->text(),
					'href' => SpecialPage::getTitleFor( 'RequestAccount' )->getFullURL()
			);
	    }
		return true;
	}
}


## Extension:ConfirmEdit -----
//wfLoadExtension( 'ConfirmEdit' );
//$wgCaptchaClass = 'SimpleCaptcha';

//wfLoadExtensions([ 'ConfirmEdit', 'ConfirmEdit/FancyCaptcha' ]);
//$wgCaptchaClass = 'FancyCaptcha';

wfLoadExtension( 'ConfirmEdit/MathCaptcha' );