aboutsummaryrefslogtreecommitdiff
path: root/mod/walledgarden/views/default/account/forms/login.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/walledgarden/views/default/account/forms/login.php')
-rw-r--r--mod/walledgarden/views/default/account/forms/login.php144
1 files changed, 45 insertions, 99 deletions
diff --git a/mod/walledgarden/views/default/account/forms/login.php b/mod/walledgarden/views/default/account/forms/login.php
index 7cb38faed..1c3bbe512 100644
--- a/mod/walledgarden/views/default/account/forms/login.php
+++ b/mod/walledgarden/views/default/account/forms/login.php
@@ -1,111 +1,57 @@
<?php
-
- /**
- * Elgg login form for walled garden
- */
+/**
+* Walled Garden Login Form
+*/
- global $CONFIG;
-
- //login form
- $form_body = "<h2 class='master'>" . elgg_echo('login') . "</h2>";
- $form_body .= "<label>".elgg_echo('username')."</label>".elgg_view('input/text', array('internalname' => 'username', 'class' => 'login-textarea username master'));
- $form_body .= "<br /><label>".elgg_echo('password')."</label>".elgg_view('input/password', array('internalname' => 'password', 'class' => 'login-textarea password master' ));
+global $CONFIG;
-
- $form_body .= "<br />" . elgg_view('input/submit', array('value' => elgg_echo('login'))) . " <div id=\"persistent_login\"><label><input type=\"checkbox\" name=\"persistent\" value=\"true\" />".elgg_echo('user:persistent')."</label></div>";
- $form_body .= "<p class=\"loginbox\">";
- $form_body .= (!isset($CONFIG->disable_registration) || !($CONFIG->disable_registration)) ? "<a href=\"{$vars['url']}account/register.php\">" . elgg_echo('register') . "</a> | " : "";
- $form_body .= "<a href='#forgotten_password' class='forgotten_password_link'>" . elgg_echo('user:password:lost') . "</a></p>";
+$form_body = "<label>" . elgg_echo('username') . "<br />" . elgg_view('input/text', array('internalname' => 'username', 'class' => 'login_textarea username')) . "</label>";
+$form_body .= "<br />";
+$form_body .= "<label>" . elgg_echo('password') . "<br />" . elgg_view('input/password', array('internalname' => 'password', 'class' => 'login_textarea')) . "</label><br />";
+$form_body .= elgg_view('input/hidden', array('internalname' => 'returntoreferer', 'value' => 'true'));
+$form_body .= elgg_view('input/submit', array('value' => elgg_echo('login')));
+$form_body .= "<div class='remember_me'><label><input type='checkbox' name='persistent' checked value='true' />".elgg_echo('user:persistent')."</label></div>";
+$form_body .= "<p class='lost_password'><a class='forgotten_password_link' href=\"{$login_url}account/forgotten_password.php\">" . elgg_echo('user:password:lost') . "</a></p>";
+$login_url = $vars['url'];
+if ((isset($CONFIG->https_login)) && ($CONFIG->https_login)) {
+ $login_url = str_replace("http", "https", $vars['url']);
+}
+?>
-
- $login_url = $vars['url'];
- if ((isset($CONFIG->https_login)) && ($CONFIG->https_login))
- $login_url = str_replace("http", "https", $vars['url']);
+<h2><?php echo elgg_echo('login'); ?></h2>
+<?php
+ echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$login_url}action/login"));
+ echo elgg_view('login/extend'); // view for plugins to extend
?>
-
- <div id="login-box">
- <?php
- echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$login_url}action/login"));
- echo elgg_view('login/extend'); //a view for plugins to extend
- ?>
- <div class="clearfloat"></div>
- </div>
-
+<div class="lostpassword_form margin_top hidden">
+ <?php
+ $lostpassword_form_body = "<p>" . elgg_echo('user:password:text') . "</p>";
+ $lostpassword_form_body .= "<p><label>". elgg_echo('username') . " "
+ . elgg_view('input/text', array('internalname' => 'username', 'class' => 'login_textarea lostusername')) . "</label></p>";
+ $lostpassword_form_body .= elgg_view('input/captcha');
+ $lostpassword_form_body .= "<p>" . elgg_view('input/submit', array('value' => elgg_echo('request'))) . "</p>";
+
+ ?>
+ <h2><?php echo elgg_echo('user:password:lost'); ?></h2>
+ <?php
+ echo elgg_view('input/form', array(
+ 'action' => "{$vars['url']}action/user/requestnewpassword",
+ 'body' => $lostpassword_form_body,
+ 'class' => "margin_top"
+ ));
+ ?>
+</div>
+
<script type="text/javascript">
- $(document).ready(function() {
-
- $('.login-textarea.username.master').focus(); // only put cursor in textfirld if master login
+$(document).ready(function() {
+ $('input.username').focus();
- $('.login-textarea.name').focus(function() {
- if (this.value=='<?php echo elgg_echo('username'); ?>') {
- this.value='';
- }
- });
- $('.login-textarea.name').blur(function() {
- if (this.value=='') {
- this.value='<?php echo elgg_echo('username'); ?>';
- }
- });
- $('.login-textarea.password').focus(function() {
- if (this.value=='<?php echo elgg_echo('password'); ?>') {
- this.value='';
- }
- });
-
-
- //select all the a tag with name equal to modal
$('a.forgotten_password_link').click(function(e) {
- //Cancel the link behavior
e.preventDefault();
-
- //Get the A tag
- var id = $(this).attr('href');
-
- //Get the screen height and width
- //var maskHeight = $(document).height();
- //var maskWidth = $(window).width();
-
- //Set height and width to mask to fill up the whole screen
- //$('#mask').css({'width':maskWidth,'height':maskHeight});
-
- //transition effect
- $('#mask').fadeIn(500);
- $('#mask').fadeTo("slow",0.8);
-
- //Get the window height and width
- var winH = $(window).height();
- var winW = $(window).width();
-
- //Set the popup window to center
- $(id).css('top', winH/4-$(id).height()/2);
- $(id).css('left', (winW-20)/2-$(id).width()/2);
-
- //transition effect
- $(id).fadeIn(1000);
-
- });
-
- //if close button is clicked
- $('.window .close').click(function (e) {
- //Cancel the link behaviour
- e.preventDefault();
-
- $('#mask').hide();
- $('.window').hide();
- });
-
- //if mask is clicked
- $('#mask').click(function () {
- $(this).hide();
- $('.window').hide();
- });
-
+ elgg_slide_toggle(this, '.walledgardenlogin', '.lostpassword_form');
+ $('input.lostusername').focus();
+ });
});
-</script>
-
-
-
-
- \ No newline at end of file
+</script> \ No newline at end of file