diff --git a/plugins/kolab_2fa/kolab2fa.js b/plugins/kolab_2fa/kolab2fa.js
index bb92359a..9114a3f3 100644
--- a/plugins/kolab_2fa/kolab2fa.js
+++ b/plugins/kolab_2fa/kolab2fa.js
@@ -51,10 +51,13 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
var rows = 0;
$.each(rcmail.env.kolab_2fa_factors, function(id, props) {
if (props.active) {
- var tr = $('
').addClass(props.method).appendTo(table),
+ button = $('').attr({href: '#', rel: id})
+ .append($('').text(rcmail.get_label('remove','kolab_2fa')));
+
$('').addClass('name').text(props.label || props.name).appendTo(tr);
$(' | ').addClass('created').text(props.created || '??').appendTo(tr);
- $(' | ').addClass('actions').html('' + rcmail.get_label('remove','kolab_2fa') + '').appendTo(tr);
+ $(' | ').addClass('actions buttons-cell').append(button).appendTo(tr);
rows++;
}
});
@@ -80,13 +83,14 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
[
{
text: rcmail.gettext('save', 'kolab_2fa'),
- 'class': 'mainaction',
+ 'class': 'mainaction save',
click: function(e) {
save_data(method);
}
},
{
text: rcmail.gettext('cancel'),
+ 'class': 'cancel',
click: function() {
factor_dialog.dialog('close');
}
@@ -106,7 +110,6 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
}
}
)
- .addClass('propform')
.data('method', method)
.data('timestamp', time());
@@ -224,10 +227,11 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
highsec_dialog.find('input[name="_code"]').select();
}
},
- 'class': 'mainaction'
+ 'class': 'mainaction save'
},
{
text: rcmail.gettext('cancel'),
+ 'class': 'cancel',
click: function() {
highsec_dialog.dialog('close');
}
diff --git a/plugins/kolab_2fa/kolab_2fa.php b/plugins/kolab_2fa/kolab_2fa.php
index f1f78788..f1794588 100644
--- a/plugins/kolab_2fa/kolab_2fa.php
+++ b/plugins/kolab_2fa/kolab_2fa.php
@@ -3,8 +3,6 @@
/**
* Kolab 2-Factor-Authentication plugin
*
- * ...
- *
* @author Thomas Bruederli
*
* Copyright (C) 2015, Kolab Systems AG
@@ -252,8 +250,14 @@ class kolab_2fa extends rcube_plugin
}
$field_id = "rcmlogin2fa$method";
- $input_code = new html_inputfield(array('name' => "_${nonce}_${method}", 'class' => 'kolab2facode', 'id' => $field_id, 'required' => $required, 'autocomplete' => 'off')
- + $attrib);
+ $input_code = new html_inputfield(array(
+ 'name' => "_${nonce}_${method}",
+ 'class' => 'kolab2facode',
+ 'id' => $field_id,
+ 'required' => $required,
+ 'autocomplete' => 'off',
+ 'data-icon' => 'key' // for Elastic
+ ) + $attrib);
$table->add('title', html::label($field_id, html::quote($this->gettext($method))));
$table->add('input', $input_code->show(''));
}
@@ -266,9 +270,12 @@ class kolab_2fa extends rcube_plugin
// add submit button
if (rcube_utils::get_boolean($attrib['submit'])) {
- $submit = new html_inputfield(array('type' => 'submit', 'id' => 'rcmloginsubmit',
- 'class' => 'button mainaction', 'value' => $this->gettext('continue')));
- $out .= html::p('formbuttons', $submit->show());
+ $out .= html::p('formbuttons', html::tag('button', array(
+ 'type' => 'submit',
+ 'id' => 'rcmloginsubmit',
+ 'class' => 'button mainaction save',
+ ), $this->gettext('continue'))
+ );
}
// surround html output with a form tag
@@ -415,7 +422,9 @@ class kolab_2fa extends rcube_plugin
{
$rcmail = rcmail::get_instance();
- $select = new html_select(array('id' => 'kolab2fa-add'));
+ $attrib['id'] = 'kolab2fa-add';
+
+ $select = new html_select($attrib);
$select->add($this->gettext('addfactor') . '...', '');
foreach ((array)$rcmail->config->get('kolab_2fa_drivers', array()) as $method) {
$select->add($this->gettext($method), $method);
@@ -515,7 +524,7 @@ class kolab_2fa extends rcube_plugin
}
$explain_label = $field . 'explain' . $method;
- $explain_html = $rcmail->text_exists($explain_label, 'kolab_2fa') ? html::p('explain', $this->gettext($explain_label)) : '';
+ $explain_html = $rcmail->text_exists($explain_label, 'kolab_2fa') ? html::div('explain form-text', $this->gettext($explain_label)) : '';
$field_id = 'rcmk2fa' . $method . $field;
$table->add('title', html::label($field_id, $this->gettext($field)));
@@ -526,12 +535,8 @@ class kolab_2fa extends rcube_plugin
if (method_exists($driver, 'get_provisioning_uri')) {
$table->add('title', $this->gettext('qrcode'));
$table->add(null,
- html::p('explain',
- $this->gettext("qrcodeexplain$method")
- ) .
- html::p(null,
- html::tag('img', array('src' => 'data:image/gif;base64,R0lGODlhDwAPAIAAAMDAwAAAACH5BAEAAAAALAAAAAAPAA8AQAINhI+py+0Po5y02otnAQA7', 'class' => 'qrcode', 'rel' => $method))
- )
+ html::div('explain form-text', $this->gettext("qrcodeexplain$method"))
+ . html::tag('img', array('src' => 'data:image/gif;base64,R0lGODlhDwAPAIAAAMDAwAAAACH5BAEAAAAALAAAAAAPAA8AQAINhI+py+0Po5y02otnAQA7', 'class' => 'qrcode', 'rel' => $method))
);
// add row for testing the factor
@@ -539,7 +544,7 @@ class kolab_2fa extends rcube_plugin
$table->add('title', html::label($field_id, $this->gettext('verifycode')));
$table->add(null,
html::tag('input', array('type' => 'text', 'name' => '_verify_code', 'id' => $field_id, 'class' => 'k2fa-verify', 'size' => 20, 'required' => true)) .
- html::p('explain', $this->gettext("verifycodeexplain$method"))
+ html::div('explain form-text', $this->gettext("verifycodeexplain$method"))
);
}
@@ -549,8 +554,9 @@ class kolab_2fa extends rcube_plugin
$out .= html::tag('form', array(
'method' => 'post',
'action' => '#',
- 'id' => 'kolab2fa-prop-' . $method,
- 'style' => 'display:none',
+ 'id' => 'kolab2fa-prop-' . $method,
+ 'style' => 'display:none',
+ 'class' => 'propform',
),
html::tag('fieldset', array(),
html::tag('legend', array(), $this->gettext($method)) .
@@ -562,9 +568,9 @@ class kolab_2fa extends rcube_plugin
return $out;
}
-
+
/**
- * Render th
+ * Render the high-security-dialog content
*/
public function settings_highsecuritydialog($attrib = array())
{
@@ -572,10 +578,11 @@ class kolab_2fa extends rcube_plugin
$field_id = 'rcmk2facode';
$input = new html_inputfield(array('name' => '_code', 'id' => $field_id, 'class' => 'verifycode', 'size' => 20));
+ $label = html::label(array('for' => $field_id, 'class' => 'col-form-label col-sm-4'), '$name');
return html::div($attrib,
- html::p('explain', $this->gettext('highsecuritydialog')) .
- html::div('propform', html::label($field_id, '$name') . $input->show(''))
+ html::div('explain form-text', $this->gettext('highsecuritydialog'))
+ . html::div('propform row form-group', $label . html::div('col-sm-8', $input->show('')))
);
}
diff --git a/plugins/kolab_2fa/skins/elastic/templates/config.html b/plugins/kolab_2fa/skins/elastic/templates/config.html
new file mode 100644
index 00000000..6b76b8fc
--- /dev/null
+++ b/plugins/kolab_2fa/skins/elastic/templates/config.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
|