Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P1166
emailprefs.php
Active
Public
Actions
Authored by
epriestley
on May 29 2014, 6:17 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F162031: newprefs.php
May 29 2014, 6:17 PM
2014-05-29 18:17:56 (UTC+0)
Subscribers
None
<?php
// Put this in `phabricator/` and run it as `php -f emailprefs.php`.
require_once
'scripts/__init_script__.php'
;
$user_table
=
new
PhabricatorUser
();
foreach
(
new
LiskMigrationIterator
(
$user_table
)
as
$user
)
{
$username
=
$user
->
getUsername
();
$preferences
=
$user
->
loadPreferences
();
$mail_preferences
=
$preferences
->
getPreference
(
'mailtags'
);
if
(
$mail_preferences
)
{
echo
"User {$username} already has preferences, declining to overwrite.
\n
"
;
continue
;
}
$new_mail_preference
=
array
(
MetaMTANotificationType
::
TYPE_MANIPHEST_CC
=>
false
,
MetaMTANotificationType
::
TYPE_DIFFERENTIAL_CC
=>
false
,
);
$preferences
->
setPreference
(
'mailtags'
,
$new_mail_preference
);
echo
"Updating preferences for {$username}.
\n
"
;
// Uncomment this to actually have an effect.
// $preferences->save();
}
Event Timeline
epriestley
edited the content of this paste.
(Show Details)
May 29 2014, 6:17 PM
2014-05-29 18:17:56 (UTC+0)
epriestley
changed the title of this paste from untitled to
newprefs.php
.
epriestley
updated the paste's language from
autodetect
to
autodetect
.
epriestley
changed the title of this paste from
newprefs.php
to
emailprefs.php
.
Log In to Comment