<?php 
	include ("../devildrey33.php");

	// Error al loguear FALSE
	$ErrorLogin = FALSE;

	// Modo de entrada
	$Modo = $_GET['Modo'];
	switch ($Modo) {
		case 'Login' : // Logueando
			$Usuario    = $_POST['username'];
			$Password   = $_POST['password'];
			$Recordarme = $_POST['autologin'];
			$Ocultarme  = $_POST['viewonline'];
			$auth->login($Usuario, $Password, $Recordarme, 1, 0);
			if ($user->data['user_id'] == ANONYMOUS) {
				$ErrorLogin = TRUE;
			}
			break;
		case 'ULogin' : // Deslogueando
			if ($user->data['user_id'] != ANONYMOUS) {
				$user->session_kill();
				$user->session_begin();
			}
			break;
	}
	
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> 
<title>DWL: DReY Windows Lib</title> 
<link href="tabs.css" rel="stylesheet" type="text/css"/> 
<link href="search.css" rel="stylesheet" type="text/css"/> 
<script type="text/javaScript" src="search/search.js"></script> 
<link href="doxygen.css" rel="stylesheet" type="text/css"/> 

<?php 
// Genero los estilos css
GenerarEstilos(true);
// Genero las funciones javascript del menu, historial y descargas
GenerarJavaScript(true);
?>

</head> 
<body onload='Iniciar_devildrey33(); searchBox.OnSelectItem(0);'> 
<!-- Generated by Doxygen 1.7.1 --> 
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script> 
<script type="text/javascript"> 
function hasClass(ele,cls) {
  return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}
 
function addClass(ele,cls) {
  if (!this.hasClass(ele,cls)) ele.className += " "+cls;
}
 
function removeClass(ele,cls) {
  if (hasClass(ele,cls)) {
    var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
    ele.className=ele.className.replace(reg,' ');
  }
}
 
function toggleVisibility(linkObj) {
 var base = linkObj.getAttribute('id');
 var summary = document.getElementById(base + '-summary');
 var content = document.getElementById(base + '-content');
 var trigger = document.getElementById(base + '-trigger');
 if ( hasClass(linkObj,'closed') ) {
   summary.style.display = 'none';
   content.style.display = 'block';
   trigger.src = 'open.png';
   removeClass(linkObj,'closed');
   addClass(linkObj,'opened');
 } else if ( hasClass(linkObj,'opened') ) {
   summary.style.display = 'block';
   content.style.display = 'none';
   trigger.src = 'closed.png';
   removeClass(linkObj,'opened');
   addClass(linkObj,'closed');
 }
 return false;
}
</script> 


<?php 
// Genero el marco y las opciones del menu
GenerarMenu_HTML(); 
// Genero la cabecera con el titulo y el login
Generar_Cabecera($ErrorLogin, $user);
// Genero la parte superior de la tabla que hace de pagina
Generar_TablaPagina_Inicio("DReY WIndows Lib"); 
?>
<br />
