diff options
author | Bart Visscher <bartv@thisnet.nl> | 2011-09-25 23:33:22 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2011-09-26 21:17:26 +0200 |
commit | 950d4e1da498b7c928b5f6e1cbcca8e57ddecb0c (patch) | |
tree | d42e5abbd98e8e27fdb8b37722593f7354e89cf0 /index.php | |
parent | aae6881494af7ada98301667c133272a345ef8f0 (diff) | |
download | nextcloud-server-950d4e1da498b7c928b5f6e1cbcca8e57ddecb0c.tar.gz nextcloud-server-950d4e1da498b7c928b5f6e1cbcca8e57ddecb0c.zip |
Move lostpassword code to own app
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/index.php b/index.php index bb1e370d241..0db8ad126ce 100644 --- a/index.php +++ b/index.php @@ -87,38 +87,6 @@ elseif(isset($_POST["user"]) && isset($_POST['password'])) { } } -// Someone lost their password: -elseif(isset($_GET['lostpassword'])) { - OC_App::loadApps(); - if (isset($_POST['user'])) { - if (OC_User::userExists($_POST['user'])) { - $token = sha1($_POST['user']+uniqId()); - OC_Preferences::setValue($_POST['user'], "owncloud", "lostpassword", $token); - // TODO send email with link+token - OC_Template::printGuestPage("", "lostpassword", array("error" => false, "requested" => true)); - } else { - OC_Template::printGuestPage("", "lostpassword", array("error" => true, "requested" => false)); - } - } else { - OC_Template::printGuestPage("", "lostpassword", array("error" => false, "requested" => false)); - } -} - -// Someone wants to reset their password: -elseif(isset($_GET['resetpassword']) && isset($_GET['token']) && isset($_GET['user']) && OC_Preferences::getValue($_GET['user'], "owncloud", "lostpassword") === $_GET['token']) { - OC_App::loadApps(); - if (isset($_POST['password'])) { - if (OC_User::setPassword($_GET['user'], $_POST['password'])) { - OC_Preferences::deleteKey($_GET['user'], "owncloud", "lostpassword"); - OC_Template::printGuestPage("", "resetpassword", array("success" => true)); - } else { - OC_Template::printGuestPage("", "resetpassword", array("success" => false)); - } - } else { - OC_Template::printGuestPage("", "resetpassword", array("success" => false)); - } -} - // For all others cases, we display the guest page : else { OC_App::loadApps(); |