* Licensed under the GNU GPL. See the file COPYING for details. */ function stripslashes_deep($value) { if (is_array($value)) return array_map('stripslashes_deep', $value); else return stripslashes($value); } if (get_magic_quotes_gpc()) $_POST = stripslashes_deep($_POST); $username = isset($_POST['username']) ? $_POST['username'] : ''; $password = isset($_POST['password']) ? $_POST['password'] : ''; ?> Password Hasher for PHP Shell 2.1

Password Hasher for PHP Shell 2.1

Username
Password
Result Enter a username and a password and update.

\n"; } else { $u = strtolower($username); if (preg_match('/[[ |&~!()]/', $u) || $u == 'null' || $u == 'yes' || $u == 'no' || $u == 'true' || $u == 'false') { echo '

Your username cannot contain any of the following reserved word: "null", "yes", "no", "true", or "false". The following characters are also prohibited: " " (space), "[" (left bracket), "|" (pipe), "&" (ampersand), "~" (tilde), "!" (exclamation mark), "(" (left parenthesis), or ")" (right parenthesis).

' . "\n"; echo '

Please choose another username and try again.

' . "\n"; } else { echo "

Write the following line into config.php " . "in the users section:

\n"; $fkt = 'md5'; // Change to sha1 is you feel like it... $salt = dechex(mt_rand()); $hash = $fkt . ':' . $salt . ':' . $fkt($salt . $password); echo "
\n";
        echo htmlentities(str_pad($username, 8) . ' = "' . $hash . '"') . "\n";
        echo "
\n"; } } ?>


Copyright © 2005, Martin Geisler. Get the latest version at mgeisler.net/php-shell/.