Page MenuHomePhabricator

newprefs.php

Authored By
epriestley
May 29 2014, 6:17 PM
Size
838 B
Referenced Files
None
Subscribers
None

newprefs.php

<?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

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)

Event Timeline