[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
Zen Cart 源代码 password_funcs.php

Zen Cart 源代码 password_funcs.php




下载文件

文件名: password_funcs.php
文件类型: PHP文件
文件大小: 1.09 KiB
MD5: 871d58005f5c63c122eb304516f16f08

password_funcs.php - 关闭高亮
  1. <?php
  2. /**
  3.  * password_funcs functions
  4.  *
  5.  * @package functions
  6.  * @copyright Copyright 2003-2005 Zen Cart Development Team
  7.  * @copyright Portions Copyright 2003 osCommerce
  8.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  9.  * @version $Id: password_funcs.php 2618 2005-12-20 00:35:47Z drbyte $
  10.  */
  11.  
  12. ////
  13. // This function validates a plain text password with an encrpyted password
  14.   function zen_validate_password($plain, $encrypted) {
  15.     if (zen_not_null($plain) && zen_not_null($encrypted)) {
  16. // split apart the hash / salt
  17.       $stack = explode(':', $encrypted);
  18.  
  19.       if (sizeof($stack) != 2) return false;
  20.  
  21.       if (md5($stack[1] . $plain) == $stack[0]) {
  22.         return true;
  23.       }
  24.     }
  25.  
  26.     return false;
  27.   }
  28.  
  29. ////
  30. // This function makes a new password from a plaintext password.
  31.   function zen_encrypt_password($plain) {
  32.     $password = '';
  33.  
  34.     for ($i=0; $i<10; $i++) {
  35.       $password .= zen_rand();
  36.     }
  37.  
  38.     $salt = substr(md5($password), 0, 2);
  39.  
  40.     $password = md5($salt . $plain) . ':' . $salt;
  41.  
  42.     return $password;
  43.   }
  44. ?>


cron