Virtual field merge
[freeside.git] / FS / FS / svc_acct.pm
index 282ef5a..0ee7a72 100644 (file)
@@ -9,7 +9,7 @@ use vars qw( @ISA $DEBUG $me $conf
              $username_uppercase
              $welcome_template $welcome_from $welcome_subject $welcome_mimetype
              $smtpmachine
-             $radius_password
+             $radius_password $radius_ip
              $dirhash
              @saltset @pw_set );
 use Carp;
@@ -68,6 +68,7 @@ $FS::UID::callback{'FS::svc_acct'} = sub {
   }
   $smtpmachine = $conf->config('smtpmachine');
   $radius_password = $conf->config('radius-password') || 'Password';
+  $radius_ip = $conf->config('radius-ip') || 'Framed-IP-Address';
 };
 
 @saltset = ( 'a'..'z' , 'A'..'Z' , '0'..'9' , '.' , '/' );
@@ -603,6 +604,8 @@ error, returns the error, otherwise returns false.
 
 Called by the suspend method of FS::cust_pkg (see L<FS::cust_pkg>).
 
+Calls any export-specific suspend hooks.
+
 =cut
 
 sub suspend {
@@ -627,6 +630,8 @@ an error, returns the error, otherwise returns false.
 
 Called by the unsuspend method of FS::cust_pkg (see L<FS::cust_pkg>).
 
+Calls any export-specific unsuspend hooks.
+
 =cut
 
 sub unsuspend {
@@ -827,7 +832,7 @@ sub check {
            ": ". $recref->{_password};
   }
 
-  ''; #no error
+  $self->SUPER::check;
 }
 
 =item radius
@@ -862,7 +867,7 @@ sub radius_reply {
       ( $FS::raddb::attrib{lc($attrib)}, $self->getfield($column) );
     } grep { /^radius_/ && $self->getfield($_) } fields( $self->table );
   if ( $self->slipip && $self->slipip ne '0e0' ) {
-    $reply{'Framed-IP-Address'} = $self->slipip;
+    $reply{$radius_ip} = $self->slipip;
   }
   %reply;
 }
@@ -966,7 +971,7 @@ external SQL radacct table, specified via sqlradius export.  Sessions which
 started in the specified range but are still open are counted from session
 start to the end of the range (unless they are over 1 day old, in which case
 they are presumed missing their stop record and not counted).  Also, sessions
-which end in therange but started earlier are counted from the start of the
+which end in the range but started earlier are counted from the start of the
 range to session end.  Finally, sessions which start before the range but end
 after are counted for the entire range.