Phabricator:如何禁用登录表单的自动完成功能?

Phabricator: How to disable autocomplete on login forms?

刚刚在我们的组织中安装 'Phabricator' 并习惯了它。但是,我们的 IT 反对登录表单上的自动完成功能。

可以以人道的方式禁用它吗? (即不破坏其他任何东西)

谢谢。

您可以修改Phabricator的代码,https://secure.phabricator.com/D10253可以作为指导。

了解仅设置 autocomplete=off 不会解决某些浏览器的问题,这些浏览器会忽略开发人员的意愿(例如 Chrome 和 Firefox)。

参见 https://secure.phabricator.com/T5579 进行讨论。

答案是:

diff --git a/src/applications/auth/provider/PhabricatorPasswordAuthProvider.php b/src/applications/auth/provider/PhabricatorPasswordAuthProvider.php
index 68dbf1e..43d5932 100644
--- a/src/applications/auth/provider/PhabricatorPasswordAuthProvider.php
+++ b/src/applications/auth/provider/PhabricatorPasswordAuthProvider.php
@@ -230,11 +230,13 @@ final class PhabricatorPasswordAuthProvider extends PhabricatorAuthProvider {
       ->setLabel(pht('Username or Email'))
       ->setName('username')
       ->setValue($v_user)
+      ->setDisableAutocomplete(true)
       ->setError($e_user))
   ->appendChild(
     id(new AphrontFormPasswordControl())
       ->setLabel(pht('Password'))
       ->setName('password')
+   ->setDisableAutocomplete(true)
    ->setError($e_pass));

if ($require_captcha) {

(不过,我还是会接受@chad-little的回答)