Login   Register  
PHP Classes
elePHPant
Icontem

Class 'usuarios' not found

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      My Rad 4 PHP  >  All threads  >  Class 'usuarios' not found  >  (Un) Subscribe thread alerts  
Subject:Class 'usuarios' not found
Summary:I got this error after my first attempt to login...
Messages:4
Author:Fred
Date:2013-03-16 17:45:53
Update:2013-03-17 03:11:44
 

  1. Class 'usuarios' not found   Reply  
Picture of Fred
Fred
2013-03-16 17:45:53
Fatal error: Class 'usuarios' not found in C:\<obfuscated>\radtest\login.php on line 39

I can't get any other reference to usuarios in all php files of the project, could you help me point the mistake?

Thank you

  2. Re: Class 'usuarios' not found   Reply  
Picture of Jorge Prado
Jorge Prado
2013-03-16 18:00:31 - In reply to message 1 from Fred
Delete the line number 39, please report the error.

  3. Re: Class 'usuarios' not found   Reply  
Picture of Fred
Fred
2013-03-16 20:55:03 - In reply to message 2 from Jorge Prado
Ok, the code is no more giving back an error, but the app says 'El usuario no existe' as the credentials are well in the table I check as 'Es seguridad'.
Passwords are coded with the mysql password function, I hope this is the right method...
This made me wonder about the request that could have been processed and add log in datamanager->consulta, then I see you don't try using the password crypted value. So, it could be a good idea, anyway, I must choose another solution for this time as I am too short in time. I will try it again later as I find it promising. It will be still more interesting if you extrat all labels in a config file (using something like $_LABELS['page.labelkey'] in the code). This will allow a rapid localization (I'm french for instance and if I can manage foreing words in the code, it's not the case of final users...).

Thank's again for your work,

Fred

  4. Re: Class 'usuarios' not found   Reply  
Picture of Jorge Prado
Jorge Prado
2013-03-17 03:11:44 - In reply to message 3 from Fred
if I understand you use a function in MySQL to encrypt password field in the table then the alternative would encrypt the string entered by the user using the DataManager.
This would be the login.php file with the modification to work as you need.

if(isset($_POST["procesar"]))
{
$usuario = $_POST["user"];
$clave = $_POST["clave"];
$dc=new datacontex();
$objsecur = $dc->tablas[$GLOBALS["tablasecur"]];
//USING GLOBAL OBJECT CONNECTION
$objDataManager=$GLOBALS["coneccion"];
//convert the entered password to an encrypted string that is returned by
//mysql, md5 put only for example, but it is not
//recommended to use md5 and that use Windows as OS and I can not use the
//mysql funcion ENCRIPT()
$cript_password =$objDataManager->fetch_array($objDataManager->consulta("SELECT md5(\"".$clave."\")"));

$clave = $cript_password[0];
$aparametros=array();
$aparametros[]=array("campo"=>$GLOBALS["cmpusuario"], "valor"=>"='".$usuario."'");
$aparametros[]=array("campo"=>$GLOBALS["cmpclave"], "valor"=>"='".$clave."'");

$objsecur->filter($aparametros);
$objact=$objsecur->registros[0];
if($objsecur->numregs==0)
$err[]="Wrong User or password ";
else
if($objsecur->numregs==1)
{
$_SESSION["useract"]=$objact->toarray();
header("Location: index.php");
}
}