summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonp <simon.plasger@web.de>2014-06-25 17:54:14 +0200
committersimonp <simon.plasger@web.de>2014-06-25 17:54:14 +0200
commit1c5fdd674eaf5edcbec5c06279204108a2953aff (patch)
tree89e185064922e18c54ce41a1f706dd0adcdcaf44
parentf0e4d2fd14afac5b02a159d356d1f3addb6e1107 (diff)
Show password rules before committing new password (#1488285)
-rw-r--r--plugins/password/password.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/plugins/password/password.php b/plugins/password/password.php
index ad65616d2..cdea0ab25 100644
--- a/plugins/password/password.php
+++ b/plugins/password/password.php
@@ -226,9 +226,28 @@ class password extends rcube_plugin
$table->add('title', html::label($field_id, rcube::Q($this->gettext('confpasswd'))));
$table->add(null, $input_confpasswd->show());
+ $rules = '';
+
+ $required_length = intval($rcmail->config->get('password_minimum_length'));
+ if($required_length > 0) {
+ $rules .= html::tag('li', array('id' => 'required-length'), $this->gettext(array(
+ 'name' => 'passwordshort',
+ 'vars' => array('length' => $required_length)
+ )));
+ }
+
+ if($rcmail->config->get('password_require_nonalpha')) {
+ $rules .= html::tag('li', array('id' => 'require-nonalpha'), $this->gettext('passwordweak'));
+ }
+
+ if(!empty($rules)) {
+ $rules = html::tag('ul', array('id' => 'ruleslist'), $rules);
+ }
+
$out = html::div(array('class' => 'box'),
html::div(array('id' => 'prefs-title', 'class' => 'boxtitle'), $this->gettext('changepasswd')) .
html::div(array('class' => 'boxcontent'), $table->show() .
+ $rules .
html::p(null,
$rcmail->output->button(array(
'command' => 'plugin.password-save',