germ Posted August 19, 2011 Share Posted August 19, 2011 (edited) <double post - been a long time since I did that> Edited August 19, 2011 by germ Quote If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
Guest Posted October 8, 2011 Share Posted October 8, 2011 (edited) Using "Admin Change Customers Password v3.3" I got rid of this issue myself, by renaming the functions in the password_funcs.php (now renamed password_funcs_change_password.php in the Contribution version 3.3) - the new one from the contribution. Those new functions, I renamed as: tep_validate_password_change and tep_encrypt_password_change THEN, in change_password.php: Find around line 53: SET customers_password='" . tep_encrypt_password ($new_password) . "'</p> and CHANGE to: SET customers_password='". tep_encrypt_password_change ($new_password) . "'</p> In my version, I didn't have a line for tep_validate_password, but if you do, then change that one to tep_validate_password_change. Fatal error: Cannot redeclare tep_validate_password() (previously declared in /home/xxxxxx/public_html/acquire_wine/xxxxxx/includes/functions/password_funcs.php:16) in /home/xxxxxxx/public_html/acquire_wine/xxxxx/includes/functions/password_funcs.php on line 29 Edited October 8, 2011 by The Munch Quote Link to comment Share on other sites More sharing options...
Guest Posted October 26, 2011 Share Posted October 26, 2011 (edited) I just want to thank stu2000 (post 65) and kymation (post 64) for this automated emailer.. it works great on my osc 2.3.1! Thank you, it works now, using the following code: // If all is well, make the changes to the database if ($pass == 1) { mysql_query("UPDATE " . TABLE_CUSTOMERS . " SET customers_password='" . tep_encrypt_password ($new_password) . "' WHERE customers_id='" . $customer_id . "' "); // Get the customer's information for the success message $customer_name_query = mysql_query("SELECT customers_firstname, customers_lastname, customers_email_address FROM " . TABLE_CUSTOMERS . " WHERE customers_id='" . $customer_id . "' "); $customer_name = mysql_fetch_array ($customer_name_query); define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - New Password'); define('EMAIL_PASSWORD_REMINDER_BODY', 'A new password was requested for your account at ' . STORE_NAME . '.' . "\n\n" . 'Your new password to \'' . STORE_NAME . '\' is:' . "\n\n" . ' %s' . "\n\n"); tep_mail($customer_name['customers_firstname'] . " " . $customer_name['customers_lastname'], $customer_name['customers_email_address'], EMAIL_PASSWORD_REMINDER_SUBJECT, nl2br(sprintf(EMAIL_PASSWORD_REMINDER_BODY, $new_password)), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } } Email received: A new password was requested for your account at Company Name. Your new password to 'Company Name' is: 12345 Just need to do a few cosmetic changes etc and should be perfect. $customer_data is used to pull an array of all customers. It won't be valid for the current customer when the password has been changed -- that's in the POST section. You need to add your own SQL or change the existing to retrieve the correct customer information. Try this around Line 51: $customer_name_query = mysql_query("SELECT customers_firstname, customers_lastname FROM " . TABLE_CUSTOMERS . " WHERE customers_id='" . $customer_id . "' "); $customer_name = mysql_fetch_array ($customer_name_query); Change to: $customer_name_query = mysql_query("SELECT customers_firstname, customers_lastname, customers_email_address FROM " . TABLE_CUSTOMERS . " WHERE customers_id='" . $customer_id . "' "); $customer_name = mysql_fetch_array ($customer_name_query); Then use $customer_name['customers_email_address'] etc. to populate your email. I would put the email code up in this section as well; the part you referenced was supposed to be for error/success messages. Regards Jim Edit: Apparently I was doing this at the same time the parent post was changed. I was referring to the first block of code -- the second code block is very close tho what I was suggesting. That really should work if you retrieve the email address. Edited October 26, 2011 by The Munch Quote Link to comment Share on other sites More sharing options...
MrE03 Posted February 14, 2012 Share Posted February 14, 2012 I installled the mod and it was fairly easy, however when I'm viewing change_password.php the admin page will just be blank. Quote Link to comment Share on other sites More sharing options...
nfteam Posted November 30, 2012 Share Posted November 30, 2012 This contribution allows you to change a customer's password from your Admin. I noticed there isn't a support thread for this one, so here it is. I'll post version 3.0 in a minute. I've updated the code to fix a couple of bugs, including a global variable conflict with 2.2rc1. I've also added an automatic password generator and a button to use this function from the existing Customers page. The whole thing could probably be integrated into the Customers page, but I'm not going there. Feel free if you want to. This version could also use some help with translations. If you can do one, please upload a complete copy to the Contributions page. The contribution can be found here. Regards Jim Add on works very good on PHP 5.2. It needs some corrections with PHP 5.3 since eregi() is no longer valid Deprecated: Function eregi() is deprecated in .... Add on still does the work but it shows above error in admin section. Did someone get fix for PHP 5.3? Thanks Quote Link to comment Share on other sites More sharing options...
nfteam Posted December 3, 2012 Share Posted December 3, 2012 Add on works very good on PHP 5.2. It needs some corrections with PHP 5.3 since eregi() is no longer valid Deprecated: Function eregi() is deprecated in .... Add on still does the work but it shows above error in admin section. Did someone get fix for PHP 5.3? Thanks Found answer for me own question. http://www.oscommerce.com/forums/topic/382845-need-help-to-resolve-problem-in-generalphp/ Post #5 Thanks Heather Quote Link to comment Share on other sites More sharing options...
Irin Posted March 24, 2014 Share Posted March 24, 2014 This add on doesn't work in v2.3.3. Quote Link to comment Share on other sites More sharing options...
Irin Posted March 25, 2014 Share Posted March 25, 2014 Uploaded a new version 4.0 that works in v2.3.3 and up. Quote Link to comment Share on other sites More sharing options...
b2995 Posted September 30, 2014 Share Posted September 30, 2014 Hi! Installations was a breeze and everything seems to be working fantastic on the Admin side. I get confirmation on the Admin side that the password has been changed, but when I try to use the new password on the Customer side, it get "Error: No match for E-Mail Address and/or Password." Any suggestions? Quote Link to comment Share on other sites More sharing options...
b2995 Posted September 30, 2014 Share Posted September 30, 2014 SORRY! I got it.... I typed in the email address wrong..duh... (w00t) Quote Link to comment Share on other sites More sharing options...
Patty Posted May 31, 2015 Share Posted May 31, 2015 Almost everything working fine. This is such a useful contribution it should be made part of the core code! Tks for sharing. :) The only issue I found is that no email is being sent to client after password is reset. I'm using v2.3.4 and PHP 5.2.17 Can anybody help with this? TIA! Thank you, it works now, using the following code: // If all is well, make the changes to the database if ($pass == 1) { mysql_query("UPDATE " . TABLE_CUSTOMERS . " SET customers_password='" . tep_encrypt_password ($new_password) . "' WHERE customers_id='" . $customer_id . "' "); // Get the customer's information for the success message $customer_name_query = mysql_query("SELECT customers_firstname, customers_lastname, customers_email_address FROM " . TABLE_CUSTOMERS . " WHERE customers_id='" . $customer_id . "' "); $customer_name = mysql_fetch_array ($customer_name_query); define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - New Password'); define('EMAIL_PASSWORD_REMINDER_BODY', 'A new password was requested for your account at ' . STORE_NAME . '.' . "\n\n" . 'Your new password to \'' . STORE_NAME . '\' is:' . "\n\n" . ' %s' . "\n\n"); tep_mail($customer_name['customers_firstname'] . " " . $customer_name['customers_lastname'], $customer_name['customers_email_address'], EMAIL_PASSWORD_REMINDER_SUBJECT, nl2br(sprintf(EMAIL_PASSWORD_REMINDER_BODY, $new_password)), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } }Email received: A new password was requested for your account at Company Name. Your new password to 'Company Name' is: 12345Just need to do a few cosmetic changes etc and should be perfect. Quote Patty Link to comment Share on other sites More sharing options...
Patty Posted June 1, 2015 Share Posted June 1, 2015 Can anybody shed a light, please?? I really can't figure out what's wrong. I need help! :( Quote Patty Link to comment Share on other sites More sharing options...
De Dokta Posted June 1, 2015 Share Posted June 1, 2015 Can anybody shed a light, please?? I really can't figure out what's wrong. I need help! :( Go to Admin -> Configuration -> My Store and enter there under "Store Name" the name of your store. Quote Link to comment Share on other sites More sharing options...
Patty Posted June 1, 2015 Share Posted June 1, 2015 Go to Admin -> Configuration -> My Store and enter there under "Store Name" the name of your store. Tks for your reply, but the store name was added. Any other idea? Quote Patty Link to comment Share on other sites More sharing options...
De Dokta Posted June 2, 2015 Share Posted June 2, 2015 @@Patty Ok, the version I use is a little bit different: // If all is well, make the changes to the database if ($pass == 1) { tep_db_query("update customers set customers_password='" . tep_encrypt_password ($new_password) . "' where customers_id='" . (int)$customer_id . "'"); // Get the customer's information for the success message $customer_name_query = tep_db_query("select customers_firstname, customers_lastname, customers_guest from customers where customers_id='" . (int)$customer_id . "' and customers_guest = '0'"); $customer_name = tep_db_fetch_array($customer_name_query); tep_mail($customer_name['customers_firstname'] . " " . $customer_name['customers_lastname'], $customer_name['customers_email_address'], EMAIL_PASSWORD_REMINDER_SUBJECT, nl2br(sprintf(EMAIL_PASSWORD_REMINDER_BODY, $new_password)), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } } // End POST section And this part: define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - New Password'); define('EMAIL_PASSWORD_REMINDER_BODY', 'A new password was requested for your account at ' . STORE_NAME . '.' . "\n\n" . 'Your new password to \'' . STORE_NAME . '\' is:' . "\n\n" . ' %s' . "\n\n"); is moved to admin/includes/languages/Your_language/change_password.php - where it belongs to! J.J. Quote Link to comment Share on other sites More sharing options...
Patty Posted June 2, 2015 Share Posted June 2, 2015 @@De Dokta Tks again for your reply. I moved the language strings to the language file as you suggested, everything else is pretty much the same. But still no email is being sent. I checked the server's log and it's not being sent at all. But I do receive other emails from the store, so email function is working. What else could be wrong? Quote Patty Link to comment Share on other sites More sharing options...
aespinal2 Posted December 17, 2015 Share Posted December 17, 2015 I've installed your contrib just this minute and get an error when clicking on "change password": Fatal error: Call to undefined function tep_create_random_value() in /home/alltirescenter/public_html/admin/change_password.php on line 110 Ani help will be appreciated. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.