CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Hide/Show Panel with Login status

Print topic Send  topic

Author Message
ckroon

Posts: 869
Posted: 03/03/2008, 8:59 AM

I have searched high and low to no avail.. I know its got to be easy...

I have a home page where there is a menu that only shows up if the user is logged in, whatever security level they have determines the menu they see.

What I want is a "You must login!" text to appear, in a panel when they first get to that page, then after they login, it disappears and the menu is in its place.

I have the regular old Hide/show code on the panel, but I can't get it to work for CCGetSessionID or anything else.
Any and all advice is greatly appreciated.


:-D
_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
datadoit
Posted: 03/03/2008, 12:20 PM

Where is the code to check for the login at? In the Panel BeforeShow?
The Menu's BeforeShow? The Page's BeforeShow?

If it's NOT in the Panel's BeforeShow, you're going to have to globalize
the panel's name in whatever event you're testing it in.

I typically like to keep these types of tests in the Page's BeforeShow
event. Helps me later when I come back to the page to try and determine
what was happening here.

In that case, you'll have to:

global $YourMenuName;
global $YourPanelName;

test for conditions
$Container->YourMenuName->Visible = false;
$Container->YourPanelName->Visible = true;

etc.
wkempees
Posted: 03/03/2008, 2:46 PM

On 1 page ( I have a three column tabel, all below is in first column all in
same row)

Panel1
AuthenticationBuilder->LoginPage

Panel2
Text: You Must Login

Panel3
Your menubuilders menu

BeforeShow Panel1:
  
 if (!CCGetUserID()){  
  $Component->Visible = True;  
    }else{  
  $Component->Visible = False;  
 }  
BeforeShow Panel2
  
 if (!CCGetUserID()){  
  $Component->Visible = True;  
    }else{  
  $Component->Visible = False;  
 }  
BeforeShow Panel3
  
 if (CCGetUserID()){            // Note the missing ! mark  
  $Component->Visible = True;  
    }else{  
  $Component->Visible = False;  
 }  

The Panel1 containing the Authentication is of course optional
either use this or the Panel2 as you have chosen.
But anyway it is how I did it.

Walter

"ckroon" <ckroon@forum.codecharge> schreef in bericht
news:547cc2e62d84fc@news.codecharge.com...
>I have searched high and low to no avail.. I know its got to be easy...
>
> I have a home page where there is a menu that only shows up if the user is
> logged in, whatever security level they have determines the menu they see.
>
> What I want is a "You must login!" text to appear, in a panel when they
> first
> get to that page, then after they login, it disappears and the menu is in
> its
> place.
>
> I have the regular old Hide/show code on the panel, but I can't get it to
> work
> for CCGetSessionID or anything else.
> Any and all advice is greatly appreciated.
>
>
> :-D
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>

ckroon

Posts: 869
Posted: 03/03/2008, 10:39 PM

Thanks Walter! And DataDoit! :-D

All I was missing was that damned '!' lol

_________________
Walter Kempees...you are dearly missed.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.