Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F162031
newprefs.php
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
epriestley
May 29 2014, 6:17 PM
2014-05-29 18:17:56 (UTC+0)
Size
838 B
Referenced Files
None
Subscribers
None
newprefs.php
View Options
<?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();
}
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/fp/mi/pyoeqwsr7lhxlagz
Default Alt Text
newprefs.php (838 B)
Attached To
Mode
P1166 emailprefs.php
Attached
Detach File
Event Timeline
Log In to Comment