WHERE s.snet_id = :id;
mid = 0;
+ /* Non query owner must provide valid billing information. */
if (q->version >= 8)
{
if (subnet_status == SNET_STATUS_BILLABLE)
id = *(int *)argv[0];
EXEC SQL SELECT m.name, m.use, m.contact, m.billing_contact, m.status,
m.address, m.owner_type, m.owner_id, m.acomment, m.ocomment, m.snet_id,
- s.owner_type, s.owner_id INTO :name, :use, :contact, :billing_contact,
- :status, :address, :mtype, :mid, :acomment, :ocomment, :snid, :stype,
- :sid
+ s.owner_type, s.owner_id, s.status INTO :name, :use, :contact,
+ :billing_contact, :status, :address, :mtype, :mid, :acomment,
+ :ocomment, :snid, :stype, :sid, :subnet_status
FROM machine m, subnet s
WHERE m.mach_id = :id AND s.snet_id = m.snet_id;
if (dbms_errno)
return mr_errcode;
+ /* Non query owner must provide valid billing information. */
+ if (q->version >= 8)
+ {
+ if (subnet_status == SNET_STATUS_BILLABLE)
+ {
+ account_number = argv[8];
+ EXEC SQL SELECT account_number FROM accountnumbers
+ WHERE account_number = :account_number;
+ if (sqlca.sqlcode == SQL_NO_MATCH)
+ return MR_ACCOUNT_NUMBER;
+ }
+ }
+
/* non-query-owner cannot change use or ocomment */
if ((use != atoi(argv[7 + idx])) || (ocomment != *(int *)argv[14 + idx]))
return MR_PERM;