diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2009-03-16 04:42:39 +0000 | 
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2009-03-16 04:42:39 +0000 | 
| commit | 83912bce204a29d1d28637aa425b8482675eeb3f (patch) | |
| tree | b19673a36f562e4450843d50c215d22b18f1b175 /modules/user | |
| parent | 736d74d05f70be5b72e44eafe2cc8efae52b0af7 (diff) | |
Missed this in the last commit
Diffstat (limited to 'modules/user')
| -rw-r--r-- | modules/user/views/login_ajax.html.php | 44 | 
1 files changed, 44 insertions, 0 deletions
| diff --git a/modules/user/views/login_ajax.html.php b/modules/user/views/login_ajax.html.php new file mode 100644 index 00000000..56a6f111 --- /dev/null +++ b/modules/user/views/login_ajax.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> | 
