packages/ssoinabox-webui/root/usr/local/share/weblogin/ssoinabox/templates/login.tmpl
author Dan Fuhry <dan@fuhry.us>
Fri, 11 Jan 2013 00:32:54 -0500
changeset 3 a044870a9d3d
parent 0 3906ca745819
permissions -rw-r--r--
Added password reset function

<!DOCTYPE html>
<!-- :mode=html: -->
<html>
  <head>
    <meta http-equiv="pragma" content="no-cache" />
    <title>SSO-in-a-Box Login</title>
    <link rel="stylesheet" type="text/css" href="images/bootstrap/css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="images/ssoinabox.css" />
  </head>

  [% IF notdefined %]
<!--
This is the template for the WebAuth login page.  This page is called from
login.fcgi script on the weblogin server.  It displays a form asking the
user for username and password.  Variables used:

error                  : some error occurred
err_missinginput       : one of username or password missing
err_username           : no username error
err_password           : no password error
err_loginfailed        : username and password were incorrect
err_forced             : web site requires username/password login
err_rejected           : username not permitted to authenticate
RT                     : Response Token
ST                     : Service Token
username               : the username
login_cancel           : a cancel URL was specified
cancel_url             : the specified cancel URL
show_remuser           : show a button for REMOTE_USER authentication
remuser_failed         : REMOTE_USER authentication was tried and failed
remuser_url            : where to send the user for REMOTE_USER auth
-->
  [% END %]

  <body onload="document.forms.login.username.focus();">
  	<div class="well login-form">
  	<h1>
  		<img alt="SSO in a Box" src="images/ssoinabox.png" />
	</h1>
  	
    [% IF error %]
      <div class="alert alert-error">
          [% IF err_missinginput %]
            <!-- This is just the combination of err_username and
                 err_password if you want only one error message.  We
                 don't use it. -->
          [% END %]
          [% IF err_username && err_password %]
            <!-- Error: no username or password submitted. -->
            Error: Enter your username and password.
          [% ELSIF err_username %]
            <!-- Error: no username submitted. -->
            Error: Enter your username.
          [% ELSIF err_password %]
            <!-- Error: no password submitted. -->
            Error: Enter your password.
          [% END %]

          [% IF err_loginfailed %]
            <!-- Error: login failed. -->
            Error: You entered an incorrect username or password (or both).
          [% END %]

          [% IF err_rejected %]
            <!-- Error: user principal rejected. -->
            Error: That username may not authenticate to this service.
          [% END %]

          [% IF err_forced %]
            <!-- Not really an error, forced login. -->
            This web site requires that you log in with username and password.
          [% END %]
      </div>
    [% END %]

    [% IF remuser_failed %]
      <div class="error" align="center">
        <p><strong>Error: Apache authentication was tried and
        failed.</strong></p>
      </div>
    [% END %]

    <div class="loginbox">
		<form name="login" action="[% script_name FILTER html %]" method="post" autocomplete="OFF" enctype="application/x-www-form-urlencoded">
			<input type="hidden" name="rm" value="index" />
			<input type="hidden" name="RT" value="[% RT FILTER html %]" />
			<input type="hidden" name="ST" value="[% ST FILTER html %]" />
			<input type="hidden" name="login" value="yes" />
			
			<i class="icon icon-user"></i> <input name="username" type="text" value="[% username FILTER html %]" placeholder="Username" /><br />
			<i class="icon icon-lock"></i> <input name="password" type="password" placeholder="Password" /><br />
			
			<input type="submit" name="Submit" value="Login" class="btn btn-primary" />
			[% IF login_cancel %]
				<!-- The WebAuth Server has a cancel url.-->
				<a href="[% cancel_url FILTER html %]" class="btn">Cancel</a>
			[% END %]
			
			<br />
			<p class="links">
				<a href="/lostpw">Forgot password?</a> &bull;
				<a href="/">Account Control Panel</a> &bull;
				<a href="/help.html">Help</a>
			</p>
		</form>
	</div>

    [% IF show_remuser %]
      <div class="remuserbox" align="center">
        <table border="1" width="70%">
          <tr>
              <td>
                Or skip entering your username and password.  Instead,
                log in using your computer login information via
                Apache authentication:
              </td>
              <td>
                <form action="[% remuser_url FILTER html %]"
                      method="get">
                  <input type="hidden" name="rm" value="index">
                  <input type="hidden" name="RT"
                         value="[% RT FILTER html %]">
                  <input type="hidden" name="ST"
                         value="[% ST FILTER html %]">
                  <input type="submit" name="Submit" value="remuser">
                </form>
              </td>
            </tr>
        </table>
      </div>
    [% END %]
    
	</div> <!-- div.well.login-form -->
  </body>
</html>