|
34 | 34 |
|
35 | 35 | adminMultiCheck::form();
|
36 | 36 |
|
| 37 | +require_once('objects/groupUserToUserLinks.php'); |
| 38 | + |
37 | 39 | if ( isset($_REQUEST['aUserID']) and $_REQUEST['aUserID'] )
|
38 | 40 | {
|
39 | 41 | try
|
|
60 | 62 | }
|
61 | 63 | else
|
62 | 64 | {
|
| 65 | + // Fetch the user record data |
| 66 | + $bUsers = array(); |
| 67 | + foreach($m->bUserIDs as $bUserID) |
| 68 | + { |
| 69 | + try { |
| 70 | + $bUsers[$bUserID] = new User($bUserID); |
| 71 | + } catch(Exception $e) { |
| 72 | + print '<p><strong>'.l_t('%s is an invalid user ID.',$bUserID).'</strong></p>'; |
| 73 | + continue; |
| 74 | + } |
| 75 | + } |
| 76 | + |
| 77 | + // Output the group panel user to user links for this set of users: |
| 78 | + print '<div>'; |
| 79 | + $uids = $m->bUserIDs; |
| 80 | + $uids[] = $m->aUserID; |
| 81 | + $relations = GroupUserToUserLinks::loadFromUserIDs($uids,$uids); |
| 82 | + $relations->applyUsers($bUsers); |
| 83 | + print $relations->outputTable(); |
| 84 | + print '</div>'; |
| 85 | + |
63 | 86 | if( isset($_REQUEST['showHistory']) )
|
64 | 87 | {
|
65 | 88 | $m->printUserTimeprint();
|
|
68 | 91 | }
|
69 | 92 | else
|
70 | 93 | {
|
71 |
| - foreach($m->bUserIDs as $bUserID) |
| 94 | + foreach($bUsers as $bUser) |
72 | 95 | {
|
73 |
| - try { |
74 |
| - $bUser = new User($bUserID); |
75 |
| - } catch(Exception $e) { |
76 |
| - print '<p><strong>'.l_t('%s is an invalid user ID.',$bUserID).'</strong></p>'; |
77 |
| - continue; |
78 |
| - } |
79 |
| - |
80 | 96 | $m->compare($bUser);
|
81 | 97 | }
|
82 | 98 | }
|
@@ -457,6 +473,11 @@ public function aLogsDataCollect()
|
457 | 473 | FROM wD_AccessLog
|
458 | 474 | WHERE userID = ".$this->aUserID
|
459 | 475 | );
|
| 476 | + $this->aLogsData['browserFingerprints'] = self::sql_list( |
| 477 | + "SELECT DISTINCT browserFingerprint |
| 478 | + FROM wD_AccessLog |
| 479 | + WHERE userID = ".$this->aUserID." AND browserFingerprint IS NOT NULL" |
| 480 | + ); |
460 | 481 |
|
461 | 482 | // Up until now all aLogsData arrays must be populated
|
462 | 483 | foreach($this->aLogsData as $name=>$data)
|
@@ -631,6 +652,31 @@ private function compareCookieCodeData($bUserID, $bUserTotal)
|
631 | 652 | }
|
632 | 653 | }
|
633 | 654 |
|
| 655 | + private function compareFingerprintData($bUserID, $bUserTotal) |
| 656 | + { |
| 657 | + $aUserTotal = $this->aLogsData['total']; |
| 658 | + $aUserData = $this->aLogsData['browserFingerprints']; |
| 659 | + |
| 660 | + $bTally=array(); |
| 661 | + $matches = self::sql_list( |
| 662 | + "SELECT browserFingerprint, COUNT(browserFingerprint) |
| 663 | + FROM wD_AccessLog |
| 664 | + WHERE userID = ".$bUserID." AND browserFingerprint IN ( '".implode("','",$aUserData)."') |
| 665 | + GROUP BY browserFingerprint", $bTally |
| 666 | + ); |
| 667 | + if( count($matches) ) |
| 668 | + { |
| 669 | + $aTally=array(); |
| 670 | + self::sql_list( |
| 671 | + "SELECT browserFingerprint, COUNT(browserFingerprint) |
| 672 | + FROM wD_AccessLog |
| 673 | + WHERE userID = ".$this->aUserID." AND browserFingerprint IN ( '".implode("','",$matches)."' ) |
| 674 | + GROUP BY browserFingerprint", $aTally |
| 675 | + ); |
| 676 | + self::printDataComparison('BrowserFingerprint', $matches, count($matches), count($aUserData), |
| 677 | + array('Italy'=>0.1,'Turkey'=>0.2,'Austria'=>0.3), $aTally, $aUserTotal, $bTally, $bUserTotal); |
| 678 | + } |
| 679 | + } |
634 | 680 | private function compareUserAgentData($bUserID, $bUserTotal)
|
635 | 681 | {
|
636 | 682 | $aUserTotal = $this->aLogsData['total'];
|
@@ -708,6 +754,7 @@ public function compare(User $bUser)
|
708 | 754 | $this->compareIPData($bUser->id, $bUserTotal);
|
709 | 755 | $this->compareCookieCodeData($bUser->id, $bUserTotal);
|
710 | 756 | $this->compareUserAgentData($bUser->id, $bUserTotal);
|
| 757 | + $this->compareFingerprintData($bUser->id, $bUserTotal); |
711 | 758 |
|
712 | 759 | if ( count($this->aLogsData['fullGameIDs']) > 0 )
|
713 | 760 | $this->compareGames('All games', $bUser->id, $this->aLogsData['fullGameIDs']);
|
|
0 commit comments