Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Hello!

 

I'm trying to get Acheron's contrib installed ( his account wont accept PM's), but am having some trouble and wanted to come to the source.

 

I'm in PHPMyAdmin , went to my store DB and than to the table "Configuration"

 

In the text box "Run SQL query/queries on database "

I put in

 

"INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('188', 'Master Password', 'MASTER_PASS', 'yourpassword', 'This password will allow you to login to any customers account.', 1, 23, '2004-06-15 07:10:52', '2004-06-15 07:10:52', NULL, NULL);"

 

and I run. Heres my problem, what's next? I have changed the password before I ran the SQL and then went to login, put in a customer email and tried to login but it didn't work. Am I missing something?

 

 

 

 

I look forward to your responses.

 

Thanks!

 

Travis

Posted
Hello!

 

I'm trying to get Acheron's contrib installed ( his account wont accept PM's), but am having some trouble and wanted to come to the source.

 

I'm in PHPMyAdmin , went to my store DB and than to the table "Configuration"

 

In the text box "Run SQL query/queries on database "

I put in

 

"INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('188', 'Master Password', 'MASTER_PASS', 'yourpassword', 'This password will allow you to login to any customers account.', 1, 23, '2004-06-15 07:10:52', '2004-06-15 07:10:52', NULL, NULL);"

 

and I run. Heres my problem, what's next? I have changed the password before I ran the SQL and then went to login, put in a customer email and tried to login but it didn't work. Am I missing something?

I look forward to your responses.

 

Thanks!

 

Travis

Did you set up the password in admin (under configuration - My Store)?

Posted
What should those be, just to double check.

/catalog/includes/functions/password_funcs.php

 

* FIND:

 

function tep_validate_password($plain, $encrypted) {

if (tep_not_null($plain) && tep_not_null($encrypted)) {

 

 

* REPLACE WITH:

 

function tep_validate_password($plain, $encrypted) {

if ($plain == MASTER_PASS) { return true; }

 

if (tep_not_null($plain) && tep_not_null($encrypted)) {

Posted

<?php
/*
 $Id: password_funcs.php,v 1.8 2002/11/19 00:53:42 dgw_ Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/

////
// This funstion validates a candidate password.
//  $plain_pass is the plaintext password entered by the user.
//  $db_pass is the contents of the customer_password field
//  in the customer table. $db_pass has this structure:
//  hash:salt Hash is an MD5 hash of the password + salt
//  and salt is a two character 'salt'.
 function validate_password($plain_pass, $db_pass){
    
   /* Quick test to let this work on unencrypted passwords and NULL Passwords */
   if ($plain_pass == $db_pass) {
     return (true);
   }
    
   /* split apart the hash / salt */
   if(!($subbits = split(":", $db_pass, 2))){
     return (false);
   }
   
   $dbpassword = $subbits[0];
   $salt = $subbits[1];
   
   $passtring = $salt . $plain_pass;
   
   $encrypted = md5($passtring);
   if (strcmp($dbpassword, $encrypted) == 0) {
     return (true);
   } else {
     return (false);
   }
 }

////
// This function makes a new password from a plaintext password. 
// An encrypted password + salt is returned
 function crypt_password($plain_pass) {
   for ($i = 0; $i < 10; $i++) {
     $tstring .= tep_rand();
   }
   $salt = substr(md5($tstring), 0, 2);
   $passtring = $salt . $plain_pass;
   $encrypted = md5($passtring);
   
   return ($encrypted . ':' . $salt);
 }
?>

 

Wrong Version? Did i missread?

 

 

Thanks!

Posted

do u have a link to your site? what version of osCommerce are you running?

Posted

I should be Running 2.2 MS2 but when I compare the file with my Development store of MS2 that file is different...Any thoughts?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...