<?php
//#################################################################################################
// Login helper functions
//#################################################################################################
// chillyCMS - Content Management System
// Copyright (C) 2008
// Stefanie Wiegand <hide@address.com> & Johannes Cox <hide@address.com>
//
// This program is licensed under the GPL 3.0 license. For more information see LICENSE.txt.
//#################################################################################################
// loginform($reason)
//#################################################################################################
defined('DOIT') or die('Restricted access');
//Loginform////////////////////////////////////////////////////////////////////////////////////////
function loginform($reason) {
global $timeout,$l_log,$l_uform,$user;
$userhint=$userdisplay=$pwhint=$pwdisplay="";
if ($reason=="wronguser") {
$userhint=$l_log["msg_uname_err"];
$userdisplay=" class='wrongs'";
} else if ($reason=="wrongpw") {
$pwhint=$l_log["msg_pw_err"];
$pwdisplay=" class='wrongs'";
} else if ($reason=="backend") {
$userdisplay=" class='wrongs'";
}
$loginform = "\t\t<div class='login'>\n".
"\t\t\t<h1>$l_log[txt_login]</h1><br /><br />\n".
"\t\t\t<noscript><p style='color:red;font-weight:bold;'>$l_log[txt_javascript]</p></noscript><br />\n".
"\t\t\t<form method='post' action='index.php'>\n".
"\t\t\t\t<p>$l_uform[lbl_uname]:</p>\n".
"\t\t\t\t<input$userdisplay type='text' name='name' value='$user' /><span class='wronghint'>$userhint</span><br />\n".
"\t\t\t\t<p>$l_uform[lbl_pw]:</p>\n".
"\t\t\t\t<input$pwdisplay type='password' name='pw' /><span class='wronghint'>$pwhint</span><br />\n".
"\t\t\t\t<input type='submit' class='button' value='$l_log[lbl_login]' />\n".
"\t\t\t</form>\n".
"\t\t</div>\n".
"\t\t<div class='clr'></div>\n";
return $loginform;
}
?>