nseman Posted March 27, 2010 Share Posted March 27, 2010 I am getting the following Fatal Error message when I am trying to login. Can someone look at the code below to see if it has error. I didn't modify this file but I have added this line in application_top.php file when adding a multi level admin contributon "require(DIR_WS_FUNCTIONS . 'password_funcs.php');" . Any help would be appreciated. Fatal error: Cannot redeclare tep_validate_password() (previously declared in /catalog/admin/includes/functions/password_funcs.php:16) in /catalog/admin/includes/functions/password_funcs.php on line 29 The content of the password_funcs.php file is as follows: <?php /* $Id: password_funcs.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 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; } ?> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.