public function renderConfigPropertyTransactionTitle(PhabricatorAuthProviderConfigTransaction $xaction) { $author_phid = $xaction->getAuthorPHID(); $old = $xaction->getOldValue(); $new = $xaction->getNewValue(); $key = $xaction->getMetadataValue(PhabricatorAuthProviderConfigTransaction::PROPERTY_KEY); switch ($key) { case self::KEY_REQUIRE_SECURE: if ($new) { return pht('%s turned "Require Secure Browsing" on.', $xaction->renderHandleLink($author_phid)); } else { return pht('%s turned "Require Secure Browsing" off.', $xaction->renderHandleLink($author_phid)); } } return parent::renderConfigPropertyTransactionTitle($xaction); }
public function extendEditForm(AphrontRequest $request, AphrontFormView $form, array $values, array $issues) { $is_setup = $this->isCreate(); $e_required = $request->isFormPost() ? null : true; $v_name = $values[self::PROPERTY_PHABRICATOR_NAME]; if ($is_setup) { $e_name = idx($issues, self::PROPERTY_PHABRICATOR_NAME, $e_required); } else { $e_name = null; } $v_uri = $values[self::PROPERTY_PHABRICATOR_URI]; $e_uri = idx($issues, self::PROPERTY_PHABRICATOR_URI, $e_required); if ($is_setup) { $form->appendChild(id(new AphrontFormTextControl())->setLabel(pht('Phabricator Instance Name'))->setValue($v_name)->setName(self::PROPERTY_PHABRICATOR_NAME)->setError($e_name)->setCaption(pht('Use lowercase letters, digits, and periods. For example: %s', phutil_tag('tt', array(), '`phabricator.oauthserver`')))); } else { $form->appendChild(id(new AphrontFormStaticControl())->setLabel(pht('Phabricator Instance Name'))->setValue($v_name)); } $form->appendChild(id(new AphrontFormTextControl())->setLabel(pht('Phabricator Base URI'))->setValue($v_uri)->setName(self::PROPERTY_PHABRICATOR_URI)->setCaption(pht('The URI where the OAuth server instance of Phabricator is ' . 'installed. For example: %s', phutil_tag('tt', array(), 'https://phabricator.mycompany.com/')))->setError($e_uri)); if (!$is_setup) { parent::extendEditForm($request, $form, $values, $issues); } }