[freeside-devel] add service name and service id to shellcommands
Simon P. Ditner
simon-freeside at uc.org
Thu Sep 14 18:35:52 PDT 2006
If you're upgrading a customer from one package to another, i.e. more
disk quota, and such, I found you needed to call the same Export command,
otherwise the "delete" / "insert" commands would be invoked rather than
the "upgrade". So here's a quick fix that will pass along the service
name so that your external script can make a better decision about what
to do. (Credit: ArmorTechnologies / armorware.com)
Index: shellcommands.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_export/shellcommands.pm,v
retrieving revision 1.40
diff -u -r1.40 shellcommands.pm
--- shellcommands.pm 29 Jun 2006 15:45:57 -0000 1.40
+++ shellcommands.pm 15 Sep 2006 01:24:00 -0000
@@ -162,6 +162,8 @@
<LI><code>$shell</code>
<LI><code>$quota</code>
<LI><code>@radius_groups</code>
+ <LI><code>$service_name</code> - Name of this service, i.e. "POP Account"
+ <LI><code>$service_id</code> - The internal ID of this service
<LI>All other fields in <a href="../docs/schema.html#svc_acct">svc_acct</a> are also available.
</UL>
END
@@ -233,6 +235,8 @@
$finger = shell_quote $finger;
$quoted_password = shell_quote $_password;
$domain = $svc_acct->domain;
+ $service_name = shell_quote( $svc_acct->cust_svc->part_svc->svc );
+ $service_id = shell_quote( $svc_acct->cust_svc->svcpart );
$crypt_password =
shell_quote( $svc_acct->crypt_password( $self->option('crypt') ) );
More information about the freeside-devel
mailing list