aboutsummaryrefslogtreecommitdiff
path: root/views/default/account/forms/login.php
blob: baea51770c6a43c1f65164e9ce7174beb47c4528 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/**
 * Elgg login form
 *
 * @package Elgg
 * @subpackage Core
 * @author Curverider Ltd
 * @link http://elgg.org/
 */

$form_body = "<label>" . elgg_echo('username') . "<br />" . elgg_view('input/text', array('internalname' => 'username', 'class' => 'login_textarea')) . "</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('login/extend');
$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='persistent_login'><label><input type='checkbox' name='persistent' value='true' />".elgg_echo('user:persistent')."</label></div>";
$form_body .= "<p class='loginbox'>";
$form_body .= $CONFIG->allow_registration ? "<a href=\"{$vars['url']}pg/register/\">" . elgg_echo('register') . '</a> | ' : '';
$form_body .= "<a href=\"{$vars['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']);
}
?>

<div id="login">
<h2><?php echo elgg_echo('login'); ?></h2>
	<?php
		echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$login_url}action/login"));
	?>
</div>
<script type="text/javascript">
	$(document).ready(function() { $('input[name=username]').focus(); });
</script>