From 572df2a7be46b7bdeaf10ad7568a43bb288e2500 Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Thu, 5 Jan 2012 22:16:26 +0100 Subject: account implemented --- r7r_repo/main.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'r7r_repo/main.php') diff --git a/r7r_repo/main.php b/r7r_repo/main.php index 8e52af0..d28cb44 100644 --- a/r7r_repo/main.php +++ b/r7r_repo/main.php @@ -337,6 +337,31 @@ $url_handlers = array( echo $ste->exectemplate("admin.html"); }, + "account" => function(&$data, $url_now, &$url_next) + { + global $ste, $user; + + if($user === NULL) + throw new NotFoundError(); + + $url_next = array(); + $ste->vars["menu"] = "account"; + $ste->vars["title"] = "My Account"; + + if(isset($_POST["set_new_password"])) + { + if(empty($_POST["new_password"])) + $ste->vars["error"] = "Password must not be empty."; + else + { + $user->pwhash = PasswordHash::create($_POST["new_password"]); + $user->save(); + $ste->vars["success"] = "Password set."; + } + } + + echo $ste->exectemplate("account.html"); + }, "setup" => function(&$data, $url_now, &$url_next) { global $settings, $ste; -- cgit v1.2.3-70-g09d2