diff options
author | ivan <ivan> | 2010-11-03 20:23:34 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-11-03 20:23:34 +0000 |
commit | f2d36cf4f5da8bc2dbe7a81daa7780ad0e5fda45 (patch) | |
tree | de921fff31d28bd24ee5b634302e7f879b335b12 /FS/FS/svc_acct.pm | |
parent | 7416ca26f38222c7efcf046a4507dbf30b3f565a (diff) |
add username-slash and username-equals config options, allow uumlauts etc. in svc_acct.finger like ut_name, RT#10452, RT#10454
Diffstat (limited to 'FS/FS/svc_acct.pm')
-rw-r--r-- | FS/FS/svc_acct.pm | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index d401e1dee..43ff2a5fa 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -9,6 +9,7 @@ use vars qw( $DEBUG $me $conf $skip_fuzzyfiles $username_ampersand $username_letter $username_letterfirst $username_noperiod $username_nounderscore $username_nodash $username_uppercase $username_percent $username_colon + $username_slash $username_equals $password_noampersand $password_noexclamation $warning_template $warning_from $warning_subject $warning_mimetype $warning_cc @@ -74,6 +75,8 @@ FS::UID->install_callback( sub { $username_ampersand = $conf->exists('username-ampersand'); $username_percent = $conf->exists('username-percent'); $username_colon = $conf->exists('username-colon'); + $username_slash = $conf->exists('username-slash'); + $username_equals = $conf->exists('username-equals'); $password_noampersand = $conf->exists('password-noexclamation'); $password_noexclamation = $conf->exists('password-noexclamation'); $dirhash = $conf->config('dirhash') || 0; @@ -1241,7 +1244,7 @@ sub check { my $ulen = $usernamemax || $self->dbdef_table->column('username')->length; if ( $username_uppercase ) { - $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; } else { @@ -1273,6 +1276,12 @@ sub check { unless ( $username_colon ) { $recref->{username} =~ /\:/ and return gettext('illegal_username'); } + unless ( $username_slash ) { + $recref->{username} =~ /\// and return gettext('illegal_username'); + } + unless ( $username_equals ) { + $recref->{username} =~ /\=/ and return gettext('illegal_username'); + } $recref->{popnum} =~ /^(\d*)$/ or return "Illegal popnum: ".$recref->{popnum}; $recref->{popnum} = $1; @@ -1352,7 +1361,7 @@ sub check { } } $self->getfield('finger') =~ - /^([\w \t\!\@\#\$\%\&\(\)\-\+\;\'\"\,\.\?\/\*\<\>]*)$/ + /^([µ_0123456789aAáÁàÀâÂåÅäÄãêæÆbBcCçÇdDðÐeEéÉèÈêÊëËfFgGhHiIíÍìÌîÎïÏjJkKlLmMnNñÑoOóÓòÒôÔöÖõÕøغpPqQrRsSßtTuUúÚùÙûÛüÜvVwWxXyYýÝÿzZþÞ \t\!\@\#\$\%\&\(\)\-\+\;\'\"\,\.\?\/\*\<\>]*)$/ or return "Illegal finger: ". $self->getfield('finger'); $self->setfield('finger', $1); |