Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Login Box  (Read 3272 times)

0 Members and 1 Guest are viewing this topic.

rbaby

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Login Box
« on: June 08, 2005, 12:04:04 am »

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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Login Box
« Reply #1 on: June 08, 2005, 06:58:23 am »

Code: [Select]
<?php
if (USER_ID) {
    echo 
'You are already logged in';
} else {
    
// display your login box here
}
?>
« Last Edit: June 09, 2005, 08:27:44 am by GauGau »
Logged

Nibbler

  • Guest
Re: Login Box
« Reply #2 on: June 08, 2005, 04:42:23 pm »

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 ;)
Logged

LilDog

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Login Box
« Reply #3 on: July 09, 2005, 05:17:03 am »

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:

Code: [Select]
<!-- 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!
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.