@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_w = $table->establishConnection('w');
5
6foreach (new LiskMigrationIterator($table) as $user) {
7 $username = $user->getUsername();
8 echo pht('Migrating %s...', $username)."\n";
9 if ($user->getIsEmailVerified()) {
10 // Email already verified.
11 continue;
12 }
13
14 $primary = $user->loadPrimaryEmail();
15 if (!$primary) {
16 // No primary email.
17 continue;
18 }
19
20 if (!$primary->getIsVerified()) {
21 // Primary email not verified.
22 continue;
23 }
24
25 // Primary email is verified, so mark the account as verified.
26 queryfx(
27 $conn_w,
28 'UPDATE %T SET isEmailVerified = 1 WHERE id = %d',
29 $table->getTableName(),
30 $user->getID());
31}
32
33echo pht('Done.')."\n";