Results 1 to 3 of 3
  1. #1
    New Pligger kossmoss's Avatar
    Joined
    May 2008
    Posts
    19
    Thanks
    Received:0
    Given: 0

    Cool Secure "forgotten password" function

    I think, changing forgotten password to 'password' for everyone is not secure.

    I use such a code in my login.php:

    Code:
    				if($DBconf == $confirmationcode && !empty($confirmationcode)){
    					$new_pass = substr(md5(uniqid(rand(), true)), 0, 8);
    					$passhash = generateHash($new_pass);
    					$db->query('UPDATE `' . table_users . '` SET `last_reset_code` = "" WHERE `user_login` = "'.$username.'"');
    					$db->query('UPDATE `' . table_users . '` SET `user_pass` = "'.$passhash.'" WHERE `user_login` = "'.$username.'"');
    					$errorMsg = "Your password has been reset to '$new_pass'. ".$main_smarty->get_config_vars('PLIGG_Visual_Login_Forgot_PassReset');
    				}
    Of course, 'PLIGG_Visual_Login_Forgot_PassReset' value must be changed in your lang file to 'Please login and change your password'

  2. #2
    Pligg Founder/Coder/Designer Yankidank's Avatar
    Joined
    Dec 2005
    Location
    San Francisco, CA
    Posts
    5,513
    Thanks
    Received:85
    Given: 14
    Site
    http://pligg.com/demo/
    SVN version changed it so that the password is reset to a random value and emailed to the user.
    The Facebook Module for Pligg CMS!
    Register, Login, and Submit Stories with Facebook. An absolute MUST HAVE for all Pligg sites!

  3. #3
    New Pligger kossmoss's Avatar
    Joined
    May 2008
    Posts
    19
    Thanks
    Received:0
    Given: 0
    Oh, that's very good!

Similar Threads

  1. Karma causes "Call to undefined function generateHash() "
    By l0gikal in forum Questions & Comments
    Replies: 6
    Last Post: 02-17-2010, 04:27 PM
  2. A "better" function to generate thumbs for upload module.
    By bilicc in forum Questions & Comments
    Replies: 3
    Last Post: 08-25-2009, 01:02 AM
  3. Replies: 1
    Last Post: 07-02-2008, 10:53 AM
  4. how to config mail of "forgotten password"?
    By iceboy in forum Questions & Comments
    Replies: 13
    Last Post: 12-02-2007, 02:42 AM
  5. Replies: 2
    Last Post: 03-31-2007, 11:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Web Hosting Services by Midphase Dreamhost Web Hosting Donate to Pligg