Login Box Login Box
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Login Box

Started by rbaby, June 08, 2005, 12:04:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rbaby

Hey guys,  I made a login box in my template...this box is universal to the site and is the only place where people can log on.  How do I change this to make the box show something else when the user is ALREADY signed on?  As it stands right now, the box does *not* go away even after you log on...I would like it to just say "you are already logged in USER_NAME" and a link to "logout".  Thanks guys.

Joachim Müller

#1
<?php
if (USER_ID) {
    echo 
'You are already logged in';
} else {
    
// display your login box here
}
?>

Nibbler

You'll need to convert the login box to a proper custom header if you need dynamic behaviour. You would of course need to escape single quotes properly too ;)

LilDog

I would like to do something similar to this, utilizing VBulletin's login.

I can put the following code on the template.html and it will properly log the user in. However I would like to replace the current "Login" text in the {MAIN_MENU}field so that the login box will disappear when the user is logged in. Where do I find the {MAIN_MENU} code?

Here is the VBullein login box code that want to use:


<!-- login form -->
<form action="/forum/login.php" method="post" onsubmit="md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)">
<script type="text/javascript" src="clientscript/vbulletin_md5.js"></script>
<table cellpadding="0" cellspacing="3" border="0">
<tr>
<td class="smallfont">User Name</td>
<td><input type="text" class="button" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="1" value="User Name" onfocus="if (this.value == 'User Name') this.value = '';" /></td>
<td class="smallfont" colspan="2" nowrap="nowrap"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="3" id="cb_cookieuser_navbar" accesskey="c" checked="checked" />Remember Me?</label></td>
</tr>
<tr>
<td class="smallfont">Password</td>
<td><input type="password" class="button" name="vb_login_password" size="10" accesskey="p" tabindex="2" /></td>
<td><input type="submit" class="button" value="Log in" tabindex="4" title="Enter your username and password in the boxes provided to login, or click the 'register' button to create a profile for yourself." accesskey="s" /></td>
</tr>
</table>
<input type="hidden" name="s" value="" />
<input type="hidden" name="do" value="login" />
<input type="hidden" name="forceredirect" value="1" />
<input type="hidden" name="vb_login_md5password" />
<input type="hidden" name="vb_login_md5password_utf" />
</form>
<!-- / login form -->


If anyone could give me some assistance here, it would be MUCH appreciated! Thanks!