50     function render(&$caller, $username = 
'') {
 
   51         $loginOnClick = 
'return true;';
 
   55         if($caller->advancedsecurity && $caller->storage->supportsChallengeResponse() ) {
 
   58             $caller->session[
'loginchallenege'] = md5(microtime());
 
   61             print 
'<script language="JavaScript">'.
"\n";
 
   63             include 
'Auth/Frontend/md5.js';
 
   66             print 
' function securePassword() { '.
"\n";
 
   67             print 
'   var pass = document.getElementById(\''.$caller->getPostPasswordField().
'\');
'."\n"; 
   68             print '   var secret = document.getElementById(\
'authsecret\')'.
"\n";
 
   74             if ($caller->storage->getCryptType() == 
'md5' ) {
 
   75                 print 
'   pass.value = hex_md5(pass.value); '.
"\n";
 
   76                 #print '   alert(pass.value);'; 
   79             print 
'   pass.value = hex_md5(pass.value+\''.$caller->session[
'loginchallenege'].
'\'); 
'."\n"; 
   80             // print '   alert(pass.value);
'; 
   81             print '   secret.value = 1;
'."\n"; 
   82             print '   var doLogin = document.getElementById(\
'doLogin\')'.
"\n";
 
   83             print 
'   doLogin.disabled = true;'.
"\n";
 
   84             print 
'   return true;';
 
   86             print 
'</script>'.
"\n";;
 
   89             $loginOnClick = 
' return securePassword(); ';
 
   92         print 
'<center>'.
"\n";
 
   95         if (!empty($caller->status) && $caller->status == 
AUTH_EXPIRED) {
 
   96             $status = 
'<i>Your session has expired. Please login again!</i>'.
"\n";
 
   97         } 
else if (!empty($caller->status) && $caller->status == 
AUTH_IDLED) {
 
   98             $status = 
'<i>You have been idle for too long. Please login again!</i>'.
"\n";
 
   99         } 
else if (!empty ($caller->status) && $caller->status == 
AUTH_WRONG_LOGIN) {
 
  100             $status = 
'<i>Wrong login data!</i>'.
"\n";
 
  102             $status = 
'<i>Security problem detected. </i>'.
"\n";
 
  105         print 
'<form method="post" action="'.$caller->server[
'PHP_SELF'].
'" ' 
  106             .
'onSubmit="'.$loginOnClick.
'">'.
"\n";
 
  107         print 
'<table border="0" cellpadding="2" cellspacing="0" ' 
  108             .
'summary="login form" align="center" >'.
"\n";
 
  110         print 
'    <td colspan="2" bgcolor="#eeeeee"><strong>Login </strong>' 
  111             .$status.
'</td>'.
"\n";
 
  114         print 
'    <td>Username:</td>'.
"\n";
 
  115         print 
'    <td><input type="text" id="'.$caller->getPostUsernameField()
 
  116             .
'" name="'.$caller->getPostUsernameField().
'" value="' . $username
 
  120         print 
'    <td>Password:</td>'.
"\n";
 
  121         print 
'    <td><input type="password" id="'.$caller->getPostPasswordField()
 
  122             .
'" name="'.$caller->getPostPasswordField().
'" /></td>'.
"\n";
 
  127         print 
'    <td colspan="2" bgcolor="#eeeeee"><input value="Login" ' 
  128             .
'id="doLogin" name="doLogin" type="submit" /></td>'.
"\n";
 
  130         print 
'</table>'.
"\n";
 
  133         print 
'<input type="hidden" id="authsecret" name="authsecret" value="" />';
 
  134         print 
'</form>'.
"\n";
 
  135         print 
'</center>'.
"\n";