add radius-ip configuration parameter for Framed-IP-Address vs. Framed-Address
authorivan <ivan>
Fri, 27 Jun 2003 14:19:55 +0000 (14:19 +0000)
committerivan <ivan>
Fri, 27 Jun 2003 14:19:55 +0000 (14:19 +0000)
FS/FS/Conf.pm
FS/FS/svc_acct.pm

index bc16a40..50e9e6c 100644 (file)
@@ -1039,6 +1039,14 @@ httemplate/docs/config.html
   },
 
   {
+    'key'         => 'radius-ip',
+    'section'     => '',
+    'description' => 'RADIUS attribute for IP addresses.',
+    'type'        => 'select',
+    'select_enum' => [ 'Framed-IP-Address', 'Framed-Address' ],
+  },
+
+  {
     'key'         => 'svc_acct-alldomains',
     'section'     => '',
     'description' => 'Allow accounts to select any domain in the database.  Normally accounts can only select from the domain set in the service definition and those purchased by the customer.',
index 14e1844..5451e67 100644 (file)
@@ -10,7 +10,7 @@ use vars qw( @ISA $DEBUG $me $conf
              $mydomain
              $welcome_template $welcome_from $welcome_subject $welcome_mimetype
              $smtpmachine
-             $radius_password
+             $radius_password $radius_ip
              $dirhash
              @saltset @pw_set );
 use Carp;
@@ -72,6 +72,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' , '.' , '/' );
@@ -873,7 +874,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;
 }