Ver Mensaje Individual
  #9 (permalink)  
Antiguo 25/05/2005, 09:07
freemojorisin
 
Fecha de Ingreso: mayo-2005
Mensajes: 27
Antigüedad: 21 años, 5 meses
Puntos: 0
Esta es la clase CSession
Código PHP:
class CSession
{
    var 
$Login;
    var 
$PessoaID;
    var 
$Nome;
    var 
$Logado;
    var 
$Perfil;    

    function 
CSession()
    {
        
$this->Login = "";
        
$this->PessoaID = "";
        
$this->Nome = "";
        
$this->Logado = false;  
        
$this->Perfil = "";  
    }
    
    function 
bExiste( $sLogin )
    {
        global 
$tdb;
        
$sSql = "select *,Decode( a04Senha, '" . CHAVE_CRYPT . "') as SenhaDec from nets04ftaPessoa_Login, nett196ftaPessoa 
where a04LoginName = '$sLogin' And a04CdPessoa = a196CdPessoa"
;
                
        
$bRet = $tdb->DoSQL( $sSql );
        
        if (!
$bRet)
        {
            
$msgErro = $tdb->LastError;
            echo(
"Error: La consulta para el login ha fallado<br>$msgErro");
        }
        return( 
$tdb->rsCount > 0);
    }    

    function 
bRecupera()
    {
        global 
$tdb;
        
$this->Login    = $tdb->rs["a04LoginName"];
        
$this->PessoaID = $tdb->rs["a04CdPessoa"] ;
        
$this->Nome     = $tdb->rs["a04LoginName"] ;
        return(
true);
    }
    
    function 
ValidaSenha( $sLogin, $sPassword , $MD5) 
    {
        global 
$tdb;
        if ( 
$this->bExiste( $sLogin ) )
        {
            
$PassServer = md5($tdb->rs['SenhaDec'].$MD5);
            
            if( 
strcasecmp($PassServer , $sPassword) == 0 )
            {
                if ( 
$this->bRecupera() )
                {
                    
$this->Logado = true;
                    return( 
0 );
                }
                else
                    return( 
3 ); 
            }
            else
                return( 
2 );
        }
        else
            {
            return( 
1 );
            }
    }


    function 
isSession()
    {
        return (isset(
$_SESSION["g_Session"]));
    }

    function 
Logon()
    {
        if ( !
isSession() )
            include( 
"login.html" );
    }

    function 
Logoff()
    {
        
$_SESSION = array();
        
session_destroy();
        
header( "Location: login.html" );
    }
} 
La verdad no he podido obtener el valor de la variable de sesion. Por favor ayudenme es muy urgente!!!!!!