Exemple #1
0
 function display()
 {
     KunenaForum::setup();
     KunenaFactory::loadLanguage();
     KunenaFactory::loadLanguage('com_kunena.templates');
     $this->params->def('greeting', 1);
     $this->document = JFactory::getDocument();
     $this->me = KunenaFactory::getUser();
     $token = JUtility::getToken();
     // Load CSS only once
     if (self::$cssadded == false) {
         $this->document->addStyleSheet(JURI::root(true) . '/modules/mod_kunenalogin/tmpl/css/kunenalogin.css');
         self::$cssadded = true;
     }
     $cache = JFactory::getCache('com_kunena', 'output');
     if ($cache->start("{$this->me->userid}.{$token}", 'mod_kunenalogin')) {
         return;
     }
     $login = KunenaLogin::getInstance();
     if (!$this->me->exists()) {
         $this->type = 'login';
         $this->login = null;
         if ($login) {
             $this->lostPasswordUrl = $login->getResetURL();
             $this->lostUsernameUrl = $login->getRemindURL();
             $this->registerUrl = $login->getRegistrationURL();
             $this->remember = JPluginHelper::isEnabled('system', 'remember');
         }
     } else {
         $this->type = 'logout';
         $this->logout = null;
         $this->lastvisitDate = new KunenaDate($this->me->lastvisitDate);
         if ($login) {
             $this->logout = $login->getLogoutURL();
             $this->recentPosts = JHtml::_('kunenaforum.link', 'index.php?option=com_kunena&view=topics', JText::_('MOD_KUNENALOGIN_RECENT'));
             $this->myPosts = JHtml::_('kunenaforum.link', 'index.php?option=com_kunena&view=topics&layout=user&mode=default', JText::_('MOD_KUNENALOGIN_MYPOSTS'));
         }
         // Private messages
         $private = KunenaFactory::getPrivateMessaging();
         $this->privateMessages = '';
         if ($this->params->get('showmessage') && $private) {
             $count = $private->getUnreadCount($this->me->userid);
             $this->privateMessages = $private->getInboxLink($count ? JText::sprintf('COM_KUNENA_PMS_INBOX_NEW', $count) : JText::_('COM_KUNENA_PMS_INBOX'));
         }
     }
     $this->return = $this->getReturnURL();
     require JModuleHelper::getLayoutPath('mod_kunenalogin');
     $cache->end();
 }
<?php

/**
 * Kunena Login Module
 * @package Kunena.mod_kunenalogin
 *
 * @copyright (C) 2008 - 2012 Kunena Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.kunena.org
 **/
defined('_JEXEC') or die;
// Kunena detection and version check
$minKunenaVersion = '2.0';
if (!class_exists('KunenaForum') || !KunenaForum::isCompatible($minKunenaVersion)) {
    echo JText::sprintf('MOD_KUNENALOGIN_KUNENA_NOT_INSTALLED', $minKunenaVersion);
    return;
}
// Kunena online check
if (!KunenaForum::enabled()) {
    echo JText::_('MOD_KUNENALOGIN_KUNENA_OFFLINE');
    return;
}
require_once dirname(__FILE__) . '/class.php';
$params = (object) $params;
$module = (object) $module;
$instance = new ModKunenaLogin($module, $params);
$instance->display();
<?php

/**
 * @version $Id: mod_kunenalogin.php 4429 2011-02-17 11:30:49Z mahagr $
 * Kunena Login Module
 * @package Kunena login
 *
 * @Copyright (C)2010-2011 Kunena Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.kunena.org
 */
defined('_JEXEC') or die;
// Kunena detection and version check
$minKunenaVersion = '1.6.3';
if (!class_exists('Kunena') || Kunena::versionBuild() < 4344) {
    echo JText::sprintf('MOD_KUNENALOGIN_KUNENA_NOT_INSTALLED', $minKunenaVersion);
    return;
}
// Kunena online check
if (!Kunena::enabled()) {
    echo JText::_('MOD_KUNENALOGIN_KUNENA_OFFLINE');
    return;
}
require_once dirname(__FILE__) . DS . 'class.php';
$params = (object) $params;
$modKunenaLogin = new ModKunenaLogin($params);
$modKunenaLogin->display();