From e79838aaaccbe14491e8a243a249f7d766bb009b Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 20 Apr 2018 08:11:22 +0200 Subject: [PATCH] Enigma: Disable autofill for new keypair password --- plugins/enigma/lib/enigma_ui.php | 18 ++++++++++++++---- program/lib/Roundcube/html.php | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/plugins/enigma/lib/enigma_ui.php b/plugins/enigma/lib/enigma_ui.php index 14b9d05b7..c0b1f2eca 100644 --- a/plugins/enigma/lib/enigma_ui.php +++ b/plugins/enigma/lib/enigma_ui.php @@ -775,12 +775,22 @@ class enigma_ui // Password and confirm password $table->add('title', html::label('key-pass', rcube::Q($this->enigma->gettext('newkeypass')))); - $table->add(null, rcube_output::get_edit_field('password', '', - array('id' => 'key-pass', 'size' => $attrib['size'], 'required' => true), 'password')); + $table->add(null, rcube_output::get_edit_field('password', '', array( + 'id' => 'key-pass', + 'size' => $attrib['size'], + 'required' => true, + 'autocomplete' => 'new-password', + 'oninput' => "this.type = this.value.length ? 'password' : 'text'", + ), 'text')); $table->add('title', html::label('key-pass-confirm', rcube::Q($this->enigma->gettext('newkeypassconfirm')))); - $table->add(null, rcube_output::get_edit_field('password-confirm', '', - array('id' => 'key-pass-confirm', 'size' => $attrib['size'], 'required' => true), 'password')); + $table->add(null, rcube_output::get_edit_field('password-confirm', '', array( + 'id' => 'key-pass-confirm', + 'size' => $attrib['size'], + 'required' => true, + 'autocomplete' => 'new-password', + 'oninput' => "this.type = this.value.length ? 'password' : 'text'", + ), 'text')); $this->rc->output->add_gui_object('keyform', $attrib['id']); $this->rc->output->add_label('enigma.keygenerating', 'enigma.formerror', diff --git a/program/lib/Roundcube/html.php b/program/lib/Roundcube/html.php index e129750cb..04a8495fa 100644 --- a/program/lib/Roundcube/html.php +++ b/program/lib/Roundcube/html.php @@ -394,7 +394,7 @@ class html_inputfield extends html 'type','name','value','size','tabindex','autocapitalize','required', 'autocomplete','checked','onchange','onclick','disabled','readonly', 'spellcheck','results','maxlength','src','multiple','accept', - 'placeholder','autofocus','pattern', + 'placeholder','autofocus','pattern','oninput' ); /**