Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Secure admin login


putanero

Recommended Posts

Posted

Hello,

I have a BIG problem. When I want to logon on to administration tools, i meet this problem:

 

 

Warning: require(includes/functions/password_funcs.php) [function.require]: failed to open stream: No such file or directory in W:\domains\www.mydomain.com\public\www_root\catalog\admin\login.php on line 14

 

Fatal error: require() [function.require]: Failed opening required 'includes/functions/password_funcs.php' (include_path='.') in W:\domains\www.mydomain.com\public\www_root\catalog\admin\login.php on line 14

 

 

When i remove file "login.php" from "\catalog\admin\login.php", then i dont need use "username and password" and log on is automatically without security :(((

 

What can i do for fix it ?

 

Thanx!!!

 

Peter

Posted

It's not a big file.

 

Copy/paste the code below and put it in the right named file in the right folder on your site:

( i.e. /admin/includes/functions/password_funcs.php )

 

<?php
/*
 $Id: password_funcs.php 1739 2007-12-20 00:52:16Z hpdl $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

////
// This funstion validates a plain text password with an
// encrpyted password
 function tep_validate_password($plain, $encrypted) {
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;
 }
?>

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 >

Archived

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

×
×
  • Create New...