Title: Sidebar Login Script
Last modified: August 19, 2016

---

# Sidebar Login Script

 *  [dgroves](https://wordpress.org/support/users/dgroves/)
 * (@dgroves)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/sidebar-login-script/)
 * Hi,
 * I have written the following script to display various things and to allow people
   to login via the sidebar of a project, once logged in it should display various
   links depending on the user level. The script is not working as it is not detecting
   names, or the logged in users level. Please can someone assist? Script below:
 *     ```
       <li class="spec">
       						<?php global $user_ID;
       						get_currentuserinfo();
   
       						if ('' == $user_ID) {
       							//no user logged in
       							?>
   
       							<form name="loginform" id="loginform" action="http://localhost/Other/wsbeorchids/wp-login.php" method="post">
       								<div>
       									<label>Username</label>
       									<input type="text" name="log" id="user_login" class="input" value="admin" size="20" tabindex="10" />
       								</div>
       								<div>
       									<label>Password</label>
       									<input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" />
       								</div>
       								<div class="forgetmenot">
       									<input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" />
       									<label>Remember Me</label>
       								</div>
       								<div>
       									<input type="submit" name="wp-submit" class="submit" value="Log In" tabindex="100" />
       									<input type="hidden" name="redirect_to" value="http://localhost/Other/wsbeorchids/" />
       									<input type="hidden" name="testcookie" value="1" />
       								</div>
       							</form>
   
       							<ul>
       								<li><a href="http://localhost/Other/wsbeorchids/wp-login.php?action=lostpassword">Forgotten Password?</a></li>
       								<?php wp_register(); ?>
       							</ul>
   
       							<?php
       						} else {
       							// user logged in
   
       							echo "<ul>";
   
       							if ($current_user->user_level == '10') {
       								?>
   
       								<li><a href="<?php bloginfo('url');?>/wp-admin/post-new.php">New Post</a></li>
       								<li><a href="<?php bloginfo('url');?>/wp-admin/edit-pages.php">Edit Pages</a></li>
       								<li><a href="<?php bloginfo('url');?>/wp-admin/edit-comments.php">Comment Moderation</a></li>
       								<li><a href="<?php bloginfo('url');?>/wp-admin/users.php">User Moderation</a></li>
       								<li><a href="<?php bloginfo('url');?>/wp-admin/options-general.php">Options Panel</a></li>
   
       								<?php
       							} else {
       								?>
   
       								<li>Welcome, <?php echo $current_user->user_firstname . ' ' . $current_user->user_lastname; ?></li>
       								<li><a href="<?php bloginfo('url'); ?>/wp-admin/profile.php">Edit Profile</a></li>
       								<li><a href="<?php bloginfo('url'); ?>/wp-admin/tools.php">Install Gears</a></li>
   
       								<?php
       							}
       							?>
   
       							<li><a href="<?php echo wp_logout_url( get_bloginfo('url') ); ?>" title="Logout">Logout</a></li>
   
       							</ul>
   
       							<?php
       						}
       						?>
       					</li>
       ```
   

Viewing 1 replies (of 1 total)

 *  [gareth gillman](https://wordpress.org/support/users/faevilangel/)
 * (@faevilangel)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/sidebar-login-script/#post-1190609)
 * widget / plugin for it [http://wordpress.org/extend/plugins/sidebar-login/](http://wordpress.org/extend/plugins/sidebar-login/)
 * tutorial [http://www.wpdesigner.com/2007/07/09/how-to-place-a-login-form-in-the-sidebar/](http://www.wpdesigner.com/2007/07/09/how-to-place-a-login-form-in-the-sidebar/)

Viewing 1 replies (of 1 total)

The topic ‘Sidebar Login Script’ is closed to new replies.

 * 1 reply
 * 2 participants
 * Last reply from: [gareth gillman](https://wordpress.org/support/users/faevilangel/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/sidebar-login-script/#post-1190609)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
