Site User Management
NATS can send a postback script of your choosing every time a username gets added, removed, changed, expired, or checked. This is mostly used if you use an external verification script for checking user details. To use this postback script, go to the Sites Admin, edit a tour of your choosing, and enter your script's URL in the Management URL field.
For other postback examples, please check this article: Postbacks and Post URLs

You can also prevent NATS from posting members' personal information through the user management postback script by using the Sites Admin. Simply edit the site you want to affect, and check the "Disable Storing Personal Member Information" box on the Edit Site page (From the main admin_sites page, click the Pencil Icon associated with a site). This will prevent information from the member_info table from being sent (i.e., first name, last name, address, etc.).
Each request identifies what actions the particular user (based on username) took to trigger the script. Your script should reply with one of the following messages:
OK|message
NOTOK|message
ERROR|message
Replace "message" with a detailed explanation of your choosing.
Username Actions
Certain actions (calls) in NATS will trigger your user management script, returning a wide variety of parameters. The parameters passed in most of the user management calls will be similar, as a large amount of these parameters are taken from the NATS members table (i.e., memberid, status, joined, siteid, username, IP, etc.).
Additionally, most of these calls use identical parameters to pass back information. These calls are ACTIVATE, MANUALADD, DELETE, and TRIALTOFULL.
When Each Action Is Sent
The user management script and Post URLs are separate features, but NATS sends both for the same events. The table below shows what triggers each action, and which Post URL is sent for the same event.
ADD
A new member joins.
Approval Post URL
MANUALADD
An admin adds a member manually.
Approval Post URL
ACTIVATE
A member rebills.
Rebill Post URL
TRIALTOFULL
A trial member upgrades to a full membership.
Upgrade Approval Post URL
CHANGE
A member's details change (for example, their username or password).
Changed Details Post URL
EXPIRE
The biller reports that a member cancelled.
Cancel Post URL
DELETE
A member's access ends.
Expire Post URL
CHECK
NATS checks whether a username is available.
None
ADD
Sent when a new username should be added to the user management system for user access. This occurs when a new member registers on one of your sites.
This sends parameters from the members table, as well as the following extra parameters:
member_subscription_id, memberidx, billerid, statid, cost, cost_charge, spent, refunded, charges, next_rebill, optionid, rebills, active, expires, nats_expires, biller_expires, original_optionid, created_date, loginid_assigned, identid_assigned, member_identid, member_loginid, country, xsell_success, last_modified, mychanges_username/password/status/trial/mailok/marked, new_status/trial/mailok/marked, siteid, username
MANUALADD
Sent when a username is manually added via the Members Admin.
This sends the available parameters from the member's table, as well as the additional parameters sent by the "ADD" user management call.
ACTIVATE
Sent when a user has been rebilled through the biller. This is used to record a rebill or to convert a member from a trial membership to a full membership.
An additional user management called "CHANGE" will happen if they are changed on member information ('username','password','email','optionid', 'programid', 'tourid', 'campaignid', 'token') during the activation.
This sends the available parameters from the member's table, as well as the additional parameters sent by the "ADD" user management call.
TRIALTOFULL
Sent when a user upgrades from a trial to a full membership.
This sends the available parameters from the member's table, as well as the additional parameters sent by the "ADD" user management call.
CHANGE
Sent when a current username or password should be changed to a new username or password. This will only pass back a new username or new password if there is a new value for either.
This sends a few different parameters from other user management calls. The "CHANGE" call also sends parameters such as new_username, new_password, new_cryptpass, new_token, etc.
DELETE
Sent when a user's account should be immediately removed from the active user list. This happens when the member's expiration date has passed, or when an admin deactivates the member. The Expire Post URL is sent for the same event.
This sends the available parameters from the member's table, as well as the additional parameters sent by the "ADD" user management call.
EXPIRE
Sent when NATS receives a cancellation from the biller. The user's account should be expired on the provided date. This date is usually in the future (when the member's paid time runs out), but it might be in the past. The Cancel Post URL is sent for the same event.
You will not receive another EXPIRE call on the expiration date itself. Instead:
If the member rebills before that date, you will receive an ACTIVATE call.
When the member's access actually ends, you will receive a DELETE call.
This sends the available parameters from the member's table, as well as the additional parameters sent by the "ADD" user management call. This call also sends the expires parameter, expressed in unix_timestamp format.
CHECK
Sent to check if a username is available, or already exists in your NATS database. This sends the following parameters: username, siteid, email, memberid (if available).
User Management Encryption Key
The User Management Encryption Key is used as another way to verify the postback data was sent by NATS. When User Management Encryption is enabled with a key that you create, all postbacks will be sent with the "hash" value.
This is how the hash value will be calculated:
You can calculate the hash value to ensure the postback was sent from your NATS system.
Error Logging
If the reply is "ERROR", NATS will add the error to the visitor's note so you can see the problem in the Members Admin.
Sample Scripts
The following script allows you to log any Postbacks sent by NATS to your User Management script. This script will take any information being posted to the user management script, and store it in a specified log file. In order for this script to work, you must first make your user management log file writable by Apache. To do so, you must change the /home/path/nats4/user_management.log path found in the following sample script to where your NATS user_management.log file is located.
You may use the following sample script provided by Tanguy de Courson to put your User Management in effect.
Last updated
Was this helpful?