<?php 

require_once('scripts/sb_functions.php');
global $logged_in;
$logged_in = logged_in( false, true );
	
read_config();
sb_language( 'login' );


$extra_header = '
	<script type="text/javascript">
	<!--
	function validate(theform) {
		if (theform.user.value=="" || theform.pass.value=="") {
			alert("<?php echo( $lang_string[ "form_error" ] ); ?>");
			return false;
		} else {
			return true;
		}
	}
	//-->
	</script>
';

html_header($extra_header,false);


function page_content() {
    global $lang_string, $user_colors;
    sb_language( 'login' );
		
		?>
		
		<h2><?php echo( $lang_string[ 'title' ] ); ?></h2>
		<?php echo( $lang_string[ 'instructions' ] ); ?><p />
		<?php 
		   global $blog_config;
	   	   if ($blog_config['blog_enable_signup']){
		     echo( $lang_string[ 'signup' ] ); 
		   }
                ?>
                <p />
		
		<div class="hr"><hr /></div>
		
		<form accept-charset="<?php echo( $lang_string[ 'html_charset' ] ); ?>,iso-8859-1,utf-8" action="login_cgi.php" method="post" onsubmit="return validate(this)">
		
		<label for="user"><?php echo( $lang_string[ 'username' ] ); ?></label><br />
		<input type="text" name="user" id="user" size="40" /><br /><br />
		
		<label for="pass"><?php echo( $lang_string[ 'password' ] ); ?></label><br />
		<input type="password" name="pass" id="pass" size="40" /><br />
		
		<div class="hr"><hr /></div>
		
		<input type="submit" name="submit" id="submit" value="<?php echo( $lang_string[ 'submit_btn' ] ); ?>" />
		</form>
		
		<?php 

}
theme_pagelayout();
html_footer();

?>
