diff options
author | ivan <ivan> | 2004-05-08 07:46:31 +0000 |
---|---|---|
committer | ivan <ivan> | 2004-05-08 07:46:31 +0000 |
commit | a176034d4fa386de180b893e00bda36b04251778 (patch) | |
tree | 573da80d7b5b55fb86ada77ee617bfe456684dd8 | |
parent | 28f7684d096f8f5c97a68d04193bc9ba1d503ef5 (diff) |
default finger to first+last
-rw-r--r-- | FS/FS/svc_acct.pm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index a566b81f6..355573b00 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -831,6 +831,15 @@ sub check { # $error = $self->ut_textn('finger'); # return $error if $error; + if ( $self->getfield('finger') eq '' ) { + my $cust_pkg = $self->svcnum + ? $self->cust_svc->cust_pkg + : qsearchs('cust_pkg', { 'pkgnum' => $self->getfield('pkgnum') } ); + if ( $cust_pkg ) { + my $cust_main = $cust_pkg->cust_main; + $self->setfield('finger', $cust_main->first.' '.$cust_main->get('last') ); + } + } $self->getfield('finger') =~ /^([\w \t\!\@\#\$\%\&\(\)\-\+\;\'\"\,\.\?\/\*\<\>]*)$/ or return "Illegal finger: ". $self->getfield('finger'); |