/**
  * Initialize the module. Ensure params and title are read from the database for the module.
  * Note that $params is not available from the global context when called from the login screen.
  * The reason being that this module require administrative access from the current user and that is not available before login.
  */
 static function init()
 {
     if (self::$params) {
         return;
     }
     $modules = array();
     $db =& JFactory::getDBO();
     /**
      * client_id = 1 means admin access
      * client_id = 0 means frontend access
      */
     $query = 'SELECT * ' . ' FROM #__modules AS m' . " WHERE m.module = 'mod_login_server' AND client_id=1";
     $db->setQuery($query);
     $modules = $db->loadObjectList();
     $params = is_array($modules) ? reset($modules)->params : false;
     $params = $params !== false ? new JParameter($params) : null;
     self::$params = $params;
     $title = is_array($modules) ? reset($modules)->title : '';
     self::$title = $title;
 }
<?php

/**
 * @version	1.0.0
 * @copyright	Copyright (C) 2010 Universitly of Geneva
 * @author      laurent.opprecht@unige.ch
 * @license	GNU/GPL
 *
 * Module's entry point.
 */
// no direct access
defined('_JEXEC') or die('Restricted access');
// Include the syndicate functions only once
require_once dirname(__FILE__) . DS . 'helper.php';
$params->def('greeting', 1);
$language =& JFactory::getLanguage();
$language->load('com_user');
modLoginServerHelper::$params = $params;
modLoginServerHelper::login();
$type = modLoginServerHelper::getType();
$return = modLoginServerHelper::getReturnURL();
$user =& JFactory::getUser();
$display_icon = modLoginServerHelper::get_display_icon();
$link_text = modLoginServerHelper::get_link_text();
require JModuleHelper::getLayoutPath('mod_login_server');