NATS4 Admin Action Postbacks
From TMM Wiki
Jump to navigationJump to search
NATS4 has to ability to post information to a script of your choice for admin actions. These postbacks can be enabled from the Configuration admin. For other postback examples, please check this article: NATS4 Postbacks and Post URLs
Configuration Admin
If you would like to enable these postbacks, go to the Configuration Admin and select "Postback" from the Current Section drop-down menu. You will then see the following configurations under the "Admin Postback" sub-section
- ADMIN_ACTION_POSTBACK - Receive a postback whenever an admin page is viewed or used. To enable, put the URL of the script to post all admin actions.
Postback Logging Script
The following example script allows you to log the contents of a postback
NOTE: Make sure that the log is NOT in a web accessible folder.
<?php $file = '/path/to/nats4/logs/postback_logs.txt'; // Open the file to get existing content $post = print_r($_REQUEST, TRUE); file_put_contents($file, $post, FILE_APPEND); ?>
Admin Postback Format
Here is an exmaple log of the ADMIN_ACTION_POSTBACK when viewing the edit page of a site:
Array ( [query_string] => view=edit&site[id]=1&nats_sess=1068ac55f635337ed03ffca0883a1dd8 [performed_action_loginid] => 2 [performed_action_ip] => 10.10.10.31 [performed_action_script] => /admin_sites.php [performed_action_time] => 1437762032 )