Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //retrieve our data from POST
- $account_admin_username = $_POST['account_admin_username'];
- $account_admin_password = $_POST['account_admin_password'];
- function generate_password($length='')
- {
- $str='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_?/:(){}[]0123456789';
- $max=strlen($str);
- $length=@round($length);
- if(empty($length)){$length=rand(8,12);}
- $account_admin_password='';
- for($i=0; $i<$length; $i++){$password.=$str{rand(0,$max-1)};}
- return $account_admin_password;
- }
- $account_admin_password_hash = hash('sha512', $account_admin_password);
- $account_admin_reset_code_hash = hash('sha512', $account_admin_reset_code);
- //creates a 3 character sequence [password]
- function createSalt()
- {
- $string = md5(uniqid(rand(), true));
- return substr($string, 0, 3);
- }
- $account_admin_password_salt = createSalt();
- $account_admin_password_hash = hash('sha512', $account_admin_password_salt . $account_admin_password_hash);
- $account_admin_reset_code_salt = createSalt();
- $account_admin_reset_code_hash = hash('sha512', $account_admin_reset_code_salt . $account_admin_reset_code_hash);
- <cut the rest out>
Add Comment
Please, Sign In to add comment