<?php
/**
 * login_view.php - Login view file
 *
 * @author $Author: dtong $
 * @version $Id: login_view.php,v 1.16 2011/05/18 04:25:16 dtong Exp $
 * @copyright Copyright (c) 2009, Tiller Software Co., Ltd.
*/
/*
 * Javascript prepareLogin() encrypts the username and password based on server supplied
 * DES encryption/decryption key. This is just good enough to stop casual password sniffers but
 * if someone with decent Javascript skills captures all your traffic between the browser
 * and server then he/she can easily obtain your password and username. But, having this is
 * better than having nothing. SSL/HTTPS is the only way to fully protect your password.
 *
 * Was looking at combining RAS and DES like WordPress's Login Encrypt plugin for
 * better non-HTTPS protection but not worth the effort...
 */
echo form_open('login', 'name="loginform" method="post" onSubmit="prepareLogin();return false"');
?>
<center>
<div style="height:20px"></div>
<h2><?php echo $this->config->item('cms_login_title');?></h2>
<div style="height:20px"></div>
<table width="10%" cellspacing="15" style="border:2px solid #003A67;">
  <tr>
    <td width="25%" align="right" nowrap="nowrap" style="font-size:13px;font-weight:bold"><?php echo lang('login_username');?>: </td>
    <td width="75%" align="left" nowrap="nowrap">
    	<input type="text" name="username" size="16" maxlength="45" value="<?php echo $username?>" style="font-size:13px" /></td>
  </tr>
  <tr>
    <td align="right" nowrap="nowrap" style="font-size:13px;font-weight:bold"><?php echo lang('login_password');?>:</td>
    <td align="left" nowrap="nowrap"><input type="password" name="password" size="16" maxlength="65" style="font-size:13px" /></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><input type="submit" value="<?php echo lang('login_submit')?>" <?php osa_btn();?>  /></td>
    </tr>
</table>
<?php if ($msg) { //This is for telling misssing password etc. ?>
	<div class="login_message"><b><?php echo $msg;?></b></div>
<?php }
	$noticemsg = $this->config->item('cms_login_message');
	if( !empty($noticemsg) ) {
		//This is for printing todcm file content
?>
	<div class="login_message"><?php echo $noticemsg ?></div>
<?php }
	if ($msg_mode) { //This is for general stop/main mode msgs ?>
		<div class="login_message"><b><?php echo $msg_mode;?></b></div>
<?php } ?>
</center>
<?php echo '</form>'; //Use echo to fool Eclipse IDE validation?>

<div style="margin-bottom:150px;"></div>
<?php
	//This is needed so the browser won't offer to save the encrypted password
	echo form_open('login', 'name="realloginform" method="post"');
?>
<input type="hidden" name="username" />
<input type="hidden" name="password" />
<?php echo '</form>'?>
