diff --git a/index.php b/index.php index e6636cf1..e3356fee 100644 --- a/index.php +++ b/index.php @@ -73,6 +73,13 @@ if (PHP_SAPI == "cli") { case "install": include("installer/index.php"); exit(0); + case "passwordreset": + $username = empty($_SERVER['argv'][2]) ? 'admin' : $_SERVER['argv'][2]; + # need to quote/escape this? + $_SERVER["argv"] = array("index.php", "{$arg_1}/index/$username"); + define("TEST_MODE", 0); + define("VARPATH", realpath("var") . "/"); + break; case "upgrade": case "package": $_SERVER["argv"] = array("index.php", "{$arg_1}r/$arg_1"); diff --git a/modules/gallery/controllers/passwordreset.php b/modules/gallery/controllers/passwordreset.php new file mode 100644 index 00000000..e4d0d4a9 --- /dev/null +++ b/modules/gallery/controllers/passwordreset.php @@ -0,0 +1,49 @@ +password = $password; + $user->save(); + + print "We reset the password for: + username: {$user->name} + password: $password + +"; + } +}