I want to show the visitor log/profile only to superadmins - it should be inaccessible to others, so I have changed the disable_visitor_log setting to 0.
I think the best way is to write a plugin. I figured out how to check if I’m superadmin.
I think I need to either:
- Make the return value of Live::checkIsVisitorLogEnabled() to return false; or
- Make new SystemSettings()->disableVisitorLog->getValue() return true; or
- Make Config::__get(disable_visitor_log) return true;
Any suggestions how to do this without modifying Matomo’s code?
namespace Piwik\Plugins\ConditionallyShowVisitorLog;
use Piwik\Access;
class ConditionallyShowVisitorLog extends \Piwik\Plugin {
public function postLoad() {
if (Access::getInstance()->hasSuperUserAccess()) {
error_log(__FILE__ . '::You are Super admin!');
//Enable the visitor log/profile for this users session.
}
}
}