//$Revision$
/*
* This file is part of PhpCompta.
*
* PhpCompta 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, or
* (at your option) any later version.
*
* PhpCompta 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
//$Revision$
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*++
* function : CheckUser
* Parameter : none
* return : not use
* Description :
* Check if user is active and exists in the
* repository
* Automatically redirect
*
++*/
/* obsolete function CheckUser()
{
global $g_user,$g_pass,$IsValid;
echo_debug(__FILE__,__LINE__,"CheckUser");
$res=0;
$pass5=md5($g_pass);
if ( $IsValid == 1 ) { return; }
$cn=DbConnect("account_repository");
if ( $cn != false ) {
$sql="select ac_users.use_login,ac_users.use_active, ac_users.use_pass
from ac_users
where ac_users.use_login='$g_user'
and ac_users.use_active=1
and ac_users.use_pass='$pass5'";
echo_debug(__FILE__,__LINE__,"Sql = $sql");
$ret=pg_exec($cn,$sql);
$res=pg_NumRows($ret);
echo_debug(__FILE__,__LINE__,"Number of found rows : $res");
}
if ( $res == 0 ) {
echo '';
echo "
";
echo "