diff options
author | ivan <ivan> | 2004-05-08 07:47:01 +0000 |
---|---|---|
committer | ivan <ivan> | 2004-05-08 07:47:01 +0000 |
commit | 61fd0c2eabbd8de6577e1a3f1395e71b01b457f6 (patch) | |
tree | 7a695487e657b28de85d80e8389e8676d4563085 | |
parent | 491c83f3e1711c9ac6781135cf27e899a0776477 (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 69ee9b2d2..156523089 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -818,6 +818,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'); |