Page 1 of 1

Problem with languages

PostPosted: Wed Jun 18, 2008 3:49 am
by fantomasdm
Hi, I have a 2 fields that were storage in DB in crypt mode and with fuction
__display(&$record), __pushValue,pullValue I crypt and decrypt them.
All works fine, but if I add languages section in conf.ini field can't be view
in good mode!
P.S. I look for it.ini....enyone has do it?

Sorry for english!

PostPosted: Wed Jun 18, 2008 7:38 pm
by shannah
Can you describe specifically what happens after you add the languages section to your conf.ini file?

-Steve

PostPosted: Thu Jun 19, 2008 12:47 am
by fantomasdm
I have found the problems,
all function above call function decrypt
Code: Select all
function gdecrypt($input)
{
      $key=$_SESSION["PWDCRYPT"];
      
      

      $td = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_ECB, '');
      $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
      mcrypt_generic_init($td, $key, $iv);

      $encrypted_data = mdecrypt_generic ($td, $input);
      mcrypt_generic_deinit($td);
      return rtrim( $encrypted_data, ( ( ord(substr( $encrypted_data, strlen( $encrypted_data )-1, 1 )) >= 0 and ord(substr( $encrypted_data, strlen( $encrypted_data )-1, 1 ) ) <= 16 ) ? chr(ord(substr( $encrypted_data, strlen( $encrypted_data )-1, 1 ))): null) );
}


but if language is enable in conf.ini module mcrypt going in fall (give me a wrong encrypt!!!)
What is possible problems?

PostPosted: Thu Jun 19, 2008 8:39 am
by shannah
mcrypt going in fall (give me a wrong encrypt!!!)


Are you encrypting / decrypting values that depend on the selected translation? Are you getting any errors? What fields are you encrypting and decrypting? I only see a gdecrypt() method, is there another method you use for encrypting? Do you use the mysql encryption functions at all or is encryption done entirely in PHP? What exactly happens to your application when you turn on languages? -- Do you get an error? Do the fields just not show up at all?

-Steve

PostPosted: Fri Jun 20, 2008 5:41 am
by fantomasdm
Hi!
I have foud problems!!!
crypt data must been save in varbin type in database!!
Thanks for help!!

PostPosted: Fri Jun 20, 2008 10:49 am
by fantomasdm
Hi, is possible to get what language is selected?

PostPosted: Fri Jun 20, 2008 11:55 am
by shannah
<?php
$app =& Dataface_Application::getInstance();
$app->_conf['lang']; // The 2-digit code for the currently selected language

PostPosted: Tue Jun 24, 2008 12:59 am
by fantomasdm
Thanks!! It works very good!!