Skip to content

Commit c99650a

Browse files
author
Marius Cramer
committed
Added check for ascii characters in password (if enabled in system config)
1 parent 0bfbaaf commit c99650a

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

interface/web/mail/form/mail_user.tform.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
3939
*/
4040
global $app;
41+
$app->uses('getconf');
42+
$global_config = $app->getconf->get_global_config();
4143

4244
$form["title"] = "Mailbox";
4345
$form["description"] = "";
@@ -56,7 +58,7 @@
5658
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
5759
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
5860

59-
$form["tabs"]['mailuser'] = array (
61+
$form["tabs"]['mailuser'] = array(
6062
'title' => "Mailbox",
6163
'width' => 100,
6264
'template' => "templates/mail_user_mailbox_edit.htm",
@@ -230,6 +232,12 @@
230232
)
231233
);
232234

235+
if($global_config['mail']['mail_password_onlyascii'] == 'y') {
236+
$form['tabs']['mailuser']['fields']['password']['validators'] = array( 0 => array( 'type' => 'ISASCII',
237+
'errmsg' => 'email_error_isascii')
238+
);
239+
}
240+
233241
$form["tabs"]['autoresponder'] = array (
234242
'title' => "Autoresponder",
235243
'width' => 100,

interface/web/mail/lib/lang/de_mail_user.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,5 @@ $wb['generate_password_txt'] = 'Passwort erzeugen';
4747
$wb['repeat_password_txt'] = 'Passwort wiederholen';
4848
$wb['password_mismatch_txt'] = 'Die Passwörter stimmen nicht überein.';
4949
$wb['password_match_txt'] = 'Die Passwörter stimmen überein.';
50+
$wb['email_error_isascii'] = 'Bitte verwenden Sie keine Umlaute im Passwort. Dies kann zu Problemen mit Ihrem E-Mail-Programm führen.';
5051
?>

interface/web/mail/lib/lang/en_mail_user.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,5 @@ $wb['generate_password_txt'] = 'Generate Password';
4747
$wb['repeat_password_txt'] = 'Repeat Password';
4848
$wb['password_mismatch_txt'] = 'The passwords do not match.';
4949
$wb['password_match_txt'] = 'The passwords do match.';
50+
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
5051
?>

0 commit comments

Comments
 (0)