Rhino
|
| Posted: 07/11/2002, 11:03 PM |
|
I have been playing around with login script trying to figure out how I would show that the user succsessfully logged in.
One option would be once the user logged in the login dialog box disappered
the other would be that the user gets a welcome message something like
Welcome Back {user_id}
Anyone know how I would go about implementing this?
Cheers
Rhino
|
|
|
 |
Alessandro
|
| Posted: 07/12/2002, 12:33 AM |
|
I use a grid form with one label field. This field is user's name in users' table. Caption is "Welcome Back" or what you want. In grid form Input properties set a parameter on field id, variable name UserID, type Session, operation =
Regards,
Alessandro
|
|
|
 |
rhino
|
| Posted: 07/12/2002, 6:11 PM |
|
Ok laymans terms please, I understand half of what you are saying but I'm farly new at this.
Could you explain it step by step, sorry to be a pain in the arse
Rhino
|
|
|
 |
rhino
|
| Posted: 07/12/2002, 6:33 PM |
|
Ok I should have mentioned I am using CCS and this part in your reply is the bit that confuses me.
In grid form Input properties set a parameter on field id, variable name UserID, type Session, operation =
I cant figure out how this is done.
Cheers
|
|
|
 |
jjtoubia
|
| Posted: 07/13/2002, 11:47 PM |
|
This takes a little bit of custom code but too much too worry about. This example is written in PHP.
First off, somewhere on that login page or wherever the login box is, create the varaible that we will display when the user is logged in. Name it something like {WelcomeMessage}. You can place this underneath or above the login box but be sure not too place within the login box's comment lines. This is because we are going to make it so that if the user is logged in, the login box will not be visible...which means anything between the login box's comment lines will also not be displayed.
For Example:
<!-- BEGIN Record Login -->
<form method="post" action="{Action}" name="Login">
<font class="fhf">Login</font>
<table cellpadding="5" cellspacing="1" class="ft">
<!-- BEGIN Error -->
<tr>
<td class="dt" colspan="2">{Error}</td>
</tr>
<!-- END Error -->
<tr>
<td align="right"><b>Username:</b> </td>
<td align="left"><input name="login" value="{login}" maxlength="100" class="input"> </td>
</tr>
<tr>
<td align="right"><b>Password:</b> </td>
<td align="left"><input type="password" name="password" value="{password}" maxlength="100" class="input"> </td>
</tr>
<tr>
<td align="middle" colspan="2">
<!-- BEGIN Button DoLogin --><input name="DoLogin" type="submit" value="Login" class="button"><!-- END Button DoLogin --> </td>
</tr>
</table>
</form>
<!-- END Record Login -->
{WelcomeMessage}
Notice we have the {WelcomeMessage} variable outsite of the login box comments.
Next, goto the code section of the page to view the code. Go all the way down till you see this line: "//End Initialize HTML Template". Right underneath that line is where we will declare our WelcomeMessage variable and decide what it will display. Be sure to be in the white area and do not type in the gray area. There should be one white line so be sure to use that line. Anyway, add this code to that area. Be sure to chage the text to display what you want.
if(!CCGetUserID()) // Checks to see if the user is not logged in
{
$Tpl->SetVar("WelcomeMessage", "");// If not, variable will display nothing
$Login->Visible = TRUE; // Makes the Login box visible
}
if(CCGetUserID()) // Checks to see if the user is logged in
{
$Tpl->SetVar("WelcomeMessage", "Welcome Back " . CCGetUserLogin()); // If so, this will display the message Welcome Back and the users username
$Login->Visible = FALSE; // This will make the Login box not appear.
}
I think that is it. Let me know if you need more help.
|
|
|
 |
|