@ -624,6 +624,12 @@ class enigma_ui
*/
*/
private function key_generate()
private function key_generate()
{
{
// Crypt_GPG does not support key generation for multiple identities
// It is also very slow (which is problematic because it may exceed
// request time limit) and requires entropy generator
// That's why we use only OpenPGP.js method of key generation
return;
$user = rcube_utils::get_input_value('_user', rcube_utils::INPUT_POST, true);
$user = rcube_utils::get_input_value('_user', rcube_utils::INPUT_POST, true);
$pass = rcube_utils::get_input_value('_password', rcube_utils::INPUT_POST, true);
$pass = rcube_utils::get_input_value('_password', rcube_utils::INPUT_POST, true);
$size = (int) rcube_utils::get_input_value('_size', rcube_utils::INPUT_POST);
$size = (int) rcube_utils::get_input_value('_size', rcube_utils::INPUT_POST);
@ -669,8 +675,6 @@ class enigma_ui
'keyform' => array($this, 'tpl_key_create_form'),
'keyform' => array($this, 'tpl_key_create_form'),
));
));
$this->rc->output->set_env('enigma_keygen_server', $this->rc->config->get('enigma_keygen_server'));
$this->rc->output->set_pagetitle($this->enigma->gettext('keygenerate'));
$this->rc->output->set_pagetitle($this->enigma->gettext('keygenerate'));
$this->rc->output->send('enigma.keycreate');
$this->rc->output->send('enigma.keycreate');
}
}
@ -685,16 +689,14 @@ class enigma_ui
// get user's identities
// get user's identities
$identities = $this->rc->user->list_identities(null, true);
$identities = $this->rc->user->list_identities(null, true);
$checkbox = new html_checkbox(array('name' => 'identity[]'));
// Identity
$select = new html_select(array('name' => 'identity', 'id' => 'key-ident'));
foreach ((array) $identities as $idx => $ident) {
foreach ((array) $identities as $idx => $ident) {
$name = empty($ident['name']) ? ('< ' . $ident['email'] . '>' ) : $ident['ident'];
$name = empty($ident['name']) ? ($ident['email']) : $ident['ident'];
$select->add($name, $idx );
$identities[$idx] = html::label(null, $checkbox->show($name, array('value' => $name)) . rcube::Q($name) );
}
}
$table->add('title', html::label('key-name', rcube::Q($this->enigma->gettext('newkeyident'))));
$table->add('title', html::label('key-name', rcube::Q($this->enigma->gettext('newkeyident'))));
$table->add(null, $select->show(0 ));
$table->add(null, implode($identities, "\n" ));
// Key size
// Key size
$select = new html_select(array('name' => 'size', 'id' => 'key-size'));
$select = new html_select(array('name' => 'size', 'id' => 'key-size'));
@ -715,7 +717,7 @@ class enigma_ui
$this->rc->output->add_gui_object('keyform', $attrib['id']);
$this->rc->output->add_gui_object('keyform', $attrib['id']);
$this->rc->output->add_label('enigma.keygenerating', 'enigma.formerror',
$this->rc->output->add_label('enigma.keygenerating', 'enigma.formerror',
'enigma.passwordsdiffer', 'enigma.keygenerateerror', 'enigma.noname ident',
'enigma.passwordsdiffer', 'enigma.keygenerateerror', 'enigma.noidentselected ',
'enigma.keygennosupport');
'enigma.keygennosupport');
return $this->rc->output->form_tag(array(), $table->show($attrib));
return $this->rc->output->form_tag(array(), $table->show($attrib));