summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-01-28 22:50:22 -0800
committerIvan Kohler <ivan@freeside.biz>2013-01-28 22:50:22 -0800
commitaa97e36a3bb5c92251ab14a47c710ffecb5b26c8 (patch)
tree57fdcb8b616fb77823a5f58e36728aad671d36fe /FS
parent52380fd490b228e5b2a7cdd3a98ea5185b44a7a9 (diff)
username-exclamation, RT#18227
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Conf.pm7
-rw-r--r--FS/FS/svc_acct.pm7
2 files changed, 13 insertions, 1 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index c14600b21..9a064b6c6 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -5195,6 +5195,13 @@ and customer address. Include units.',
'type' => 'checkbox',
},
+ {
+ 'key' => 'username-exclamation',
+ 'section' => 'username',
+ 'description' => 'Allow the exclamation character (!) in usernames.',
+ 'type' => 'checkbox',
+ },
+
{
'key' => 'ie-compatibility_mode',
'section' => 'UI',
diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm
index 8e71d829d..bd71b0ba1 100644
--- a/FS/FS/svc_acct.pm
+++ b/FS/FS/svc_acct.pm
@@ -15,6 +15,7 @@ use vars qw( $DEBUG $me $conf $skip_fuzzyfiles
$username_noperiod $username_nounderscore $username_nodash
$username_uppercase $username_percent $username_colon
$username_slash $username_equals $username_pound
+ $username_exclamation
$password_noampersand $password_noexclamation
$warning_template $warning_from $warning_subject $warning_mimetype
$warning_cc
@@ -85,6 +86,7 @@ FS::UID->install_callback( sub {
$username_slash = $conf->exists('username-slash');
$username_equals = $conf->exists('username-equals');
$username_pound = $conf->exists('username-pound');
+ $username_exclamation = $conf->exists('username-exclamation');
$password_noampersand = $conf->exists('password-noexclamation');
$password_noexclamation = $conf->exists('password-noexclamation');
$dirhash = $conf->config('dirhash') || 0;
@@ -1193,7 +1195,7 @@ sub check {
my $ulen = $usernamemax || $self->dbdef_table->column('username')->length;
- $recref->{username} =~ /^([a-z0-9_\-\.\&\%\:\/\=\#]{$usernamemin,$ulen})$/i
+ $recref->{username} =~ /^([a-z0-9_\-\.\&\%\:\/\=\#\!]{$usernamemin,$ulen})$/i
or return gettext('illegal_username'). " ($usernamemin-$ulen): ". $recref->{username};
$recref->{username} = $1;
@@ -1234,6 +1236,9 @@ sub check {
unless ( $username_pound ) {
$recref->{username} =~ /\#/ and return $uerror;
}
+ unless ( $username_exclamation ) {
+ $recref->{username} =~ /\!/ and return $uerror;
+ }
$recref->{popnum} =~ /^(\d*)$/ or return "Illegal popnum: ".$recref->{popnum};