Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Password format error


Paulz

Recommended Posts

Im getting passwords sent to users in the form of

 

Your password is: ?kw?I??

 

I want to change the characters so they are easily typed:

 

This has something to do with the mod:

signup_confirm_email

 

maybe something to do with the following code edit in catalog/create_account_process.php

 

>>>>>>>

Near the top, find:

 

 

require('includes/application_top.php');

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT_PROCESS);

 

if (!isset($HTTP_POST_VARS['action'])) {

tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT));

}

 

Below it add:

 

$newpass = tep_create_random_value(ENTRY_PASSWORD_MIN_LENGTH);

$encrypted_password = tep_encrypt_password($newpass);

 

A little below that, find:

 

$password = tep_db_prepare_input($HTTP_POST_VARS['password']);

$confirmation = tep_db_prepare_input($HTTP_POST_VARS['confirmation']);

 

Change these 2 lines to:

 

// $password = tep_db_prepare_input($HTTP_POST_VARS['password']);

// $confirmation = tep_db_prepare_input($HTTP_POST_VARS['confirmation']);

$password = $newpass;

$confirmation = $newpass;

 

Find:

 

$passlen = strlen($password);

if ($passlen < ENTRY_PASSWORD_MIN_LENGTH) {

$error = true;

$entry_password_error = true;

} else {

$entry_password_error = false;

}

 

if ($password != $confirmation) {

$error = true;

$entry_password_error = true;

}

 

 

Change it to:

 

/*

$passlen = strlen($password);

if ($passlen < ENTRY_PASSWORD_MIN_LENGTH) {

$error = true;

$entry_password_error = true;

} else {

$entry_password_error = false;

}

 

if ($password != $confirmation) {

$error = true;

$entry_password_error = true;

}

*/

 

Find:

 

$email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT

 

Change it to:

 

$email_text .= EMAIL_WELCOME . EMAIL_USERNAME . 'Your password is: <b>' . stripslashes($plain_pass) . '</b>' . "\n\n" . EMAIL_TEXT . EMAIL_CONTACT

 

Also change the line below it to read (Added By Ricky Woodbridge):

 

tep_mail($name, $email_address, $email_text, $email_subject, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

anyhelp appreciated

Link to comment
Share on other sites

What default language are you using?

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

possibly something in the encryption

 

$encrypted_password = tep_encrypt_password($newpass);

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Ive removed the mod signup_confirm_email and just realized Ive got the same problem with password forgotten email?

 

sending the same password format : eg: S?Cjt?T

 

I dont appear to have any other Character problems anywhere?

 

could this be a problem with my server ?

 

 

Also Im using osc2.2ms1

Link to comment
Share on other sites

Tried everything I can think of Its nothing obvious, the only setting I can think that relates to it is in includes/languages/english.php

 

// charset for web pages and emails

define('CHARSET', 'iso-8859-1');

 

But that appears ok???

 

I decided to change the temp password to digits as below:

 

$new_password = tep_create_random_value(ENTRY_PASSWORD_MIN_LENGTH,'digits');

 

This worked OK.

 

Id still like to resolve this problem, any help would be much appreciated.

 

Regards

 

Paul

Link to comment
Share on other sites

For anyone that has the same issue I resolved the problem.

 

as Im using osc2.2ms1, I checked out the /includes/languages/english.php in

2.2CVS to see if there any changes.

 

it suggested for available locales type locale -a on the server.

which I did and discovered as

 

en_GB

en_GB.iso885915

 

so I changed from : @setlocale(LC_TIME, 'en_GB.ISO_8859-1');

 

to @setlocale(LC_TIME, 'en_GB.iso885915');

 

and its worked! :D Normal passwords at last

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...