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 -> General/Other

 [RESOLVED] CCGetUserID issue

Print topic Send  topic

Author Message
ckroon

Posts: 869
Posted: 06/07/2008, 12:18 PM

Hi all.. i have a panel I want to display if a user is set to be the administrator of the record in question.

I have this code on the Before Show event of the panel. Panel is visible+No


   
global $DBConnection1;  
 $plook = CCDLookUp("group_pid","groups_main","groupsmid=".CCGetFromGet("gid",0),$DBConnection1);  
  
if (!CCGetUserID()== $plook){    
  $Component->Visible = True;    
    }else{    
  $Component->Visible = False;    
 }  

No errors are thrown but it the panel displays regardless of who logs in.

Any ideas?
_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
jjrjr1


Posts: 942
Posted: 06/07/2008, 12:32 PM

Hi

Just a thought.

Have you tried putting somthing in the code temporarily for debugging?

Something like this after your db lookup.

echo "Plook ".$plook." User ID ".CCGetUserID(); die();

This might help by letting you know which value is not getting initialized properly for the test.

Also in looking if the above is your code maybe it should read

if(!(CCGetUserID()==$plook){do something}

Not sure what you logic is suppose to be or what gid is comming in as.

It seems your code says if "if not CCGetUserID equals $plook" this is like saying if $plook == false in which vase it is most likely to always be true and turn your page visible.

Let me know if that helps.


_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
jjrjr1


Posts: 942
Posted: 06/07/2008, 12:34 PM

Sorry,

I missed a paren also... Try this

if(!(CCGetUserID()==$plook)){do something} (If that is what you mean.)

I think you might see my point.

TAke Care


_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
ckroon

Posts: 869
Posted: 06/07/2008, 1:35 PM

I debugged using your method and realized the error.
$Plook was not generating a value.

Thanks!

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