Added attach pubkey checkbox in compose UI, added preferences setting for attach pubkey by default
| | |
| | | // Enable encrypting all messages by default |
| | | $config['enigma_encrypt_all'] = false; |
| | | |
| | | // Enable signing all messages by default |
| | | $config['enigma_attach_pubkey'] = false; |
| | | |
| | | // Default for how long to store private key passwords (in minutes). |
| | | // When set to 0 passwords will be stored for the whole session. |
| | | $config['enigma_password_time'] = 5; |
| | |
| | | ); |
| | | } |
| | | |
| | | if (!isset($no_override['enigma_attach_pubkey'])) { |
| | | if (!$p['current']) { |
| | | $p['blocks']['main']['content'] = true; |
| | | return $p; |
| | | } |
| | | |
| | | $field_id = 'rcmfd_enigma_attach_pubkey'; |
| | | $input = new html_checkbox(array( |
| | | 'name' => '_enigma_attach_pubkey', |
| | | 'id' => $field_id, |
| | | 'value' => 1, |
| | | )); |
| | | |
| | | $p['blocks']['main']['options']['enigma_encrypt_all'] = array( |
| | | 'title' => html::label($field_id, $this->gettext('attachpubkeydefault')), |
| | | 'content' => $input->show($this->rc->config->get('enigma_attach_pubkey') ? 1 : 0), |
| | | ); |
| | | } |
| | | |
| | | if (!isset($no_override['enigma_password_time'])) { |
| | | if (!$p['current']) { |
| | | $p['blocks']['main']['content'] = true; |
| | |
| | | 'enigma_encryption' => (bool) rcube_utils::get_input_value('_enigma_encryption', rcube_utils::INPUT_POST), |
| | | 'enigma_sign_all' => (bool) rcube_utils::get_input_value('_enigma_sign_all', rcube_utils::INPUT_POST), |
| | | 'enigma_encrypt_all' => (bool) rcube_utils::get_input_value('_enigma_encrypt_all', rcube_utils::INPUT_POST), |
| | | 'enigma_attach_pubkey' => (bool) rcube_utils::get_input_value('_enigma_attach_pubkey', rcube_utils::INPUT_POST), |
| | | 'enigma_password_time' => intval(rcube_utils::get_input_value('_enigma_password_time', rcube_utils::INPUT_POST)), |
| | | ); |
| | | } |
| | |
| | | $menu->add(null, $chbox->show($this->rc->config->get('enigma_encrypt_all') ? 1 : 0, |
| | | array('name' => '_enigma_encrypt', 'id' => 'enigmaencryptopt'))); |
| | | |
| | | $menu->add(null, html::label(array('for' => 'enigmaattachpubkeyopt'), |
| | | rcube::Q($this->enigma->gettext('attachpubkeymsg')))); |
| | | $menu->add(null, $chbox->show($this->rc->config->get('enigma_attach_pubkey') ? 1 : 0, |
| | | array('name' => '_enigma_attachpubkey', 'id' => 'enigmaattachpubkeyopt'))); |
| | | |
| | | $menu = html::div(array('id' => 'enigmamenu', 'class' => 'popupmenu'), $menu->show()); |
| | | |
| | | // Options menu contents |
| | |
| | | $labels['supportdecryption'] = 'Enable message decryption'; |
| | | $labels['signdefault'] = 'Sign all messages by default'; |
| | | $labels['encryptdefault'] = 'Encrypt all messages by default'; |
| | | $labels['attachpubkeydefault'] = 'Attach my public PGP key by default'; |
| | | $labels['passwordtime'] = 'Keep private key passwords for'; |
| | | $labels['nminutes'] = '$m minute(s)'; |
| | | $labels['wholesession'] = 'the whole session'; |
| | |
| | | $labels['enterkeypasstitle'] = 'Enter key passphrase'; |
| | | $labels['enterkeypass'] = 'A passphrase is needed to unlock the secret key ($keyid) for user: $user.'; |
| | | $labels['arialabelkeyexportoptions'] = 'Keys export options'; |
| | | $labels['attachpubkeymsg'] = 'Attach my public key'; |
| | | |
| | | $messages = array(); |
| | | $messages['sigvalid'] = 'Verified signature from $sender.'; |