diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-03-16 04:33:45 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-03-16 04:33:45 +0000 |
commit | 736d74d05f70be5b72e44eafe2cc8efae52b0af7 (patch) | |
tree | 31cda57354967ecb717026f3f631daaa54801aec /modules/user/views | |
parent | cbc7c870fa8b54c2c320fedaf02b5b6010c55277 (diff) |
Clean up the login, maintenance login and required-top-level-login code.
We now have two clear and separate login approaches:
login/ajax
login/html
Choose the one that's appropriate. Totally simplified the maintenance
page to be separate from the theme and dead simple, and use login/html
approach there. Totally simplified the top level login
(login_page.html.php) to just be a login page, not the rest of the
chrome on the page and use the login/ajax approach there.
Don't use access::required in albums and then catch the exception,
instead use access::can and check the return code.
Improve the text for maintenance mode.
Diffstat (limited to 'modules/user/views')
-rw-r--r-- | modules/user/views/login.html.php | 2 | ||||
-rw-r--r-- | modules/user/views/login_prompt.html.php | 44 |
2 files changed, 1 insertions, 45 deletions
diff --git a/modules/user/views/login.html.php b/modules/user/views/login.html.php index d06f2a45..27373f02 100644 --- a/modules/user/views/login.html.php +++ b/modules/user/views/login.html.php @@ -1,7 +1,7 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <ul id="gLoginMenu"> <? if ($user->guest): ?> - <li class="first"><a href="<?= url::site("login") ?>" + <li class="first"><a href="<?= url::site("login/ajax") ?>" title="<?= t("Login to Gallery") ?>" id="gLoginLink"><?= t("Login") ?></a></li> <? else: ?> diff --git a/modules/user/views/login_prompt.html.php b/modules/user/views/login_prompt.html.php deleted file mode 100644 index 56a6f111..00000000 --- a/modules/user/views/login_prompt.html.php +++ /dev/null @@ -1,44 +0,0 @@ -<?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> |