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.
_________________
Walter Kempees...you are dearly missed. |
|
|
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.
>
>
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>
|
|
|
ckroon
Posts: 869
|
Posted: 03/03/2008, 10:39 PM |
|
Thanks Walter! And DataDoit!
All I was missing was that damned '!' lol
_________________
Walter Kempees...you are dearly missed. |
|
|
|