Fix user indexing for "open" search results when email verification required
Summary:
Enforce reindexing of a user account once they verified their email address when `auth.require-email-verification` is set to true. The reindexing set `PhabricatorUser->isUserActivated()` to true (in case no account approval by admins is required), so `PhabricatorSearchRelationship::RELATIONSHIP_OPEN` is returned, and the `PhabricatorFulltextEngine` will reindex the account as "Open", so the account shows up in the results of http://phorge.localhost/search/ when entering the account name in the "Query" field and setting the "Item Status" to "Open", as expected.
Thanks to valerio.bozzolan for the additional code investigation.
Refs T16136
Test Plan:
1. Make sure all your daemons and torment is running via `./bin/phd start`
2. As an admin, set http://phorge.localhost/config/edit/auth.require-email-verification/ to `true`.
3. As an admin, set http://phorge.localhost/config/edit/auth.require-approval/ to `false` (Yes, that's needed).
4. Insert the line `phlog('Verify link for ' . $address . ': ' . $link);` at https://we.phorge.it/source/phorge/browse/master/src/applications/people/storage/PhabricatorUserEmail.php;aa2b70708e2fa962cc6552759be2e726a8591501$212 so we don't have to set up a mail server.
5. As anonymous, go to http://phorge.localhost/auth/register/, set Username `meouw`, fill in the rest, click `Register Account` button.
6. In SQL, run `SELECT f.isClosed, u.userName, u.isDisabled, u.isEmailVerified, u.isApproved FROM phabricator_user.user u INNER JOIN phabricator_user.user_user_fdocument f ON u.phid = f.objectPHID WHERE u.userName = "meouw";`. See that the account is marked as `isClosed` in the first column.
7. As anonymous, get dialog `Check Your Email: You must verify your email address to log in. You should have a new email message with verification instructions in your inbox`
8. If you performed step 3 above, check your server logs and copy the confirmation URI. Alternatively, set up a mail server.
9. As anonymous, open that confirmation URI and verify your new user account.
10. In SQL, run `SELECT f.isClosed, u.userName, u.isDisabled, u.isEmailVerified, u.isApproved FROM phabricator_user.user u INNER JOIN phabricator_user.user_user_fdocument f ON u.phid = f.objectPHID WHERE u.userName = "meouw";`. Before this patch, the account is still marked as `isClosed` in the first column though we verified the email address. After this patch, the account is not marked as `isClosed` anymore.
11. Go to http://phorge.localhost/search/, set `Query` to `meouw`, set `Document Status` to `Open`, set `Document Types` to `User`, click the `Search` button. See a result after applying this patch.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T16136
Differential Revision: https://we.phorge.it/D26553