@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3$table = new PhabricatorUser();
4$conn = $table->establishConnection('w');
5
6foreach (new LiskMigrationIterator($table) as $user) {
7 // Ignore users who are verified.
8 if ($user->getIsEmailVerified()) {
9 continue;
10 }
11
12 // Ignore unverified users with missing (rare) or unverified (common)
13 // primary emails: it's correct that their accounts are not verified.
14 $primary = $user->loadPrimaryEmail();
15 if (!$primary) {
16 continue;
17 }
18
19 if (!$primary->getIsVerified()) {
20 continue;
21 }
22
23 queryfx(
24 $conn,
25 'UPDATE %T SET isEmailVerified = 1 WHERE id = %d',
26 $table->getTableName(),
27 $user->getID());
28
29 echo tsprintf(
30 "%s\n",
31 pht(
32 'Corrected account verification state for user "%s".',
33 $user->getUsername()));
34}