Commit dd24a017 authored by sylvieg's avatar sylvieg

[FIX]logs: indicate when coming from a token

parent 7402d879
......@@ -11,6 +11,7 @@ class AuthTokens
private $db;
private $maxTimeout = 3600;
private $maxHits = 1;
public $ok = false;
public static function build( $prefs ) {
return new AuthTokens( TikiDb::get(), array(
......@@ -47,6 +48,7 @@ class AuthTokens
}
$this->db->query( 'UPDATE `tiki_auth_tokens` SET `hits` = `hits` - 1 WHERE `tokenId` = ?', array( $data['tokenId'] ) );
$this->ok = true;
return (array) json_decode( $data['groups'], true );
}
......
......@@ -145,7 +145,12 @@ class LogsLib extends TikiLib
$date = $this->now;
}
if ($who == '') {
$who = $user;
global $tokenlib;
if ($prefs['auth_token_access'] == 'y' && empty($user) && !empty($tokenlib) && $tokenlib->ok) {
$user = '§TOKEN§';
} else {
$who = $user;
}
}
if ($ip == '') {
$ip = $this->get_ip_address();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment