mirror of
https://github.com/Findus23/plugin-ProfileAvatar.git
synced 2024-09-18 14:13:46 +02:00
23 lines
741 B
PHP
23 lines
741 B
PHP
<?php
|
|
|
|
namespace Piwik\Plugins\ProfileAvatar;
|
|
|
|
use Piwik\Plugins\Live\VisitorDetailsAbstract;
|
|
|
|
class VisitorDetails extends VisitorDetailsAbstract
|
|
{
|
|
public function initProfile($visits, &$profile)
|
|
{
|
|
$settings = new UserSettings();
|
|
$visitorID = $profile["visitorId"];
|
|
$hash = hash("sha256", $visitorID);
|
|
|
|
if ($settings->dataURLs->getValue()) {
|
|
$chosenGenerator = $settings->avatarType->getValue();
|
|
$generator = GeneratorCollection::getGeneratorClasses($chosenGenerator, $hash);
|
|
$profile['visitorAvatar'] = $generator->asDataUrl();
|
|
} else {
|
|
$profile['visitorAvatar'] = "?module=ProfileAvatar&action=getProfileAvatar&hash=$hash";
|
|
}
|
|
}
|
|
}
|