| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/nice/plugins/kunena/comprofiler/ |
Upload File : |
<?php
/**
* Kunena Plugin
*
* @package Kunena.Plugins
* @subpackage Comprofiler
*
* @copyright Copyright (C) 2008 - 2025 Kunena Team. All rights reserved.
* @license https://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link https://www.kunena.org
**/
defined('_JEXEC') or die();
use CBLib\Core\CBLib;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Plugin\PluginHelper;
use Kunena\Forum\Libraries\Factory\KunenaFactory;
use Kunena\Forum\Libraries\Forum\KunenaForum;
use Kunena\Forum\Plugin\Kunena\Comprofiler\KunenaAccessComprofiler;
use Kunena\Forum\Plugin\Kunena\Comprofiler\KunenaAvatarComprofiler;
use Kunena\Forum\Plugin\Kunena\Comprofiler\KunenaActivityComprofiler;
use Kunena\Forum\Plugin\Kunena\Comprofiler\KunenaLoginComprofiler;
use Kunena\Forum\Plugin\Kunena\Comprofiler\KunenaPrivateComprofiler;
use Kunena\Forum\Plugin\Kunena\Comprofiler\KunenaProfileComprofiler;
/**
* Class PlgKunenaComprofiler
*
* @since Kunena 6.0
*/
class PlgKunenaComprofiler extends CMSPlugin
{
/**
* @var string CB version 2.10 works with Php 8.1 and with Joomla! 5.2
* @since Kunena 6.0
*/
public $minCBVersion = '2.10';
/**
* plgKunenaComprofiler constructor.
*
* @param DispatcherInterface $subject The object to observe
* @param array $config An optional associative array of configuration settings.
* Recognized key values include 'name', 'group', 'params', 'language'
* (this list is not meant to be comprehensive).
*
* @throws Exception
* @since Kunena 6.0
*/
public function __construct(&$subject, $config = [])
{
global $_PLUGINS;
// Do not load if Kunena version is not supported or Kunena is offline
if (!(class_exists('Kunena\Forum\Libraries\Forum\KunenaForum') && KunenaForum::isCompatible('6.4') && KunenaForum::enabled())) {
return;
}
$app = Factory::getApplication();
// Do not load if CommunityBuilder is not installed
if (
(!file_exists(JPATH_SITE . '/libraries/CBLib/CBLib/Core/CBLib.php')) ||
(!file_exists(JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php'))
) {
return;
}
require_once JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php';
$this->loadLanguage('plg_kunena_comprofiler.sys', JPATH_ADMINISTRATOR) || $this->loadLanguage('plg_kunena_comprofiler.sys', JPATH_ADMINISTRATOR . '/components/com_kunena');
if (version_compare($this->minCBVersion, CBLib::version(), '>=')) {
if ($app->isClient('administrator')) {
$app->enqueueMessage(Text::sprintf('PLG_KUNENA_COMPROFILER_WARN_VERSION', $this->minCBVersion), 'notice');
}
return;
}
cbimport('cb.html');
cbimport('language.front');
$_PLUGINS->loadPluginGroup('user');
parent::__construct($subject, $config);
}
/**
* @param string $type type
* @param null $view view
* @param null $params params
*
* @return void
*
* @throws Exception
* @since Kunena 6.0
*/
public function onKunenaDisplay(string $type, $view = null, $params = null): void
{
$integration = KunenaFactory::getProfile();
if (!$integration instanceof KunenaProfileComprofiler) {
return;
}
switch ($type) {
case 'start':
$integration->open();
break;
case 'end':
$integration->close();
}
}
/**
* @param string $context context
* @param int $item items
* @param object $params params
* @param int $page page
*
* @return void
*
* @throws Exception
* @since Kunena 6.0
*/
public function onKunenaPrepare(string $context, &$item, object $params, $page = 0): void
{
if ($context == 'kunena.user') {
$triggerParams = ['userid' => $item->userid, 'userinfo' => &$item];
$integration = KunenaFactory::getProfile();
if ($integration instanceof KunenaProfileComprofiler) {
KunenaProfileComprofiler::trigger('profileIntegration', $triggerParams);
}
}
}
/**
* Get Kunena access control object.
*
* @return KunenaAccessComprofiler|void
*
* @since Kunena 6.0
*/
public function onKunenaGetAccessControl()
{
if (!isset($this->params)) {
return;
}
if (!$this->params->get('access', 1)) {
return;
}
return new KunenaAccessComprofiler($this->params);
}
/**
* Get Kunena login integration object.
*
* @return KunenaLoginComprofiler|void
*
* @since Kunena 6.0
*/
public function onKunenaGetLogin()
{
if (!isset($this->params)) {
return;
}
if (!$this->params->get('login', 1)) {
return;
}
return new KunenaLoginComprofiler($this->params);
}
/**
* Get Kunena avatar integration object.
*
* @return KunenaAvatarComprofiler|void
*
* @since Kunena 6.0
*/
public function onKunenaGetAvatar()
{
if (!isset($this->params)) {
return;
}
if (!$this->params->get('avatar', 1)) {
return;
}
return new KunenaAvatarComprofiler($this->params);
}
/**
* Get Kunena profile integration object.
*
* @return KunenaProfileComprofiler|void
*
* @since Kunena 6.0
*/
public function onKunenaGetProfile()
{
if (!isset($this->params)) {
return;
}
if (!$this->params->get('profile', 1)) {
return;
}
return new KunenaProfileComprofiler($this->params);
}
/**
* Get Kunena private message integration object.
*
* @return KunenaPrivateComprofiler|void
*
* @since Kunena 6.0
*/
public function onKunenaGetPrivate()
{
global $_PLUGINS;
if (!isset($this->params)) {
return;
}
if (!$_PLUGINS->getLoadedPlugin( 'user', 'pms.mypmspro' )) {
return;
}
if (!$this->params->get('private', 1)) {
return;
}
return new KunenaPrivateComprofiler($this->params);
}
/**
* Get Kunena activity stream integration object.
*
* @return KunenaActivityComprofiler|void
*
* @throws Exception
* @since Kunena 6.0
*/
public function onKunenaGetActivity()
{
if (!isset($this->params)) {
return;
}
if (!$this->params->get('activity', 1)) {
return;
}
return new KunenaActivityComprofiler($this->params);
}
}