This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/plugins/db_mapping/osCommerce_22/password_funcs.php

40 lines
893 B
PHP
Raw Normal View History

<?php
/*
$Id: password_funcs.php,v 1.1 2004/09/15 05:00:36 Tony Exp $
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)) {
// check if plain md5 matches:
if ( md5($plain) == $encrypted) return true;
// 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) {
return md5($plain);
}
?>