Aleksander Machniak
2016-03-30 007c9ddcb0c49733522688c4d2364d1a4ab9ec8e
plugins/enigma/lib/enigma_ui.php
@@ -459,6 +459,8 @@
     */
    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);
@@ -780,12 +782,18 @@
                        $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';
@@ -817,8 +825,9 @@
                    $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';
@@ -946,16 +955,16 @@
                $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');
        }