| | |
| | | */ |
| | | private function key_export() |
| | | { |
| | | $this->rc->request_security_check(rcube_utils::INPUT_GET); |
| | | |
| | | $keys = rcube_utils::get_input_value('_keys', rcube_utils::INPUT_GPC); |
| | | $engine = $this->enigma->load_engine(); |
| | | $list = $keys == '*' ? $engine->list_keys() : explode(',', $keys); |
| | |
| | | $this->enigma->gettext('decryptnokey'))); |
| | | } |
| | | else if ($code == enigma_error::BADPASS) { |
| | | $msg = rcube::Q($this->enigma->gettext('decryptbadpass')); |
| | | $missing = $status->getData('missing'); |
| | | $label = 'decrypt' . (!empty($missing) ? 'no' : 'bad') . 'pass'; |
| | | $msg = rcube::Q($this->enigma->gettext($label)); |
| | | $this->password_prompt($status); |
| | | } |
| | | else { |
| | | $msg = rcube::Q($this->enigma->gettext('decrypterror')); |
| | | } |
| | | } |
| | | else if ($status === enigma_engine::ENCRYPTED_PARTIALLY) { |
| | | $attrib['class'] = 'enigmawarning'; |
| | | $msg = rcube::Q($this->enigma->gettext('decryptpartial')); |
| | | } |
| | | else { |
| | | $attrib['class'] = 'enigmanotice'; |
| | |
| | | $msg = rcube::Q($msg); |
| | | } |
| | | else if ($sig->valid) { |
| | | $attrib['class'] = 'enigmanotice'; |
| | | $msg = rcube::Q(str_replace('$sender', $sender, $this->enigma->gettext('sigvalid'))); |
| | | $attrib['class'] = $sig->partial ? 'enigmawarning' : 'enigmanotice'; |
| | | $label = 'sigvalid' . ($sig->partial ? 'partial' : ''); |
| | | $msg = rcube::Q(str_replace('$sender', $sender, $this->enigma->gettext($label))); |
| | | } |
| | | else { |
| | | $attrib['class'] = 'enigmawarning'; |
| | |
| | | $msg = 'enigma.' . $mode . 'nokey'; |
| | | } |
| | | else if ($code == enigma_error::BADPASS) { |
| | | $msg = 'enigma.' . $mode . 'badpass'; |
| | | $type = 'warning'; |
| | | |
| | | $this->password_prompt($status); |
| | | } |
| | | else { |
| | | $msg = 'enigma.' . $mode . 'error'; |
| | | } |
| | | |
| | | $this->rc->output->show_message($msg, $type ?: 'error', $vars); |
| | | if ($msg) { |
| | | $this->rc->output->show_message($msg, $type ?: 'error', $vars); |
| | | } |
| | | |
| | | $this->rc->output->send('iframe'); |
| | | } |
| | | |