2015-04-11 17:30:01 +00:00
|
|
|
<?php
|
|
|
|
register_module([
|
|
|
|
"name" => "Password hashing action",
|
|
|
|
"version" => "0.4",
|
|
|
|
"author" => "Starbeamrainbowlabs",
|
|
|
|
"description" => "Adds a utility action (that anyone can use) called hash that hashes a given string. Useful when changing a user's password.",
|
2015-04-25 13:33:09 +00:00
|
|
|
"id" => "action-hash",
|
2015-04-11 17:30:01 +00:00
|
|
|
"code" => function() {
|
|
|
|
add_action("hash", function() {
|
|
|
|
if(!isset($_GET["string"]))
|
|
|
|
{
|
|
|
|
http_response_code(422);
|
|
|
|
exit(renderpage("Missing parameter", "<p>The <code>GET</code> parameter <code>string</code> must be specified.</p>
|
|
|
|
<p>It is strongly recommended that you utilise this page via a private or incognito window in order to prevent your password from appearing in your browser history.</p>"));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
exit(renderpage("Hashed string", "<p><code>" . $_GET["string"] . "</code> → <code>" . hash("sha256", $_GET["string"] . "</code></p>")));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
]);
|
|
|
|
|
|
|
|
?>
|