SYNOPSIS
int MGOsetsubscription (char **out, char *uwn, int sub, int act, char *data);
DESCRIPTION
The MGOsetsubscription() function performs the specified action
act on the given uwnetid uwn and subscription reference code
sub. The value for act may be one of:
- 1 - Activate subscription
- 2 - Deactivate subscription
- 3 - Suspend subscription
- 4 - Resume subscription
- 5 - Modify subscription
- 6 - Setname subscription
- 7 - Disuser subscription
- 8 - Reuser subscription
A particular subscription may require a helper process, which is invoked as
required. All text from the helper process is returned through out.
If the helper process needs additional information, pass it through data,
using the following format:
MGO_DAT_xxx1=(yyy1) [MGO_DAT_xxx2=(yyy2) ...]
These will appear as environmental values for the helper process.
Note: The "MGO_DAT_" prefix is required syntax. The following
environmental values are passed to the helper process by default:
- MGO_ACTION=act - The action code
- MGO_ADMINISTRATOR=[1 or 0] - Whether the client is an administrator-type
- MGO_SUBSCRIPTION=sub - The subscription code
- MGO_SUBSTATE=state - The subscription's current state, as listed by MGOanalsubscription()
- MGO_SUBSTATUS=status - The subscription's status reference code
- MGO_UWNETID=uwn - The uwnetid to act upon
If you want more verbose output from the helper process for debugging purposes
and such, pass the environment value MGO_DAT_VERBOSE=n, where n
is the level of verbosity you wish.
RETURN VALUE
Returns the subscription status reference code upon success, or -1 if an error
occurred (in which case MGOerrno and MGOerrmsg are set
appropriately). A status of "pending" means that the external process will
complete the request at some future time.
ERRORS
- MGO_E_MAR - One or more of the required arguments were missing
- MGO_E_IAR - Invalid or ambiguous argument
- MGO_E_PMD - Permission denied. See access control
- MGO_E_ALS - Already subscribed to subscription
- MGO_E_NOS - Not subscribed to subscription
- MGO_E_SNP - Subscription is not permitted for uwnetid
- MGO_E_SNS - Subscription not set. See out for details
- MGO_E_MAT - No match found (no such uwnetid)
- MGO_E_ISE - Internal server error
- MGO_E_SQL - An SQL error occurred. See MGOerrmsg for details
AUTHENTICATION LEVEL
wmango
SEE ALSO
MGOfreechar(),
MGOselrsubscription(),
MGOselrsubstatus(),
MGOshowsubscription(),
MGOzero()