diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index a952d931e3..4ceddd855a 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1037,6 +1037,7 @@ phutil_register_library_map(array( 'PhabricatorPHIDConstants' => 'applications/phid/PhabricatorPHIDConstants.php', 'PhabricatorPHIDController' => 'applications/phid/controller/PhabricatorPHIDController.php', 'PhabricatorPHIDLookupController' => 'applications/phid/controller/PhabricatorPHIDLookupController.php', + 'PhabricatorPHPMailerConfigOptions' => 'applications/config/option/PhabricatorPHPMailerConfigOptions.php', 'PhabricatorPaste' => 'applications/paste/storage/PhabricatorPaste.php', 'PhabricatorPasteController' => 'applications/paste/controller/PhabricatorPasteController.php', 'PhabricatorPasteDAO' => 'applications/paste/storage/PhabricatorPasteDAO.php', @@ -2381,6 +2382,7 @@ phutil_register_library_map(array( 'PhabricatorPHDConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorPHIDController' => 'PhabricatorController', 'PhabricatorPHIDLookupController' => 'PhabricatorPHIDController', + 'PhabricatorPHPMailerConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorPaste' => array( 0 => 'PhabricatorPasteDAO', diff --git a/src/applications/config/controller/PhabricatorConfigGroupController.php b/src/applications/config/controller/PhabricatorConfigGroupController.php index e5f1cd0889..3b5c9159f5 100644 --- a/src/applications/config/controller/PhabricatorConfigGroupController.php +++ b/src/applications/config/controller/PhabricatorConfigGroupController.php @@ -72,7 +72,7 @@ final class PhabricatorConfigGroupController ->setHref('/config/edit/'.$option->getKey().'/') ->addAttribute(phutil_escape_html($option->getSummary())); - if (!$option->getHidden()) { + if (!$option->getHidden() && !$option->getMasked()) { $current_value = PhabricatorEnv::getEnvConfig($option->getKey()); $current_value = PhabricatorConfigJSON::prettyPrintJSON( $current_value); @@ -90,12 +90,12 @@ final class PhabricatorConfigGroupController $db_value = idx($db_values, $option->getKey()); if ($db_value && !$db_value->getIsDeleted()) { $item->addIcon('edit', pht('Customized')); - } else { - $item->addIcon('edit-grey', pht('Default')); } if ($option->getHidden()) { $item->addIcon('unpublish', pht('Hidden')); + } else if ($option->getMasked()) { + $item->addIcon('unpublish-grey', pht('Masked')); } else if ($option->getLocked()) { $item->addIcon('lock', pht('Locked')); } diff --git a/src/applications/config/option/PhabricatorPHPMailerConfigOptions.php b/src/applications/config/option/PhabricatorPHPMailerConfigOptions.php new file mode 100644 index 0000000000..d6ecd39844 --- /dev/null +++ b/src/applications/config/option/PhabricatorPHPMailerConfigOptions.php @@ -0,0 +1,45 @@ +newOption('phpmailer.mailer', 'string', 'smtp') + ->setSummary(pht("Configure mailer used by PHPMailer.")) + ->setDescription( + pht( + "If you're using PHPMailer to send email, provide the mailer and ". + "options here. PHPMailer is much more enormous than ". + "PHPMailerLite, and provides more mailers and greater enormity. ". + "You need it when you want to use SMTP instead of sendmail as the ". + "mailer.")), + $this->newOption('phpmailer.smtp-host', 'string', null) + ->setDescription(pht('Host for SMTP.')), + $this->newOption('phpmailer.smtp-port', 'int', 25) + ->setDescription(pht('Port for SMTP.')), + // TODO: Implement "enum"? Valid values are empty, 'tls', or 'ssl'. + $this->newOption('phpmailer.smtp-protocol', 'string', null) + ->setSummary(pht('Configure TLS or SSL for SMTP.')) + ->setDescription( + pht( + "Using PHPMailer with SMTP, you can set this to one of 'tls' or ". + "'ssl' to use TLS or SSL, respectively. Leave it blank for ". + "vanilla SMTP. If you're sending via Gmail, set it to 'ssl'.")), + $this->newOption('phpmailer.smtp-user', 'string', null) + ->setDescription(pht('Username for SMTP.')), + $this->newOption('phpmailer.smtp-password', 'string', null) + ->setMasked(true) + ->setDescription(pht('Password for SMTP.')), + ); + } + +}