[freeside-commits] branch master updated. 884a51a10e290fc1df6ed7fc87aeeb95c8d0ca3f

Ivan ivan at 420.am
Sun Nov 10 21:45:03 PST 2013


The branch, master has been updated
       via  884a51a10e290fc1df6ed7fc87aeeb95c8d0ca3f (commit)
      from  214db255758318502e214fffa3d71d5709d559f5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 884a51a10e290fc1df6ed7fc87aeeb95c8d0ca3f
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Nov 10 21:45:02 2013 -0800

    add svc_phone-radius-password config, RT#21445

diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 6b9aab2..0eed8ee 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -4767,6 +4767,17 @@ and customer address. Include units.',
   },
 
   {
+    'key'         => 'svc_phone-radius-password',
+    'section'     => 'telephony',
+    'description' => 'Password when exporting svc_phone records to RADIUS',
+    'type'        => 'select',
+    'select_hash' => [
+      '' => 'Use default from svc_phone-radius-default_password config',
+      'countrycode_phonenum' => 'Phone number (with country code)',
+    ],
+  },
+
+  {
     'key'         => 'svc_phone-radius-default_password',
     'section'     => 'telephony',
     'description' => 'Default password when exporting svc_phone records to RADIUS',
diff --git a/FS/FS/svc_phone.pm b/FS/FS/svc_phone.pm
index 72c609c..887f7be 100644
--- a/FS/FS/svc_phone.pm
+++ b/FS/FS/svc_phone.pm
@@ -650,7 +650,13 @@ sub radius_check {
 
   my $conf = new FS::Conf;
 
-  $check{'User-Password'} = $conf->config('svc_phone-radius-default_password');
+  my $password;
+  if ( $conf->config('svc_phone-radius-password') eq 'countrycode_phonenum' ) {
+    $password = $self->countrycode. $self->phonenum;
+  } else {
+    $password = $conf->config('svc_phone-radius-default_password');
+  }
+  $check{'User-Password'} = $password;
 
   %check;
 }

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/Conf.pm      |   11 +++++++++++
 FS/FS/svc_phone.pm |    8 +++++++-
 2 files changed, 18 insertions(+), 1 deletions(-)




More information about the freeside-commits mailing list