Main Page | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

login.php

Go to the documentation of this file.
00001 <?
00002 /*
00003  *   This file is part of PhpCompta.
00004  *
00005  *   PhpCompta is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU General Public License as published by
00007  *   the Free Software Foundation; either version 2 of the License, or
00008  *   (at your option) any later version.
00009  *
00010  *   PhpCompta is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with PhpCompta; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
00020 include_once ("ac_common.php");
00024 /* $Revision: 1.18 $ */
00025 
00026 include_once ("postgres.php");
00027 include_once("debug.php");
00028 
00029 
00030 if (  isset ($_POST["p_user"] ) ) {
00031   echo_debug('login.php',__LINE__,"user is set");
00032   $g_user=$_POST["p_user"];
00033   $g_pass=$_POST["p_pass"];
00034   $_SESSION['g_user']=$g_user; 
00035   $_SESSION['g_pass']=$g_pass;
00036 
00037   // Verif if User and Pass match DB
00038   // if no, then redirect to the login page
00039 $rep=DbConnect();
00040 include_once ("class_user.php");
00041 $User=new cl_user($rep);
00042 $User->Check();
00043 
00044   echo "<META HTTP-EQUIV=\"REFRESH\" content=\"0;url=user_login.php?PHPSESSID=" . $_REQUEST["PHPSESSID"] . "\">";
00045 
00046 } else
00047 {
00048   $rep=DbConnect();
00049   include_once ("class_user.php");
00050   $User=new cl_user($rep);
00051   $User->Check();
00052   
00053   echo "<META HTTP-EQUIV=\"REFRESH\" content=\"0;url=user_login.php?PHPSESSID=" . $_REQUEST["PHPSESSID"] . "\">";  
00054     // }
00055 }
00056 html_page_stop();
00057 ?>