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