mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2024-09-19 19:22:14 +02:00
Merge pull request #765 from verdigado/feature/validate-username
Javascript validation of username to prevent illegal characters
This commit is contained in:
commit
143a31d3a0
@ -251,6 +251,13 @@ $CONF['password_validation'] = array(
|
||||
// 'length_check' => function($password) { if (strlen(trim($password)) < 3) { return 'password_too_short'; } },
|
||||
);
|
||||
|
||||
// Username legal characters
|
||||
// New/changed usernames will be checked against this regular expression with javascript
|
||||
// during entry, offending characters not displaying.
|
||||
// For example:
|
||||
// $CONF['username_legal_chars'] = '^[a-zA-Z0-9-_.]+$';
|
||||
$CONF['username_legal_chars'] = '';
|
||||
|
||||
// Generate Password
|
||||
// Generate a random password for a mailbox or admin and display it.
|
||||
// If you want to automagically generate passwords set this to 'YES'.
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -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: */
|
||||
?>
|
||||
|
@ -30,7 +30,9 @@ class MailboxHandler extends PFAHandler
|
||||
# field name allow display in... type $PALANG label $PALANG description default / options / ...
|
||||
# editing? form list
|
||||
'username' => pacol($this->new, 1, 1, 'mail', 'pEdit_mailbox_username' , '' , '' ),
|
||||
'local_part' => pacol($this->new, 0, 0, 'text', 'pEdit_mailbox_username' , '' , '' ),
|
||||
'local_part' => pacol($this->new, 0, 0, 'text', 'pEdit_mailbox_username' , '' , '',
|
||||
/*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 ),
|
||||
# TODO: maildir: display in list is needed to include maildir in SQL result (for post_edit hook)
|
||||
|
@ -118,5 +118,23 @@
|
||||
|
||||
}
|
||||
}
|
||||
{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;
|
||||
}
|
||||
});
|
||||
{/if}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user