Tim
Tim

Reputation: 20360

In MediaWiki installation - How can I set email confirmation to be true for existing users and default the value for new users to true?

We have a closed wiki - and we want to set all existing users accounts to be confirmed. (when the user was added the email was added)

We also want to have that setting automatically set to true for new users.

What I want to do:

(I realize this may not be desirable however, it is a closed system and the emails have already been vetted/verified)

How can I achieve this?

EDIT: I tried using the ImportUsers plugin - with the 'emailconfirmed' user group populated - but that did not work as I had hoped. It did work for other group names.

Is there a way I can get to the database directly?

Upvotes: 3

Views: 552

Answers (2)

Carolus
Carolus

Reputation: 570

It might help to also ask yourself - why do you need them confirmed?

I was in a similar situation and the answer for me was to remove this line from the server's LocalSettings.php:

$wgEmailConfirmToEdit = true;

Now my users don't have a reason to confirm their emails.

Upvotes: 0

Stephan Muller
Stephan Muller

Reputation: 27600

To confirm all currently unconfirmed users you could run this query against the database:

UPDATE `mw_user` 
SET `user_email_authenticated`= DATE_FORMAT(NOW(),'%Y%m%d%H%i%s') 
WHERE `user_email_authenticated` IS null

The information to access your database should already be present in your LocalSettings.php file, you can access the database using the credentials saved there with a tool like Navicat or MySQL Query Browser

However, there seems to be no simple way already present in MediaWiki to automatically set newly registered users to confirmed.

There are some plugins that hook into the code when a new user is registered, so technically it would be possible to write an extension that does exactly what you want. Or you could run this query manually when you register a user.

Upvotes: 1

Related Questions