* @author Adam Ashley * @copyright 2001-2006 The PHP Group * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: Html.php,v 1.11 2007/06/12 03:11:26 aashley Exp $ * @link http://pear.php.net/package/Auth * @since File available since Release 1.3.0 */ /** * Standard Html Login form * * @category Authentication * @package Auth * @author Yavor Shahpasov * @author Adam Ashley * @copyright 2001-2006 The PHP Group * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.5.4 File: $Revision: 1.11 $ * @link http://pear.php.net/package/Auth * @since Class available since Release 1.3.0 */ class Auth_Frontend_Html { // {{{ render() /** * Displays the login form * * @param object The calling auth instance * @param string The previously used username * @return void */ function render(&$caller, $username = '') { $loginOnClick = 'return true;'; // Try To Use Challene response // TODO javascript might need some improvement for work on other browsers if($caller->advancedsecurity && $caller->storage->supportsChallengeResponse() ) { // Init the secret cookie $caller->session['loginchallenege'] = md5(microtime()); print "\n"; print ''."\n";; print "\n"; $loginOnClick = ' return securePassword(); '; } print '
'."\n"; $status = ''; if (!empty($caller->status) && $caller->status == AUTH_EXPIRED) { $status = 'Your session has expired. Please login again!'."\n"; } else if (!empty($caller->status) && $caller->status == AUTH_IDLED) { $status = 'You have been idle for too long. Please login again!'."\n"; } else if (!empty ($caller->status) && $caller->status == AUTH_WRONG_LOGIN) { $status = 'Wrong login data!'."\n"; } else if (!empty ($caller->status) && $caller->status == AUTH_SECURITY_BREACH) { $status = 'Security problem detected. '."\n"; } print '
'."\n"; print ''."\n"; print ''."\n"; print ' '."\n"; print ''."\n"; print ''."\n"; print ' '."\n"; print ' '."\n"; print ''."\n"; print ''."\n"; print ' '."\n"; print ' '."\n"; print ''."\n"; print ''."\n"; //onClick=" '.$loginOnClick.' " print ' '."\n"; print ''."\n"; print '
Login ' .$status.'
Username:
Password:
'."\n"; // Might be a good idea to make the variable name variable print ''; print '
'."\n"; print '
'."\n"; } // }}} } ?>