Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function encrypt($password,$encryption){
- switch ($encryption){
- case "crypt":
- case "crypt":
- case "1":
- /* Obviousely the right way of crypting passwords with salts does not work when checking passwords
- against a stored one in the database. This affects changeadminpassword.php.
- As a workaround, the salt will be the cleartext password.
- In future it would be better to have a random salt and another solution for changadminpassword.php.
- This would probably means to abstract adminusers and accountusers in crypto.php
- */
- #$password=crypt($password,substr(md5(rand()),0,2));
- $password=crypt($password,$password);
- break;
- }
- // Encrypt should always return something - on plaintext unchanged input
- return $password;
- }
- $new_password = encrypt(lol, crypt);
- //$query = "UPDATE accountuser SET password='$new_password' WHERE username='".$_POST['username']."'";
- echo $new_password
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement