Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F116690804
20131112.userverified.2.mig.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jun 8, 14:55
Size
704 B
Mime Type
text/x-php
Expires
Tue, Jun 10, 14:55 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
26657944
Attached To
rPH Phabricator
20131112.userverified.2.mig.php
View Options
<?php
$table
=
new
PhabricatorUser
();
$conn_w
=
$table
->
establishConnection
(
'w'
);
foreach
(
new
LiskMigrationIterator
(
$table
)
as
$user
)
{
$username
=
$user
->
getUsername
();
echo
"Migrating {$username}...
\n
"
;
if
(
$user
->
getIsEmailVerified
())
{
// Email already verified.
continue
;
}
$primary
=
$user
->
loadPrimaryEmail
();
if
(!
$primary
)
{
// No primary email.
continue
;
}
if
(!
$primary
->
getIsVerified
())
{
// Primary email not verified.
continue
;
}
// Primary email is verified, so mark the account as verified.
queryfx
(
$conn_w
,
'UPDATE %T SET isEmailVerified = 1 WHERE id = %d'
,
$table
->
getTableName
(),
$user
->
getID
());
}
echo
"Done.
\n
"
;
Event Timeline
Log In to Comment