[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/login/ -> index_form.html (source)

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


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1