diff options
author | ivan <ivan> | 2010-03-12 21:56:32 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-03-12 21:56:32 +0000 |
commit | b5bb1a07a26d5666cb059b5299a6ca2883f2153a (patch) | |
tree | b555752587200ab89fb44483a2898970b890d1ef /FS/FS/svc_phone.pm | |
parent | f433b4f187e484e8c40bdcebbeb5a5d51b3ae38e (diff) |
add svc_phone-phone_name-max_length config, RT#7047
Diffstat (limited to 'FS/FS/svc_phone.pm')
-rw-r--r-- | FS/FS/svc_phone.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/FS/FS/svc_phone.pm b/FS/FS/svc_phone.pm index 5d102ce..30572ec 100644 --- a/FS/FS/svc_phone.pm +++ b/FS/FS/svc_phone.pm @@ -2,7 +2,7 @@ package FS::svc_phone; use strict; use base qw( FS::svc_Domain_Mixin FS::location_Mixin FS::svc_Common ); -use vars qw( $DEBUG $me @pw_set $conf ); +use vars qw( $DEBUG $me @pw_set $conf $phone_name_max ); use Data::Dumper; use Scalar::Util qw( blessed ); use FS::Conf; @@ -23,6 +23,7 @@ $DEBUG = 0; #ask FS::UID to run this stuff for us later $FS::UID::callback{'FS::svc_acct'} = sub { $conf = new FS::Conf; + $phone_name_max = $conf->config('svc_phone-phone_name-max_length'); }; =head1 NAME @@ -383,6 +384,10 @@ sub check { ; return $error if $error; + return 'Name ('. $self->phone_name. + ") is longer than $phone_name_max characters" + if $phone_name_max && length($self->phone_name) > $phone_name_max; + $self->countrycode(1) unless $self->countrycode; unless ( length($self->sip_password) ) { |