Welcome, Guest. Please Login or Register.
August 12, 2022, 02:09:24 PM
Home Help Search Login 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  |  Topic: [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 7058 times)
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830



WWW
[Code 1.5.1] Numeric Random Password 1.0
« on: April 13, 2003, 05:23:13 PM »
Reply with quote

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

Register.php:

Find:
Code: [Select]
   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:
Code: [Select]
   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:
Code: [Select]
   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:
Code: [Select]
   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 09, 2004, 10:42:51 PM »
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  |  Topic: [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.0.18 | SMF © 2021, Simple Machines
Valid XHTML 1.0! Valid CSS!
Page created in 0.184 seconds with 20 queries.