Path: blob/master/src/applications/metamta/herald/PhabricatorMailMustEncryptHeraldAction.php
12256 views
<?php12final class PhabricatorMailMustEncryptHeraldAction3extends HeraldAction {45const DO_MUST_ENCRYPT = 'do.must-encrypt';67const ACTIONCONST = 'email.must-encrypt';89public function getHeraldActionName() {10return pht('Require secure email');11}1213public function renderActionDescription($value) {14return pht(15'Require mail content be transmitted only over secure channels.');16}17public function supportsObject($object) {18return PhabricatorMetaMTAEmailHeraldAction::isMailGeneratingObject($object);19}2021public function getActionGroupKey() {22return HeraldUtilityActionGroup::ACTIONGROUPKEY;23}2425public function supportsRuleType($rule_type) {26return ($rule_type != HeraldRuleTypeConfig::RULE_TYPE_PERSONAL);27}2829public function getHeraldActionStandardType() {30return self::STANDARD_NONE;31}3233public function applyEffect($object, HeraldEffect $effect) {34$rule_phid = $effect->getRule()->getPHID();3536$adapter = $this->getAdapter();37$adapter->addMustEncryptReason($rule_phid);3839$this->logEffect(self::DO_MUST_ENCRYPT, array($rule_phid));40}4142protected function getActionEffectMap() {43return array(44self::DO_MUST_ENCRYPT => array(45'icon' => 'fa-shield',46'color' => 'blue',47'name' => pht('Must Encrypt'),48),49);50}5152protected function renderActionEffectDescription($type, $data) {53switch ($type) {54case self::DO_MUST_ENCRYPT:55return pht(56'Made it a requirement that mail content be transmitted only '.57'over secure channels.');58}59}6061}626364