diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-04 05:49:29 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-04 05:49:29 +0000 |
commit | 2f5344c1daa6d318ea85a1a4fe2d12d4660dd72b (patch) | |
tree | 504bb717bd167ed9f9d3bb5e7b6bfd1d12c59cee /modules/user/views | |
parent | c63c843f18918ff3b94707bd76de5abf3b6d8428 (diff) |
A preview of the password reset functionality. What's working... you
can start to logon, request the password to be reset, and an email is
sent to the users email address. If you click on the link you get an
unformatted form. But its a start :-)
Diffstat (limited to 'modules/user/views')
-rw-r--r-- | modules/user/views/login_prompt.html.php | 44 | ||||
-rw-r--r-- | modules/user/views/reset_password.html.php | 14 |
2 files changed, 58 insertions, 0 deletions
diff --git a/modules/user/views/login_prompt.html.php b/modules/user/views/login_prompt.html.php new file mode 100644 index 00000000..2b9516ba --- /dev/null +++ b/modules/user/views/login_prompt.html.php @@ -0,0 +1,44 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<script type="text/javascript"> + $("#gLoginForm").ready(function() { + $("#gForgotPasswordLink").click(function() { + $.ajax({ + url: "<?= url::site("password/reset") ?>", + success: function(data) { + $("div#gLoginView").html(data); + $("#ui-dialog-title-gDialog").text("<?= t("Reset Password") ?>"); + ajaxify_login_reset_form(); + } + }); + }); + }); + + function ajaxify_login_reset_form() { + $("#gLoginView form").ajaxForm({ + dataType: "json", + success: function(data) { + if (data.form) { + $("#gLoginView form").replaceWith(data.form); + ajaxify_login_reset_form(); + } + if (data.result == "success") { + $("#gDialog").dialog("close"); + window.location.reload(); + } + + } + }); + }; +</script> +<div id="gLoginView"> + <ul> + <li> + <div id="gLoginViewForm"> + <?= $form ?> + </div> + </li> + <li> + <a href="#" id="gForgotPasswordLink"><?= t("Forgot your Password?") ?></a> + </li> + </ul> +</div> diff --git a/modules/user/views/reset_password.html.php b/modules/user/views/reset_password.html.php new file mode 100644 index 00000000..39845d61 --- /dev/null +++ b/modules/user/views/reset_password.html.php @@ -0,0 +1,14 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<html> +<head> + <title><?= $title ?> </title> +</head> +<body> + <h2><?= t("Password Reset Request") ?> </h2> + <p> + <?= sprintf(t("A request to reset your password (user: %s) at %s."), $name, url::base(false, "http")) ?> + <?= sprintf(t("To confirm this request please click on the link below")) ?><br /> + <a href="<?= $url ?>"><?= t("Reset Password") ?></a> + </p> +</body> +</html> |