0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 11:12:15 +02:00

Add Alert() about illegal character in username

This commit is contained in:
Fredrik Boström 2023-09-26 15:27:24 +02:00
parent 7b8532b2b0
commit ea121c721b
No known key found for this signature in database
37 changed files with 77 additions and 2 deletions

View File

@ -441,6 +441,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Illegal character';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -440,6 +440,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Caràcter il·legal';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -440,6 +440,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = '非法性质';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -454,6 +454,8 @@ $PALANG['password_expiration_desc'] = 'Datum expirace hesla';
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Nelegální charakter';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -454,6 +454,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Ulovlig figur';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -452,6 +452,8 @@ $PALANG['password_expiration_desc'] = 'Datum, an dem das Passwort abläuft';
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Illegaler Charakter';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -457,7 +457,7 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire';
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX
$PALANG['pLegal_char_warning'] = 'Illegal character';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */

View File

@ -442,6 +442,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Carácter ilegal';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -444,6 +444,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Illegal character';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -439,6 +439,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Illegal character';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -440,6 +440,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Laitonta luonnetta';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -445,6 +445,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Illegal character';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -445,6 +445,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Caractère illégal';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -440,6 +440,8 @@ $PALANG['password_expiration_desc'] = 'Data na que expirará o contrasinal'; # X
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Illegal character';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -439,6 +439,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Illegal character';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -453,6 +453,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Illegális karakter';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -440,6 +440,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Illegal character';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -441,6 +441,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Carattere illegale';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -451,6 +451,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = '違法な性格';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -446,6 +446,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Illegal character';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -441,6 +441,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Illegal character';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -441,6 +441,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Illegal character';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -444,6 +444,8 @@ $PALANG['password_expiration_desc'] = 'Aantal dagen waarnaar het wachtwo
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX
$PALANG['To_Forward_Only'] = 'Alleen Doorsturen'; # XXX
$PALANG['pLegal_char_warning'] = 'Illegaal karakter';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -440,6 +440,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Illegal character';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -446,6 +446,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Nielegalny charakter';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -453,6 +453,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Característica ilegítima';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -453,6 +453,8 @@ $PALANG['password_expiration_desc'] = 'Data de quando a password irá expirar';
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Característica ilegítima';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -452,6 +452,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Illegal character';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -454,6 +454,8 @@ $PALANG['password_expiration_desc'] = 'Дата истечения срока д
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Незаконный характер';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -441,6 +441,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Nelegálne charakter';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -440,6 +440,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Illegal character';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -453,6 +453,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Olaglig karaktär';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -440,6 +440,8 @@ $PALANG['password_expiration_desc'] = 'Şifrenin geçerlilik süresinin doluş t
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Yasadışı karakter';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -442,6 +442,8 @@ $PALANG['password_expiration_desc'] = 'Date when password will expire'; # XXX
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = '非法性质';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -455,6 +455,8 @@ $PALANG['password_expiration_desc'] = 'Кількість днів дії пар
$PALANG['To_Mailbox'] = 'Mailbox'; # XXX # XXX
$PALANG['To_Forward_Only'] = 'Forward Only'; # XXX # XXX
$PALANG['pLegal_char_warning'] = 'Нелегальний характер';
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>

View File

@ -31,7 +31,7 @@ class MailboxHandler extends PFAHandler
# editing? form list
'username' => pacol($this->new, 1, 1, 'mail', 'pEdit_mailbox_username' , '' , '' ),
'local_part' => pacol($this->new, 0, 0, 'text', 'pEdit_mailbox_username' , '' , '',
/*options*/ array('legal_chars' => Config::read('username_legal_chars'))
/*options*/ array('legal_chars' => Config::read('username_legal_chars'), 'legal_char_warning' => Config::lang('pLegal_char_warning'))
),
'domain' => pacol($this->new, 0, 1, 'enum', '' , '' , '',
/*options*/ $this->allowed_domains ),

View File

@ -120,12 +120,19 @@
}
{if $struct.local_part.options.legal_chars }
// If set: Check for illegal characters in local part of username
// decode htmlentities
var div = document.createElement('div');
div.innerHTML = "{$struct.local_part.options.legal_char_warning}";
var decoded = div.firstChild.nodeValue;
const local_part = document.getElementsByName("value[local_part]");
local_part[0].tabIndex = -1
local_part[0].addEventListener("keydown", function(event){
var regex = new RegExp("{$struct.local_part.options.legal_chars}");
if (!regex.test(event.key)) {
event.preventDefault();
alert(decoded + ": " + event.key);
return false;
}
});