Difference between revisions of "NATS3 Member Logging"

From TMM Wiki
Jump to navigationJump to search
(Undo revision 7506 by TmmStephen (Talk))
Line 1: Line 1:
{{NATS4 Manual
 
| show_members_admin_section = true
 
}}
 
 
{{NATS3 Manual
 
{{NATS3 Manual
 
| show_members_admin_section = true
 
| show_members_admin_section = true
Line 12: Line 9:
  
 
<pre>
 
<pre>
$url="http://www.example.com/member_loginlog.php?username=$_SERVER[REMOTE_USER]&siteid=123&ip=$_SERVER[REMOTE_ADDR]";
+
$url="http://www.example.com/special/loginlog.php?username=$_SERVER[REMOTE_USER]&siteid=123&ip=$_SERVER[REMOTE_ADDR]";
  
 
@file($url);
 
@file($url);
Line 32: Line 29:
  
 
<pre>
 
<pre>
$url="http://www.server.com/member_loginlog.php?username=$_SERVER[REMOTE_USER]&siteids=5,64,2&ip=$_SERVER[REMOTE_ADDR]";
+
$url="http://www.server.com/special/loginlog.php?username=$_SERVER[REMOTE_USER]&siteids=5,64,2&ip=$_SERVER[REMOTE_ADDR]";
 
</pre>
 
</pre>
  
Line 39: Line 36:
  
 
<pre>
 
<pre>
$url="http://www.server.com/member_loginlog.php?username=$_SERVER[REMOTE_USER]&nosite=1&ip=$_SERVER[REMOTE_ADDR]";
+
$url="http://www.server.com/special/loginlog.php?username=$_SERVER[REMOTE_USER]&nosite=1&ip=$_SERVER[REMOTE_ADDR]";
 
</pre>
 
</pre>
  
 
[[Category:Also NATS4 Article]]
 
[[Category:Also NATS4 Article]]

Revision as of 15:45, 22 April 2009

NATS 3
Members Admin
MySQL Auth
Members Admin
Member
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:

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

@file($url);

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('123.123.123.123');

Replace 123.123.123.123 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:

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

To show login information for all of your sites, use the nosite parameter:

$url="http://www.server.com/special/loginlog.php?username=$_SERVER[REMOTE_USER]&nosite=1&ip=$_SERVER[REMOTE_ADDR]";