Welcome, Guest. Please Login or Register.
November 27, 2024, 10:43:53 AM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Completed mods  |  [Code 1.5.1] Numeric Random Password 1.0 « previous next »
Pages: [1] Reply Ignore Print
Author Topic: [Code 1.5.1] Numeric Random Password 1.0  (Read 8242 times)
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
[Code 1.5.1] Numeric Random Password 1.0
« on: April 13, 2003, 10:23:13 PM »
Reply with quote

This makes it easier for your members to sign in with their random passwords.

Register.php:

Find:   if ($emailpassword)
   {
      // randomly generate a new password
      mt_srand(time());
      $password = crypt(mt_rand(-100000, 100000));      

      // remove all non alpha-numeric characters
      $password = preg_replace("/\W/", '', $password);

      // limit it to 10 characters max
      $member['passwrd1']= substr($password, 0, 10);
   }

Replace:    if ($emailpassword)
   {
      // randomly generate a new password
      mt_srand(time());
      $password = '';
      for ($i = 0; $i < 10; $i++)
         $password .= mt_rand(0, 9);
   }


Profile.php:

Find:    if ($emailnewpass && strtolower($member['email']) != strtolower($settings[2]) && $settings[7] != 'Administrator')
   {
      $member['passwrd1'] = crypt(mt_rand(-100000, 100000));
      $member['passwrd1'] = preg_replace("/\W/", '', $member['passwrd1']);
      $member['passwrd1'] = substr($member['passwrd1'], 0, 10);

Replace:    if ($emailnewpass && strtolower($member['email']) != strtolower($settings[2]) && $settings[7] != 'Administrator')
   {
      $member['passwrd1'] = '';
      for ($i = 0; $i < 10; $i++)
         $member['passwrd1'] .= mt_rand(0, 9);


-[Unknown]
Logged
username00001111
Noobie
*
Posts: 37


Como Se Llama?

Re:[Code 1.5.1] Numeric Random Password 1.0
« Reply #1 on: February 10, 2004, 03:42:51 AM »
Reply with quote

Doesn't work for me. Any suggestions? It still comes out in alpha/numerical format.
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [Code 1.5.1] Numeric Random Password 1.0 « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.059 seconds with 21 queries.