. is used in some implementations of classic crypt
[freeside.git] / FS / FS / svc_phone.pm
index 965f3a5..237bbf5 100644 (file)
@@ -179,14 +179,23 @@ and replace methods.
 sub check {
   my $self = shift;
 
+  my $conf = new FS::Conf;
+
   my $phonenum = $self->phonenum;
-  $phonenum =~ s/\D//g;
+  my $phonenum_check_method;
+  if ( $conf->exists('svc_phone-allow_alpha_phonenum') ) {
+    $phonenum =~ s/\W//g;
+    $phonenum_check_method = 'ut_alpha';
+  } else {
+    $phonenum =~ s/\D//g;
+    $phonenum_check_method = 'ut_number';
+  }
   $self->phonenum($phonenum);
 
   my $error = 
     $self->ut_numbern('svcnum')
     || $self->ut_numbern('countrycode')
-    || $self->ut_number('phonenum')
+    || $self->$phonenum_check_method('phonenum')
     || $self->ut_anything('sip_password')
     || $self->ut_numbern('pin')
     || $self->ut_textn('phone_name')
@@ -225,7 +234,7 @@ sub check_pin {
 sub radius_reply {
   my $self = shift;
   #XXX Session-Timeout!  holy shit, need rlm_perl to ask for this in realtime
-  {};
+  ();
 }
 
 =item radius_check