Difference between revisions of "Nats4 Member Logging"

From TMM Wiki
Jump to navigationJump to search
m
Line 3: Line 3:
 
}}
 
}}
  
[[NATS4]] allows you to direct it to keep a log of member logins. To do so, send a HTTP GET
+
[[NATS4]] allows you to direct it to keep a log of member logins. To do so, send a HTTP GET request from your server to the PHP script, ''member_loginlog.php'' with the site's ID number and the member's username. This will return a log of that particular member's login history. For example, you can add the following code to a PHP script and then run it:
request from your server to the PHP script, ''member_loginlog.php'' with the site's ID number and the member's username. This will return a log of that particular member's login history. For example, you can add the following code to a PHP script and then run it:
 
  
 
<pre>
 
<pre>
Line 18: Line 17:
 
Replace 123.123.123.123 with your server's IP address.
 
Replace 123.123.123.123 with your server's IP address.
  
After this feature is activated, the specified member's login history will show up in the [[Members Admin|Members Admin's]] members details
+
After this feature is activated, the specified member's login history will show up in the [[Members Admin|Members Admin's]] members details.
  
After activating this feature, the member's logins will show up in the [[Members Admin|Members Admin's]] members details. You can find this information at the bottom of the member details page, under ''Login Log for [Member]"
+
Once this feature has been activated, the member's logins will show up in the [[Members Admin|Members Admin's]] members details. You can find this information at the bottom of the member details page, under ''Login Log for [Member]"
  
 
[[File:Login_log.PNG|450px|Example of a Member Login Log]]
 
[[File:Login_log.PNG|450px|Example of a Member Login Log]]

Revision as of 17:56, 14 June 2010

NATS 4
Members Admin
The Members Admin
View Member Details
Add Member
MySQL Auth
Mod Authn DB
Multisite Access
Member Logging
Member Password Retrieval
OpenID Connect
Mod Auth OpenIDC
ID Numbers

NATS4 allows you to direct it to keep a log of member logins. To do so, send a HTTP GET request from your server to the PHP script, member_loginlog.php with the site's ID number and the member's username. This will return a log of that particular member's login history. For example, you can add the following code to a PHP script and then run it:

$url="http://www.example.com/member_loginlog.php?username=$_SERVER[REMOTE_USER]&siteid=123&ip=$_SERVER[REMOTE_ADDR]";

@file($url);

This is a secure feature in NATS, so the IP address of the server making the information request must be in the Smarty configuration file $config['SECURE_IPS'] setting. For example:

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

Replace 123.123.123.123 with your server's IP address.

After this feature is activated, the specified member's login history will show up in the Members Admin's members details.

Once this feature has been activated, the member's logins will show up in the Members Admin's members details. You can find this information at the bottom of the member details page, under Login Log for [Member]"

Example of a Member Login Log

Extra Features

To add more than one site to your member login history, use the siteid parameter:

$url="http://www.server.com/member_loginlog.php?username=$_SERVER[REMOTE_USER]&siteid=5,64,2&ip=$_SERVER[REMOTE_ADDR]";