<?php
//
// +---------------------------------------------------------------------------+
// | Nitro :: Module :: LogOn |
// +---------------------------------------------------------------------------+
// | Copyright (c) 2006 June Systems BV |
// +---------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or modify it |
// | under the terms of the GNU Lesser General Public License as published by |
// | the Free Software Foundation; either version 2.1 of the License, or (at |
// | your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public License |
// | along with this library; if not, write to the Free Software Foundation, |
// | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
// +---------------------------------------------------------------------------+
// | Authors: Siggi Oskarsson <hide@address.com> |
// | Jesper Avot <hide@address.com |
// +---------------------------------------------------------------------------+
//
// $Id: Logon.inc.php 229 2008-04-17 09:20:31Z oli $
//
// Nitro's default LogOn class
//
/**
* This file contains the Nitro Logon Module
*
* @author Siggi Oskarsson
* @copyright June Systems BV, 2006
* @version $Revision: 1.4 $
* @package Modules
*/
/**
* Include prototype module class
*/
require_once "Nitro/Module.inc.php";
/**
* Logon module class
*
* @package Modules
* @author Siggi Oskarsson <hide@address.com>
* @author Jesper Avot <hide@address.com>
* @copyright June Systems BV, 2006
* @access public
*/
class NitroModuleLogon extends NitroModule {
/**
* @var string Module ID string
*/
var $IDString = "NitroModuleLogon";
/**
* LogOn module constructor function
*
* @param string $ObjectID String with the current ObjectID
* @param mixed $Settings Array with the Module Settings, default is FALSE
* @access public
*/
function NitroModuleLogon($ObjectID, $Settings = FALSE)
{
/**
* Call the parent constructor
*/
parent::NitroModule();
/**
* Set ObjectID and ModuleSettings
*/
$this->ObjectID = $ObjectID;
$this->SetModuleSettings($Settings);
}
/**
* GetModuleRunTimeConfiguration
*
* @return array Array for the form libraries.
*/
function GetModuleRuntimeConfiguration()
{
return Array("URL" => "TEXT/Lable=" . Language('URL'));
}
function PreProcess()
{
// Reset Session Expired,
// should not be set if user starts clicking around the site and
// uses the login page iso the login screen on the page he was viewing
$this->Sess->SessionExpired = FALSE;
}
/**
* Draw function
*
* @param mixed $RunTimeSettings The current RunTimeSettings.
* @return mixed When a user is nog logged on he gets the login screen, when user is logged on already, het get's a notice.
*/
function Draw($RuntimeSettings = FALSE)
{
if ($this->Sess->UserID) {
if (!$RV = GetObjectLink("NitroLoggedOnMessage")) {
$RV = file_get_contents(NITRO_PATH . "Defaults/Texts/LoggedOnMessage.html");
}
} else {
$RV = $this->Sess->DrawLoginScreen();
}
return $RV;
}
}
?>