[freeside-commits]
freeside/FS/FS svc_acct.pm, 1.182, 1.183 Conf.pm, 1.131, 1.132
Ivan,,,
ivan at wavetail.420.am
Thu Jun 30 06:20:35 PDT 2005
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv21272
Modified Files:
svc_acct.pm Conf.pm
Log Message:
add username-percent config option
Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -d -r1.131 -r1.132
--- Conf.pm 8 Jun 2005 09:03:05 -0000 1.131
+++ Conf.pm 30 Jun 2005 13:20:33 -0000 1.132
@@ -1050,6 +1050,13 @@
'type' => 'checkbox',
},
+ {
+ 'key' => 'username-percent',
+ 'section' => 'username',
+ 'description' => 'Allow the percent character (%) in usernames.',
+ 'type' => 'checkbox',
+ },
+
{
'key' => 'username_policy',
'section' => 'deprecated',
Index: svc_acct.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_acct.pm,v
retrieving revision 1.182
retrieving revision 1.183
diff -u -d -r1.182 -r1.183
--- svc_acct.pm 8 Jun 2005 09:03:05 -0000 1.182
+++ svc_acct.pm 30 Jun 2005 13:20:33 -0000 1.183
@@ -6,7 +6,7 @@
$usernamemax $passwordmin $passwordmax
$username_ampersand $username_letter $username_letterfirst
$username_noperiod $username_nounderscore $username_nodash
- $username_uppercase
+ $username_uppercase $username_percent
$password_noampersand $password_noexclamation
$welcome_template $welcome_from $welcome_subject $welcome_mimetype
$smtpmachine
@@ -55,6 +55,7 @@
$username_nodash = $conf->exists('username-nodash');
$username_uppercase = $conf->exists('username-uppercase');
$username_ampersand = $conf->exists('username-ampersand');
+ $username_percent = $conf->exists('username-percent');
$password_noampersand = $conf->exists('password-noexclamation');
$password_noexclamation = $conf->exists('password-noexclamation');
$dirhash = $conf->config('dirhash') || 0;
@@ -687,11 +688,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;
}
@@ -719,6 +720,9 @@
if ( $password_noexclamation ) {
$recref->{_password} =~ /\!/ and return gettext('illegal_password');
}
+ unless ( $username_percent ) {
+ $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