MDL-23833 rewritten guest autologin - not using redirect any more + migration to...
[moodle.git] / login / index_form.html
1 <?php
2 if ($show_instructions) {
3     $columns = 'twocolumns';
4 } else {
5     $columns = 'onecolumn';
6 }
7 ?>
8 <div class="loginbox clearfix <?php echo $columns ?>">
9   <div class="loginpanel">
10 <?php
11   if (($CFG->registerauth == 'email') || !empty($CFG->registerauth)) { ?>
12       <div class="skiplinks"><a class="skip" href="signup.php"><?php print_string("tocreatenewaccount"); ?></a></div>
13 <?php
14   } ?>       
15     <h2><?php print_string("returningtosite") ?></h2>
16       <div class="subcontent loginsub">
17         <div class="desc">
18           <?php
19             print_string("loginusing");
20             if (empty($CFG->usesid)) {
21                 echo '<br/>';
22                 echo '('.get_string("cookiesenabled").')';
23                 echo $OUTPUT->help_icon('cookiesenabled');
24             }
25            ?>
26         </div>
27         <?php
28           if (!empty($errormsg)) {
29               echo '<div class="loginerrors">';
30               echo $OUTPUT->error_text($errormsg);
31               echo '</div>';
32           }
33         ?>
34         <form action="<?php echo $CFG->httpswwwroot; ?>/login/index.php" method="post" id="login">
35           <div class="loginform">
36             <div class="form-label"><label for="username"><?php print_string("username") ?></label></div>
37             <div class="form-input">
38               <input type="text" name="username" id="username" size="15" value="<?php p($frm->username) ?>" />
39             </div>
40             <div class="clearer"><!-- --></div>
41             <div class="form-label"><label for="password"><?php print_string("password") ?></label></div>
42             <div class="form-input">
43               <input type="password" name="password" id="password" size="15" value="" />
44               <input type="submit" id="loginbtn" value="<?php print_string("login") ?>" />
45               <input type="hidden" name="testcookies" value="1" />
46               <div class="forgetpass"><a href="forgot_password.php"><?php print_string("forgotten") ?></a></div>
47             </div>
48             <div class="clearer"><!-- --></div>
49           </div>
50         </form>
51       </div>
53 <?php if ($CFG->guestloginbutton and !isguestuser()) {  ?>
54       <div class="subcontent guestsub">
55         <div class="desc">
56           <?php print_string("someallowguest") ?>
57         </div>
58         <form action="index.php" method="post" id="guestlogin">
59           <div class="guestform">
60             <input type="hidden" name="username" value="guest" />
61             <input type="hidden" name="password" value="guest" />
62             <input type="hidden" name="testcookies" value="1" />
63             <input type="submit" value="<?php print_string("loginguest") ?>" />
64           </div>
65         </form>
66       </div>
67 <?php } ?>
68      </div>
69 <?php if ($show_instructions) { ?>
70     <div class="signuppanel">
71       <h2><?php print_string("firsttime") ?></h2>
72       <div class="subcontent">
73 <?php     if (is_enabled_auth('none')) { // instructions override the rest for security reasons
74               print_string("loginstepsnone");
75           } else if ($CFG->registerauth == 'email') {
76               if (!empty($CFG->auth_instructions)) {
77                   echo format_text($CFG->auth_instructions);
78               } else {
79                   print_string("loginsteps", "", "signup.php");
80               } ?>
81                  <div class="signupform">
82                    <form action="signup.php" method="get" id="signup">
83                    <div><input type="submit" value="<?php print_string("startsignup") ?>" /></div>
84                    </form>
85                  </div>
86 <?php     } else if (!empty($CFG->registerauth)) {
87               echo format_text($CFG->auth_instructions); ?>
88               <div class="signupform">
89                 <form action="signup.php" method="get" id="signup">
90                 <div><input type="submit" value="<?php print_string("startsignup") ?>" /></div>
91                 </form>
92               </div>
93 <?php     } else {
94               echo format_text($CFG->auth_instructions);
95           } ?>
96       </div>
97     </div>
98 <?php } ?>
99 <?php if (!empty($potentialidps)) { ?>
100     <div class="subcontent potentialidps">
101         <h6><?php print_string('potentialidps', 'auth'); ?></h6>
102         <div class="potentialidplist">
103 <?php foreach ($potentialidps as $idp) {
104     echo  '<div class="potentialidp"><a href="' . $idp['url']->out() . '" title="' . $idp['name'] . '">' . $OUTPUT->render($idp['icon'], $idp['name']) . '&nbsp;' . $idp['name'] . '</a></div>';
105 } ?>
106         </div>
107     </div>
108 <?php } ?>
109 </div>