<?php
/*
Template Name: Login
*/
get_header(); 

global $gp_settings, $user_ID, $user_identity, $user_level; ?>

<?php if($gp_settings['title'] == "Show") { ?><h1 class="page-title"><?php _e('Login', 'gp_lang'); ?></h1><?php } ?>

<div id="content">

	<!--Begin Image-->
	<?php if(has_post_thumbnail() && $gp_settings['show_image'] == "Show") { ?>	
		<div class="post-thumbnail<?php if($gp_settings['image_wrap'] == "Disable") { ?> thumbnail-no-wrap<?php } ?>">
			<?php $image = vt_resize(get_post_thumbnail_id(), '', $gp_settings['image_width'], $gp_settings['image_height'], true); ?>
			<img src="<?php echo $image[url]; ?>" alt="<?php if(get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) { echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true); } else { echo get_the_title(); } ?>" />			
		</div>
		
		<?php if($gp_settings['image_wrap'] == "Disable") { ?><div class="clear"></div><?php } ?>
		
	<?php } ?>
	<!--End Image-->
		
	<?php if($user_ID) { ?>
	
		<h2><?php _e('You are already logged in.', 'gp_lang'); ?></h2>
	
	<?php } else { ?>
	
		<form action="<?php echo site_url(); ?>/wp-login.php" method="post">
			<p><label for="log"><?php _e('Username', 'gp_lang'); ?></label>
			<br/><input type="text" name="log" id="log" value="<?php echo esc_html(stripslashes($user_login), 1) ?>" size="22" /></p>
			
			<p><label for="pwd"><?php _e('Password', 'gp_lang'); ?></label><br/>
			<input type="password" name="pwd" id="pwd" size="22" /></p>
			
			<p><input type="submit" name="submit" value="<?php _e('Login', 'gp_lang'); ?> &rarr;" class="button" />
			<label for="rememberme"><input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> <?php _e('Remember Me', 'gp_lang'); ?></label></p>
			<input type="hidden" name="redirect_to" value="<?php echo($_SERVER['HTTP_REFERER']); ?>"/>
		</form>

		<?php if((function_exists('bp_is_active') && bp_get_signup_allowed()) OR $theme_register_url) { ?><a href="<?php if($theme_register_url) { echo $theme_register_url; } else { echo bp_get_signup_page(false); } ?>"><?php _e('Register', 'gp_lang'); ?></a> | <?php } ?><a href="<?php echo site_url(); ?>/wp-login.php?action=lostpassword"><?php _e('Lost Password', 'gp_lang'); ?></a>
	
	<?php } ?>

</div>
	
<?php get_sidebar(); ?>

<?php get_footer(); ?>