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')
sub radius_reply {
my $self = shift;
#XXX Session-Timeout! holy shit, need rlm_perl to ask for this in realtime
- {};
+ ();
}
=item radius_check