14919: make indentation and coding match expectations
[freeside.git] / FS / FS / part_export / netsapiens.pm
index adc1942..aa89d47 100644 (file)
@@ -5,6 +5,7 @@ use MIME::Base64;
 use Tie::IxHash;
 use FS::part_export;
 use Date::Format qw( time2str );
+use Regexp::Common qw/URI/;
 
 @ISA = qw(FS::part_export);
 $me = '[FS::part_export::netsapiens]';
@@ -80,6 +81,22 @@ END
 
 sub rebless { shift; }
 
+
+sub check_options {
+  my ($self, $options) = @_;
+       
+  my $rex = qr/$RE{URI}{HTTP}{-scheme => qr|https?|}/;                 # match any "http:" or "https:" URL
+       
+  for my $key (qw/url device_url/) {
+    if ($$options{$key} && ($$options{$key} !~ $rex)) {
+      return "Invalid (URL): " . $$options{$key};
+    }
+  }
+  return '';
+}
+
+
+
 sub ns_command {
   my $self = shift;
   $self->_ns_command('', @_);
@@ -245,7 +262,7 @@ sub ns_create_or_update {
   ###
   foreach $feature (split /\s+/, $self->option('features') ) {
 
-    my $nsf = $self->ns_command( 'PUT', $self->ns_feature($feature),
+    my $nsf = $self->ns_command( 'PUT', $self->ns_feature($svc_phone, $feature),
       'control'    => 'd', #User Control, disable
       'expires'    => 'never',
       #'ts'         => '', #?