Announcement

  •  » Engine
  •  » User Info Tracking

#16 2012-12-16 18:42:22

flop25
Piwigo Team
2006-07-06
6961

Re: User Info Tracking

you might try to intercept a deconection from the POST data, and try to add an action for ws : in short intercept before the logout_user() call


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#17 2012-12-16 19:00:41

Charles2012
Member
2012-11-04
26

Re: User Info Tracking

Where would I add the trigger action at?
It would need to be somewhere in the code for when a user is logging out.

Offline

 

#18 2016-12-10 11:18:55

gawo
Member
2016-12-10
1

Re: User Info Tracking

Hi,
maybe my response is outdated
My solution was to modify  main.inc.php in log_failed_logins:

// HaWo ++
add_event_handler('login_success', 'log_success_logins_log');
// HaWo --

and a 'new' function

// HaWo ++
function log_success_logins_log()
{
  global $conf;

  $myFile = $conf['logFailedLoginsFilename'];

  // if a logfile parameter is defined
  if ($myFile <> "") {
    $remoteIpAddress = $_SERVER['REMOTE_ADDR'];
    $userName = $_POST['username'];
    // Example: 2015/06/14 22:32:33 ip=192.168.1.100 username=Admin
    $logline = date("Y/m/d H:i:s")." ip=".$remoteIpAddress." Success: username=".$userName."\n";

    // try opening the file and append a new logline
    $fh = fopen($myFile, 'a');
    if ($fh) {
      fwrite($fh, $logline);
      fclose($fh);
    }
  }
}
// HaWo --

Offline

 
  •  » Engine
  •  » User Info Tracking

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact