[freeside-commits] freeside/FS/FS Conf.pm, 1.273, 1.274 svc_acct.pm, 1.255, 1.256
Ivan,,,
ivan at wavetail.420.am
Tue Apr 7 11:20:45 PDT 2009
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv22888
Modified Files:
Conf.pm svc_acct.pm
Log Message:
add a config to allow colon in usernames, RT#5145
Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.273
retrieving revision 1.274
diff -u -d -r1.273 -r1.274
--- Conf.pm 29 Mar 2009 23:44:12 -0000 1.273
+++ Conf.pm 7 Apr 2009 18:20:43 -0000 1.274
@@ -1195,6 +1195,13 @@
'type' => 'checkbox',
},
+ {
+ 'key' => 'username-colon',
+ 'section' => 'username',
+ 'description' => 'Allow the colon character (:) in usernames.',
+ 'type' => 'checkbox',
+ },
+
{
'key' => 'safe-part_bill_event',
'section' => 'UI',
Index: svc_acct.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_acct.pm,v
retrieving revision 1.255
retrieving revision 1.256
diff -u -d -r1.255 -r1.256
--- svc_acct.pm 7 Apr 2009 18:15:15 -0000 1.255
+++ svc_acct.pm 7 Apr 2009 18:20:43 -0000 1.256
@@ -6,7 +6,7 @@
$usernamemax $passwordmin $passwordmax
$username_ampersand $username_letter $username_letterfirst
$username_noperiod $username_nounderscore $username_nodash
- $username_uppercase $username_percent
+ $username_uppercase $username_percent $username_colon
$password_noampersand $password_noexclamation
$warning_template $warning_from $warning_subject $warning_mimetype
$warning_cc
@@ -65,6 +65,7 @@
$username_uppercase = $conf->exists('username-uppercase');
$username_ampersand = $conf->exists('username-ampersand');
$username_percent = $conf->exists('username-percent');
+ $username_colon = $conf->exists('username-colon');
$password_noampersand = $conf->exists('password-noexclamation');
$password_noexclamation = $conf->exists('password-noexclamation');
$dirhash = $conf->config('dirhash') || 0;
@@ -1026,11 +1027,11 @@
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 {
- $recref->{username} =~ /^([a-z0-9_\-\.\&\%]{$usernamemin,$ulen})$/
+ $recref->{username} =~ /^([a-z0-9_\-\.\&\%\:]{$usernamemin,$ulen})$/
or return gettext('illegal_username'). " ($usernamemin-$ulen): ". $recref->{username};
$recref->{username} = $1;
}
@@ -1055,6 +1056,9 @@
unless ( $username_percent ) {
$recref->{username} =~ /\%/ and return gettext('illegal_username');
}
+ unless ( $username_colon ) {
+ $recref->{username} =~ /\:/ and return gettext('illegal_username');
+ }
$recref->{popnum} =~ /^(\d*)$/ or return "Illegal popnum: ".$recref->{popnum};
$recref->{popnum} = $1;
More information about the freeside-commits
mailing list