Example #1
0
	static public function getInstance($integration = null) {
		KUNENA_PROFILER ? KunenaProfiler::instance()->start('function '.__CLASS__.'::'.__FUNCTION__.'()') : null;
		if (self::$instance === false) {
			if (! $integration) {
				$integration = KunenaFactory::getConfig ()->integration_access;
			}
			self::$instance = KunenaIntegration::initialize ( 'access', $integration );

			// Load administrators and moderators
			$cache = JFactory::getCache('com_kunena', 'output');
			$data = $cache->get(self::$cacheKey, 'com_kunena');
			if ($data) {
				$data = unserialize($data);
				self::$adminsByCatid = (array)$data['ac'];
				self::$adminsByUserid = (array)$data['au'];
				self::$moderatorsByCatid = (array)$data['mc'];
				self::$moderatorsByUserid = (array)$data['mu'];
			}
			//$my = JFactory::getUser();
			// If values were not cached (or users permissions have been changed), force reload
			if (!$data) { // || ($my->id && $my->authorize('com_kunena', 'administrator') == empty(self::$adminsByUserid[$my->id][0]) )) {
				self::$instance->clearCache();
			}
		}
		KUNENA_PROFILER ? KunenaProfiler::instance()->stop('function '.__CLASS__.'::'.__FUNCTION__.'()') : null;
		return self::$instance;
	}
Example #2
0
	public function __construct() {
		$this->integration = KunenaIntegration::getInstance ('communitybuilder');
		if (! $this->integration || ! $this->integration->isLoaded())
			return;
		$this->joomlaAccess = KunenaIntegration::initialize ( 'access', 'joomla');
		$this->priority = 50;
	}
Example #3
0
	static public function getInstance($integration = null) {
		if (self::$instance === false) {
			$config = KunenaFactory::getConfig ();
			if (! $integration)
				$integration = $config->integration_login;
			self::$instance = KunenaIntegration::initialize ( 'login', $integration );
		}
		return self::$instance;
	}