weekly release 2.6.2+
[moodle.git] / login / index_form.html
blob8b6f1a00ff9ccb7229f84989d83bf80df88cd795
1 <?php
2 if ($show_instructions) {
3 $columns = 'twocolumns';
4 } else {
5 $columns = 'onecolumn';
8 if (!empty($CFG->loginpasswordautocomplete)) {
9 $autocomplete = 'autocomplete="off"';
10 } else {
11 $autocomplete = '';
14 <div class="loginbox clearfix <?php echo $columns ?>">
15 <div class="loginpanel">
16 <?php
17 if (($CFG->registerauth == 'email') || !empty($CFG->registerauth)) { ?>
18 <div class="skiplinks"><a class="skip" href="signup.php"><?php print_string("tocreatenewaccount"); ?></a></div>
19 <?php
20 } ?>
21 <h2><?php print_string("login") ?></h2>
22 <div class="subcontent loginsub">
23 <?php
24 if (!empty($errormsg)) {
25 echo html_writer::start_tag('div', array('class' => 'loginerrors'));
26 echo html_writer::link('#', $errormsg, array('id' => 'loginerrormessage', 'class' => 'accesshide'));
27 echo $OUTPUT->error_text($errormsg);
28 echo html_writer::end_tag('div');
31 <form action="<?php echo $CFG->httpswwwroot; ?>/login/index.php" method="post" id="login" <?php echo $autocomplete; ?> >
32 <div class="loginform">
33 <div class="form-label"><label for="username"><?php print_string("username") ?></label></div>
34 <div class="form-input">
35 <input type="text" name="username" id="username" size="15" value="<?php p($frm->username) ?>" />
36 </div>
37 <div class="clearer"><!-- --></div>
38 <div class="form-label"><label for="password"><?php print_string("password") ?></label></div>
39 <div class="form-input">
40 <input type="password" name="password" id="password" size="15" value="" <?php echo $autocomplete; ?> />
41 <input type="submit" id="loginbtn" value="<?php print_string("login") ?>" />
42 </div>
43 </div>
44 <div class="clearer"><!-- --></div>
45 <?php if (isset($CFG->rememberusername) and $CFG->rememberusername == 2) { ?>
46 <div class="rememberpass">
47 <input type="checkbox" name="rememberusername" id="rememberusername" value="1" <?php if ($frm->username) {echo 'checked="checked"';} ?> />
48 <label for="rememberusername"><?php print_string('rememberusername', 'admin') ?></label>
49 </div>
50 <?php } ?>
51 <div class="clearer"><!-- --></div>
52 <div class="forgetpass"><a href="forgot_password.php"><?php print_string("forgotten") ?></a></div>
53 </form>
54 <div class="desc">
55 <?php
56 echo get_string("cookiesenabled");
57 echo $OUTPUT->help_icon('cookiesenabled');
59 </div>
60 </div>
62 <?php if ($CFG->guestloginbutton and !isguestuser()) { ?>
63 <div class="subcontent guestsub">
64 <div class="desc">
65 <?php print_string("someallowguest") ?>
66 </div>
67 <form action="index.php" method="post" id="guestlogin">
68 <div class="guestform">
69 <input type="hidden" name="username" value="guest" />
70 <input type="hidden" name="password" value="guest" />
71 <input type="submit" value="<?php print_string("loginguest") ?>" />
72 </div>
73 </form>
74 </div>
75 <?php } ?>
76 </div>
77 <?php if ($show_instructions) { ?>
78 <div class="signuppanel">
79 <h2><?php print_string("firsttime") ?></h2>
80 <div class="subcontent">
81 <?php if (is_enabled_auth('none')) { // instructions override the rest for security reasons
82 print_string("loginstepsnone");
83 } else if ($CFG->registerauth == 'email') {
84 if (!empty($CFG->auth_instructions)) {
85 echo format_text($CFG->auth_instructions);
86 } else {
87 print_string("loginsteps", "", "signup.php");
88 } ?>
89 <div class="signupform">
90 <form action="signup.php" method="get" id="signup">
91 <div><input type="submit" value="<?php print_string("startsignup") ?>" /></div>
92 </form>
93 </div>
94 <?php } else if (!empty($CFG->registerauth)) {
95 echo format_text($CFG->auth_instructions); ?>
96 <div class="signupform">
97 <form action="signup.php" method="get" id="signup">
98 <div><input type="submit" value="<?php print_string("startsignup") ?>" /></div>
99 </form>
100 </div>
101 <?php } else {
102 echo format_text($CFG->auth_instructions);
103 } ?>
104 </div>
105 </div>
106 <?php } ?>
107 <?php if (!empty($potentialidps)) { ?>
108 <div class="subcontent potentialidps">
109 <h6><?php print_string('potentialidps', 'auth'); ?></h6>
110 <div class="potentialidplist">
111 <?php foreach ($potentialidps as $idp) {
112 echo '<div class="potentialidp"><a href="' . $idp['url']->out() . '" title="' . $idp['name'] . '">' . $OUTPUT->render($idp['icon'], $idp['name']) . $idp['name'] . '</a></div>';
113 } ?>
114 </div>
115 </div>
116 <?php } ?>
117 </div>