Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passwords : show password security requirements on password change page #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions ispconfig3_pass/ispconfig3_pass.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,26 @@ function gen_form()
$table->add('', $input_confpasswd->show());

$out .= $table->show();
$out .= '<p>' . $this->gettext('passwordrequirements') . '</p>' . "\n";

$pwl = $this->rcmail_inst->config->get('password_min_length');
$checkUpper = $this->rcmail_inst->config->get('password_check_upper');
$checkLower = $this->rcmail_inst->config->get('password_check_lower');
$checkSymbol = $this->rcmail_inst->config->get('password_check_symbol');
$checkNumber = $this->rcmail_inst->config->get('password_check_number');

$out .= '<ul>';
$out .= '<li>' . str_replace("%d", $pwl, $this->gettext('passwordminlength')) . '</li>';
if($checkUpper)
$out .= '<li>' . $this->gettext('passwordchecknumber') . '</li>';
if($checkLower)
$out .= '<li>' . $this->gettext('passwordchecklower') . '</li>';
if($checkSymbol)
$out .= '<li>' . $this->gettext('passwordcheckupper') . '</li>';
if($checkNumber)
$out .= '<li>' . $this->gettext('passwordchecksymbol') . '</li>';
$out .= '</ul>';

$out .= "</fieldset>\n";

return $out;
Expand Down
4 changes: 3 additions & 1 deletion ispconfig3_pass/localization/en_US.inc
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ $messages['nopassword'] = 'Please input new password.';
$messages['nocurpassword'] = 'Please input current password.';
$messages['passwordincorrect'] = 'Current password is incorrect.';
$messages['passwordinconsistency'] = 'Inconsistency of password, please try again.';
$messages['passwordminlength'] = 'Password is too short: %d digits required.';
$messages['passwordminlength'] = 'Password must have at least %d caracters';
$messages['passwordchecknumber'] = 'Password must include at least one number.';
$messages['passwordchecklower'] = 'Password must include at least one lower case letter.';
$messages['passwordcheckupper'] = 'Password must include at least one upper case letter.';
$messages['passwordchecksymbol'] = 'Password must include at least one symbol.';

$messages['passwordrequirements'] = 'Requirements : ';
?>
8 changes: 7 additions & 1 deletion ispconfig3_pass/localization/fr_FR.inc
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@ $messages['nopassword'] = 'Merci de saisir le nouveau mot de passe.';
$messages['nocurpassword'] = 'Merci de saisir votre mot de passe actuel.';
$messages['passwordincorrect'] = 'Le mot de passe actuel est incorrect.';
$messages['passwordinconsistency'] = 'Les mots de passe ne sont pas identiques, veuillez réessayer';
$messages['passwordminlength'] = 'Le mot de passe est trop court: %d caractères requis.';
$messages['passwordminlength'] = 'Le mot de passe doit contenir au moins %d caractères.';
$messages['passwordchecknumber'] = 'Le mot de passe doit inclure au moins un nombre.';
$messages['passwordchecklower'] = 'Le mot de passe doit inclure au moins une minuscule.';
$messages['passwordcheckupper'] = 'Le mot de passe doit inclure au moins une majuscule';
$messages['passwordchecksymbol'] = 'Le mot de passe doit inclure au moins un caractère spécial (?,!,$,-,etc).';

$messages['passwordrequirements'] = 'Contraintes : ';
?>