Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Unique Style Sheet?

So, maybe my problem is that I haven’t included ALL the code from wp-login in the sidebar…instead I’ve just included the code necessary to get them redirected to the wp-login.php to actually be logged in…Here’s what it looks like. Maybe you can make sense of it:

<!--BEGIN SIDEBAR-->
<?php

$user_login = '';
$user_pass = '';
$using_cookie = false;
if ( !isset( $_REQUEST['redirect_to'] ) )
$redirect_to = 'wp-admin/';
else
$redirect_to = $_REQUEST['redirect_to'];

if( $_POST ) {
$user_login = $_POST['log'];
$user_login = sanitize_user( $user_login );
$user_pass = $_POST['pwd'];
$rememberme = $_POST['rememberme'];
} else {
$cookie_login = wp_get_cookie_login();
if ( ! empty($cookie_login) ) {
$using_cookie = true;
$user_login = $cookie_login['login'];
$user_pass = $cookie_login['password'];
}
}

do_action('wp_authenticate', array(&$user_login, &$user_pass));

?>

<span class="sidenav_top">&nbsp;</span>
<ul class="sidenav_body" style="">
<li><h2>Login:</h2></li>

<?php

global $userdata;
get_currentuserinfo();
global $user_identity;

if (!$userdata) {
?>

<li style="padding-left: 10px; overflow: hidden;">
<form name="loginform" id="loginform" action="/wp-login.php" method="post">
<p style="margin: 0px; height: 25px; width: 175px;">
<label style="font-size: 11px; text-align: right; width: 76px; display: block; float: left; clear: left;"><?php _e('Username:') ?>&nbsp;</label>

<input style="float: right;" type="text" name="log" id="log" value="<?php echo wp_specialchars(stripslashes($user_login), 1); ?>" size="13" tabindex="1" />
</p>
<p style="margin: 0px; height: 25px; width: 175px;">
<label style="font-size: 11px; text-align: right; width: 76px; display: block; float: left; clear: left;"><?php _e('Password:') ?>&nbsp;</label>

<input style="float: right;" type="password" name="pwd" id="pwd" value="" size="13" tabindex="2" />
</p>
<p style="margin: 0px; height: 22px; float: right; margin-right: 10px; clear: both;">
<label style="font-size: 12px;"><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="3" />
<?php _e('Remember me'); ?></label></p>
<p class="submit" style="height: 35px;">
<input style="float: right; clear: both; margin-right: 10px;" type="submit" name="submit" id="submit" value="<?php _e('Login'); ?> &raquo;" tabindex="4" />
<input type="hidden" name="redirect_to" value="index.php" />
</p>
</form>

I am guessing the difference between how I have it set up and how you have it is that I am sending the user to wp-login whereas you are authenticating right there on that page. I tried to get the sidebar to do all the work, but I ran into errors I couldn’t fix on my own…do you have a suggestion for how I might handle the logins in the sidebar? Do you maybe have code I can look at to see how you’re doing it?

Skip to toolbar