-
Notifications
You must be signed in to change notification settings - Fork 7
/
login_form.html
104 lines (102 loc) · 4.46 KB
/
login_form.html
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<div class="loginbox clearfix <?php echo $columns ?>">
<div class="loginpanel">
<?php if (!empty($openid_login) || !file_exists(openid_login_file())) {
if (empty($config->auth_openid_google_apps_domain)) {
include "{$CFG->dirroot}/auth/openid/custom/default_login.html";
} else {
include "{$CFG->dirroot}/auth/openid/custom/google_apps.html";
}
} else {
include openid_login_file();
} ?>
</div>
<?php if ($login_all) { ?>
<h2><?php print_string("returningtosite") ?></h2>
<div class="subcontent loginsub">
<div class="desc">
<?php
print_string("loginusing");
if (empty($CFG->usesid)) {
echo '<br/>';
echo '('.get_string('cookiesenabled').')';
echo $OUTPUT->help_icon('cookiesenabled');
// Pre-2.0: helpbutton("cookies", get_string("cookiesenabled"));
}
?>
</div>
<form action="<?php echo $CFG->wwwroot.'/login/index.php'; ?>" method="post" id="login">
<div class="loginform">
<div class="form-label"><label for="username"><?php print_string("username") ?></label></div>
<div class="form-input">
<input type="text" name="username" id="username" size="15" value="<?php if (!preg_match('/^https?:\/\//i', $frm->username)) { p($frm->username); } ?>" />
</div>
<div class="clearer"><!-- --></div>
<div class="form-label"><label for="password"><?php print_string("password") ?></label></div>
<div class="form-input">
<input type="password" name="password" id="password" size="15" value="" />
<input type="submit" value="<?php print_string("login") ?>" />
<input type="hidden" name="testcookies" value="1" />
</div>
<div class="clearer"><!-- --></div>
</div>
</form>
</div>
<?php if ($CFG->guestloginbutton) { ?>
<div class="subcontent guestsub">
<div class="desc">
<?php print_string("someallowguest") ?>
</div>
<form action="<?php echo $CFG->wwwroot.'/login/index.php'; ?>" method="post" id="guestlogin">
<div class="guestform">
<input type="hidden" name="username" value="guest" />
<input type="hidden" name="password" value="guest" />
<input type="hidden" name="testcookies" value="1" />
<input type="submit" value="<?php print_string("loginguest") ?>" />
</div>
</form>
</div>
<?php } ?>
<div class="subcontent forgotsub">
<div class="desc">
<?php print_string("forgotten") ?>
</div>
<form action="<?php echo $CFG->wwwroot.'/login/forgot_password.php'; ?>" method="post" id="changepassword">
<div class="forgotform">
<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
<input type="submit" value="<?php print_string("passwordrecovery") ?>" />
</div>
</form>
</div>
</div>
<?php if ($show_instructions) { ?>
<div class="signuppanel">
<h2><?php print_string("firsttime") ?></h2>
<div class="subcontent">
<?php if (is_enabled_auth('none')) { // instructions override the rest for security reasons
print_string("loginstepsnone");
} else if ($CFG->registerauth == 'email') {
if (!empty($CFG->auth_instructions)) {
echo format_text($CFG->auth_instructions);
} else {
print_string("loginsteps", "", $CFG->wwwroot."/login/signup.php");
} ?>
<div class="signupform">
<form action="<?php echo $CFG->wwwroot.'/login/signup.php'; ?>" method="get" id="signup">
<div><input type="submit" value="<?php print_string("startsignup") ?>" /></div>
</form>
</div>
<?php } else if (!empty($CFG->registerauth)) {
echo format_text($CFG->auth_instructions); ?>
<div class="signupform">
<form action="<?php echo $CFG->wwwroot.'/login/signup.php'; ?>" method="get" id="signup">
<div><input type="submit" value="<?php print_string("startsignup") ?>" /></div>
</form>
</div>
<?php } else {
echo format_text($CFG->auth_instructions);
} ?>
</div>
</div>
<?php } ?>
<?php } ?>
</div>