Index: bp-core-widgets.php
===================================================================
--- bp-core-widgets.php	(revision 604444)
+++ bp-core-widgets.php	(working copy)
@@ -7,6 +7,7 @@
 	add_action('widgets_init', create_function('', 'return register_widget("BP_Core_Members_Widget");') );
 	add_action('widgets_init', create_function('', 'return register_widget("BP_Core_Whos_Online_Widget");') );
 	add_action('widgets_init', create_function('', 'return register_widget("BP_Core_Recently_Active_Widget");') );
+	add_action('widgets_init', create_function('', 'return register_widget("BP_Core_Login_Widget");') ); 
 }
 add_action( 'bp_register_widgets', 'bp_core_register_widgets' );
 
@@ -45,11 +46,11 @@
 		<?php if ( bp_has_members( 'user_id=0&type=' . $instance['member_default'] . '&max=' . $instance['max_members'] . '&populate_extras=0' ) ) : ?>
 			<div class="item-options" id="members-list-options">
 				<a href="<?php echo site_url( bp_get_members_root_slug() ); ?>" id="newest-members" <?php if ( $instance['member_default'] == 'newest' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Newest', 'buddypress' ) ?></a>
-				|  <a href="<?php echo site_url( bp_get_members_root_slug() ); ?>" id="recently-active-members" <?php if ( $instance['member_default'] == 'active' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Active', 'buddypress' ) ?></a>
+				<span>|</span>  <a href="<?php echo site_url( bp_get_members_root_slug() ); ?>" id="recently-active-members" <?php if ( $instance['member_default'] == 'active' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Active', 'buddypress' ) ?></a>
 
 				<?php if ( bp_is_active( 'friends' ) ) : ?>
 
-					| <a href="<?php echo site_url( bp_get_members_root_slug() ); ?>" id="popular-members" <?php if ( $instance['member_default'] == 'popular' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Popular', 'buddypress' ) ?></a>
+					<span>|</span> <a href="<?php echo site_url( bp_get_members_root_slug() ); ?>" id="popular-members" <?php if ( $instance['member_default'] == 'popular' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Popular', 'buddypress' ) ?></a>
 
 				<?php endif; ?>
 			</div>
@@ -325,4 +326,105 @@
 }
 add_action( 'wp_ajax_widget_members', 'bp_core_ajax_widget_members' );
 
+
+
+/*** LOGIN WIDGET *****************/ 
+
+class BP_Core_Login_Widget extends WP_Widget { 
+
+	function __construct() {
+		$widget_ops = array( 'description' => __( 'Log in/out form for BuddyPress, register link', 'buddypress' ) );
+		parent::__construct( false, $name = __( 'BuddyPress Login', 'buddypress' ), $widget_ops );
+	}
+	
+	function widget($args, $instance) { 
+		global $bp; 
+		
+		$args = apply_filters( 'bp_login_widget_args', $args ); 
+		
+		extract( $args ); 
+		
+		echo $before_widget; 
+		echo $before_title 
+		. $instance['title']
+		. $after_title; ?> 
+		
+		<?php if ( is_user_logged_in() ) : ?> 
+		
+			<?php do_action( 'bp_before_sidebar_me' ) ?> 
+			
+			<div id="sidebar-me" class="widget"> 
+				<a href="<?php echo bp_loggedin_user_domain() ?>"> 
+				<?php bp_loggedin_user_avatar( 'type=thumb&width=40&height=40' ) ?> 
+				</a> 
+				
+				<h4><?php echo bp_core_get_userlink( bp_loggedin_user_id() ); ?></h4> 
+				<a class="button logout" href="<?php echo wp_logout_url( bp_get_root_domain() ) ?>"><?php _e( 'Log Out', 'buddypress' ) ?></a> 
+				
+				<?php do_action( 'bp_sidebar_me' ) ?> 
+			</div> 
+			
+			<?php do_action( 'bp_after_sidebar_me' ) ?> 
+			
+			<?php if ( function_exists( 'bp_message_get_notices' ) ) : ?> 
+				<?php bp_message_get_notices(); /* Site wide notices to all users */ ?> 
+			<?php endif; ?> 
+		
+		<?php else : ?> 
+		
+			<?php do_action( 'bp_before_sidebar_login_form' ) ?> 
+			
+			<div id="sidebar-me" class="widget">
+				<p id="login-text"> 
+					<span><?php _e( 'To start connecting please log in first.', 'buddypress' ) ?></span>
+					<?php if ( bp_get_signup_allowed() ) : ?> 
+					<span><?php printf( __( ' You can also <a href="%s" title="Create an account">create an account</a>.', 'buddypress' ), site_url( BP_REGISTER_SLUG . '/' ) ) ?></span>
+					<?php endif; ?> 
+				</p> 
+				
+				<form name="login-form" id="sidebar-login-form" class="standard-form" action="<?php echo site_url( 'wp-login.php', 'login_post' ) ?>" method="post"> 
+					<label><?php _e( 'Username', 'buddypress' ) ?><br /> 
+					<input type="text" name="log" id="sidebar-user-login" class="input" /></label> 
+					
+					<label><?php _e( 'Password', 'buddypress' ) ?><br /> 
+					<input type="password" name="pwd" id="sidebar-user-pass" class="input" /></label> 
+					
+					<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="sidebar-rememberme" value="forever" /> <?php _e( 'Remember Me', 'buddypress' ) ?></label></p> 
+					
+					<?php do_action( 'bp_sidebar_login_form' ) ?> 
+					<input type="submit" name="wp-submit" id="sidebar-wp-submit" value="<?php _e('Log In'); ?>" tabindex="100" /> 
+					<input type="hidden" name="testcookie" value="1" /> 
+				</form> 
+			</div>
+			<?php do_action( 'bp_after_sidebar_login_form' ) ?> 
+		
+		<?php endif; ?> 
+		
+		<?php echo $after_widget; ?> 
+	<?php 
+	} 
+	
+	function update( $new_instance, $old_instance ) { 
+		$instance = $old_instance; 
+		$instance['title'] = strip_tags( $new_instance['title'] );
+		
+		return $instance; 
+	} 
+	
+	function form( $instance ) { 
+	
+			$defaults = array(
+			'title' => 'BuddyPress Login'
+		);
+		$instance = wp_parse_args( (array) $instance, $defaults );
+
+		$title = strip_tags( $instance['title'] );
+		?>
+
+		<p><label for="bp-core-widget-login-title"><?php _e('Title:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%" /></label></p>
+ 
+		<p><?php _e( 'Log in/out form for BuddyPress. Adds a register link if registration is open.', 'buddypress' ) ?></p> 
+	<?php 
+	} 
+} 
 ?>
\ No newline at end of file
