[freeside-commits] freeside/FS/FS Conf.pm, 1.180.2.39, 1.180.2.40 svc_acct.pm, 1.217.2.23, 1.217.2.24

Ivan,,, ivan at wavetail.420.am
Tue Apr 7 11:20:50 PDT 2009


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv22894

Modified Files:
      Tag: FREESIDE_1_7_BRANCH
	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.180.2.39
retrieving revision 1.180.2.40
diff -u -d -r1.180.2.39 -r1.180.2.40
--- Conf.pm	17 Mar 2009 20:13:58 -0000	1.180.2.39
+++ Conf.pm	7 Apr 2009 18:20:48 -0000	1.180.2.40
@@ -1190,6 +1190,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.217.2.23
retrieving revision 1.217.2.24
diff -u -d -r1.217.2.23 -r1.217.2.24
--- svc_acct.pm	7 Apr 2009 18:15:17 -0000	1.217.2.23
+++ svc_acct.pm	7 Apr 2009 18:20:48 -0000	1.217.2.24
@@ -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
              $welcome_template $welcome_from
              $welcome_subject $welcome_subject_template $welcome_mimetype
@@ -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;
@@ -1029,11 +1030,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;
   }
@@ -1064,6 +1065,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