<?php
/**
 * Logoff
 *
 * @author Eduardo Bonfandini [eduardo@solis.coop.br]
 *
 * @version $Id$
 *
 * \b Maintainers \n
 * Eduardo Bonfandini [eduardo@solis.coop.br]
 * Jamiel Spezia [jamiel@solis.coop.br]
 * Luiz Gregory Filho [luiz@solis.coop.br]
 * Moises Heberle [moises@solis.coop.br]
 *
 * @since
 * Class created on 02/10/2008
 *
 * \b Organization: \n
 * SOLIS - Cooperativa de Solucoes Livres \n
 * The Gnuteca3 Development Team
 *
 * \b CopyLeft: \n
 * CopyLeft (L) 2008 SOLIS - Cooperativa de Solucoes Livres \n
 *
 * \b License: \n
 * Licensed under GPL (for further details read the COPYING file or http://www.gnu.org/copyleft/gpl.html )
 *
 * \b History: \n
 * See history in SVN repository: http://gnuteca.solis.coop.br
 */


class FrmLogoff extends GnutecaForm
{
    public $MIOLO;
    public $module;
    public $action;
    public $grid;
    public $function;
    public $business;


    public function __construct()
    {
        $this->MIOLO    = MIOLO::getInstance();
        $this->module   = MIOLO::getCurrentModule();
        $this->action   = MIOLO::getCurrentAction();
        $this->function = MIOLO::_REQUEST('function');
        $this->business = $this->MIOLO->getBusiness( $this->module, 'BusAuthenticate');
        parent::__construct( _M('Authenticate', $this->module) );
        $this->eventHandler();
        $this->setIcon($this->MIOLO->getUI()->getImage($this->module, 'exit-16x16.png'));
        $this->business->logoff();

        if ((MIOLO::_REQUEST('goto_direct')) && ($goto = MIOLO::_REQUEST('redirect_action')))
        {
            $this->page->redirect( $this->MIOLO->getActionURL($this->module, $goto) );
        }
        else
        {
            $goto = $this->MIOLO->getActionURL($this->module, 'main:myLibrary', null, $opts);
            $this->page->redirect($goto);
        }
    }
}
?>
