<?php
/*************************************************************************/
/* ROLLER CMS - ADVANCED PORTAL MANAGEMENT SYSTEM */
/* ============================================ */
/* */
/* Copyright (c) 2005 by Federico Campoli (hide@address.com) */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/*************************************************************************/
session_start();
include($_SERVER["DOCUMENT_ROOT"].'/common_files/template/main_app_header.inc.php');
if (!$HTTP_POST_VARS["login"])
{
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<body>
<p>Per favore inserisci username e password per accedere all'area di amministrazione</p>
<form action="<?php echo $PHP_SELF;?>" method="POST">
<table>
<tr>
<td>Username:</td>
<td><input type="text" name="username"> </td>
</tr>
<tr>
<td>Password </td>
<td><input type="password" name="password"> </td>
</tr>
<tr>
<td><input type="submit"></td>
<td><input type="reset"></td>
</tr>
</table>
<input type="hidden" name="login" value="true">
</form>
</body>
</html>
<?php
}
else
{
/******************************************************
Logon all'area di amministrazione.
Viene richiamata la funzione pgplsql di libreria
per l'autenticazione utenti
*******************************************************/
$str_sql="select ".$table_prefix."_lib_authadm_2('".$HTTP_POST_VARS["username"]."','".$HTTP_POST_VARS["password"]."') as auth";
$query_results=pg_query($data_conn,$str_sql);
$row=pg_fetch_array($query_results);
if ($row["auth"]==0)
{
header("Location: index.php");
}
else
{
$_SESSION['logged']=-1;
header("Location: main/index.php");
}
}
include($_SERVER["DOCUMENT_ROOT"].'/common_files/template/main_app_footer.inc.php');
?>