Skip to content

Commit

Permalink
Minor cookie consent cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mdnoble73 committed Oct 1, 2024
1 parent 59f625d commit 15a3dc3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
3 changes: 1 addition & 2 deletions code/web/Drivers/CloudLibraryDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -776,8 +776,7 @@ private function callCloudLibraryUrl(CloudLibrarySetting $settings, string $apiP
public function trackUserUsageOfCloudLibrary($user): void {
require_once ROOT_DIR . '/sys/CloudLibrary/UserCloudLibraryUsage.php';
global $library;
$userObj = UserAccount::getActiveUserObj();
$userCloudLibraryTracking = $userObj->userCookiePreferenceLocalAnalytics;
$userCloudLibraryTracking = $user->userCookiePreferenceLocalAnalytics;
$userUsage = new UserCloudLibraryUsage();
$userUsage->userId = $user->id;
$userUsage->year = date('Y');
Expand Down
3 changes: 1 addition & 2 deletions code/web/Drivers/HooplaDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -683,9 +683,8 @@ public function trackUserUsageOfHoopla($user): void {
require_once ROOT_DIR . '/sys/Hoopla/UserHooplaUsage.php';
global $library;
$userUsage = new UserHooplaUsage();
$userObj = UserAccount::getActiveUserObj();

$userHooplaTracking = $userObj->userCookiePreferenceLocalAnalytics;
$userHooplaTracking = $user->userCookiePreferenceLocalAnalytics;
global $aspenUsage;
$userUsage->instance = $aspenUsage->getInstance();
$userUsage->userId = $user->id;
Expand Down
3 changes: 1 addition & 2 deletions code/web/Drivers/OverDriveDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -1622,8 +1622,7 @@ function renewCheckout($patron, $recordId, $itemId = null, $itemIndex = null) {
public function trackUserUsageOfOverDrive($user): void {
require_once ROOT_DIR . '/sys/OverDrive/UserOverDriveUsage.php';
$userUsage = new UserOverDriveUsage();
$userObj = UserAccount::getActiveUserObj();
$userOverDriveTracking = $userObj->userCookiePreferenceLocalAnalytics;
$userOverDriveTracking = $user->userCookiePreferenceLocalAnalytics;
global $aspenUsage;
global $library;
$userUsage->instance = $aspenUsage->getInstance();
Expand Down
3 changes: 1 addition & 2 deletions code/web/Drivers/PalaceProjectDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -748,9 +748,8 @@ private function getSettings(User $user = null) {
public function trackUserUsageOfPalaceProject($user): void {
require_once ROOT_DIR . '/sys/PalaceProject/UserPalaceProjectUsage.php';
$userUsage = new UserPalaceProjectUsage();
$userObj = UserAccount::getActiveUserObj();

$userPalaceProjectTracking = $userObj->userCookiePreferenceLocalAnalytics;
$userPalaceProjectTracking = $user->userCookiePreferenceLocalAnalytics;
$userUsage->userId = $user->id;
$userUsage->year = date('Y');
$userUsage->month = date('n');
Expand Down
7 changes: 4 additions & 3 deletions code/web/services/Record/AccessOnline.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,17 @@ function trackRecordUsage(int $sideLoadId, string $recordId): void {
public function trackUserUsageOfSideLoad(int $sideLoadId): void {
require_once ROOT_DIR . '/sys/Indexing/UserSideLoadUsage.php';
$userUsage = new UserSideLoadUsage();
$userObj = UserAccount::getActiveUserObj();
$userSideLoadTracking = $userObj->userCookiePreferenceLocalAnalytics;

global $aspenUsage;
global $library;
$userUsage->instance = $aspenUsage->getInstance();
$userSideLoadTracking = true;
if (UserAccount::getActiveUserId() == false) {
//User is not logged in
$userUsage->userId = -1;
} else {
$userUsage->userId = UserAccount::getActiveUserId();
$userObj = UserAccount::getActiveUserObj();
$userSideLoadTracking = $userObj->userCookiePreferenceLocalAnalytics;
}
$userUsage->sideLoadId = $sideLoadId;
$userUsage->year = date('Y');
Expand Down

0 comments on commit 15a3dc3

Please sign in to comment.