NATS3 Member Logging

From TMM Wiki
Members Admin
MySQL Auth
Members Admin
ID Numbers
Expired Members
Creating Trial Members
Member Delete
Member Logging
Trial Member

You can tell NATS to keep a log of member logins. Send a HTTP GET request from your server to the PHP script, /special/loginlog.php with the site's ID number and the member's username. For example, you can add the following code to a PHP script and then run the script:



To access this secure feature, the IP address of the server making the request must be in the following $config['SECURE_IPS'] configuration file setting. For example,

$config['SECURE_IPS'] = Array('');

Replace with your server's IP address.

After activating this feature, the member's logins show up in the Members Admin's members details.

Extra Features

To add more than one site, use the siteids parameter:


To ignore the siteid and add the log to the first matching member , use the nosite parameter:



If you are using CARMA and NATS and you don't have access to an authentication system that lets you set up posts to remote systems, you can use a smarty plugin like this to post the login to CARMA.

	function smarty_function_loginlog($params, &$smarty) {
		if($_SESSION['login_post_ok'])  //already posted login
				//build url for post
			//post to the nats loginlog script
		if(@file($url) !== FALSE)
			$_SESSION['login_post_ok'] = true;  //save post to session

To use this plugin you need to do the following:

  • Replace with the URL to your NATS installation
  • Save this file in the 'carma/includes/smarty/plugins directory as function.loginlog.php
  • Add a call to the plugin in your members header like this {loginlog}