Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Master Password contribution


newbie2009

Recommended Posts

Hi again,

 

Trying to install Master Password contribution which is one minute install, but i get this error

 

 

Parse error: syntax error, unexpected '}' in D:\www\includes\functions\password_funcs.php on line 30

 

This is my password_funcs.php

// This funstion validates a plain text password with an
// encrpyted passwordfunction tep_validate_password($plain, $encrypted) {
if ($plain == MASTER_PASS) { return true; }

if (tep_not_null($plain) && tep_not_null($encrypted)) {
// split apart the hash / salt
  $stack = explode(':', $encrypted);

  if (sizeof($stack) != 2) return false;

  if (md5($stack[1] . $plain) == $stack[0]) {
	return true;
  }
}

return false;
 }

////
// This function makes a new password from a plaintext password. 
 function tep_encrypt_password($plain) {
$password = '';

for ($i=0; $i<10; $i++) {
  $password .= tep_rand();
}

$salt = substr(md5($password), 0, 2);

$password = md5($salt . $plain) . ':' . $salt;

return $password;
 }
?>

 

 

It used to work on MS2.

Link to comment
Share on other sites

Hi again,

 

Trying to install Master Password contribution which is one minute install, but i get this error

 

 

Parse error: syntax error, unexpected '}' in D:\www\includes\functions\password_funcs.php on line 30

 

This is my password_funcs.php

// This funstion validates a plain text password with an
// encrpyted passwordfunction tep_validate_password($plain, $encrypted) {
if ($plain == MASTER_PASS) { return true; }

if (tep_not_null($plain) && tep_not_null($encrypted)) {
// split apart the hash / salt
  $stack = explode(':', $encrypted);

  if (sizeof($stack) != 2) return false;

  if (md5($stack[1] . $plain) == $stack[0]) {
	return true;
  }
}

return false;
 }

////
// This function makes a new password from a plaintext password. 
 function tep_encrypt_password($plain) {
$password = '';

for ($i=0; $i<10; $i++) {
  $password .= tep_rand();
}

$salt = substr(md5($password), 0, 2);

$password = md5($salt . $plain) . ':' . $salt;

return $password;
 }
?>

 

 

It used to work on MS2.

Try changing:

// encrpyted passwordfunction tep_validate_password($plain, $encrypted) {

 

To:

// encrpyted password

function tep_validate_password($plain, $encrypted) {

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...