Welcome, Guest. Please Login or Register.
March 28, 2024, 02:23:30 PM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

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 7972 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.013 seconds with 19 queries.