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

 [RESOLVED] Where is $GroupsAccess assigned?

Print topic Send  topic

Author Message
tcb

Posts: 34
Posted: 07/25/2009, 5:56 PM

Hi,

I've been trying to modify the user-to-group handling in CCS4. Old posts in this forum have helped me to modify the login function (almost) appropriately.

But I have a nagging question about the (presumably global) PHP variable $GroupsAccess. I see it read repeatedly, but AFAICT nothing is ever written to it, ever.

This isn't holding anything up and I hate to waste anyone's time, but I hate it when little mysteries come along that I can't solve. Can anyone tell me what this variable is doing and how it acquires a value??

TIA
View profile  Send private message
jjrjr1


Posts: 942
Posted: 07/25/2009, 6:49 PM

Don't know
I have never used it

you migh want to try a search in all files for the variable name. It might find where it gets set an point you in the right direction

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

Posts: 34
Posted: 07/25/2009, 7:08 PM

Quote jjrjr1:
you migh want to try a search in all files for the variable name. It might find where it gets set an point you in the right direction

That's what I did. I had EMEditor search my entire htdocs folder. Nothing. :-/
View profile  Send private message
datadoit
Posted: 07/26/2009, 6:57 AM

It's in Common.php in the CCSecurityRedirect() function.
datadoit
Posted: 07/26/2009, 6:59 AM

BTW, use Edit -> Find and Replace -> Find in Files feature in CCS. Very
powerful.
tcb

Posts: 34
Posted: 07/26/2009, 10:43 AM

Quote datadoit:
It's in Common.php in the CCSecurityRedirect() function.

Here's my one. I don't see an assignment. Is it broken?

  
 //CCSecurityRedirect @0-F212A7B7  
function CCSecurityRedirect($GroupsAccess, $URL)  
{  
    global $_SERVER;  
    $ReturnPage = isset($_SERVER["REQUEST_URI"]) ? $_SERVER["REQUEST_URI"] : "";  
    if(!strlen($ReturnPage)) {  
        $ReturnPage = isset($_SERVER["SCRIPT_NAME"]) ? $_SERVER["SCRIPT_NAME"] : "";  
        $QueryString = CCGetQueryString("QueryString", "");  
        if($QueryString !== "")  
            $ReturnPage .= "?" . $QueryString;  
    }  
    $ErrorType = CCSecurityAccessCheck($GroupsAccess);  
    if($ErrorType != "success")  
    {  
        if(!strlen($URL))  
            $Link = ServerURL . "login.php";  
        else  
            $Link = $URL;  
        header("Location: " . $Link . "?ret_link=" . urlencode($ReturnPage) . "&type=" . $ErrorType);  
        exit;  
    }  
}  
//End CCSecurityRedirect  

Quote datadoit:
BTW, use Edit -> Find and Replace -> Find in Files feature in CCS. Very powerful.

And very slow and only searches a single project :( But it did confirm what EMEditor has been saying.

Anyway, thanks for the pointers. I'm no longer sure that my question is just out of curiosity. Something does seem to be wrong, so I'll contact Support.
View profile  Send private message
jjrjr1


Posts: 942
Posted: 07/26/2009, 1:40 PM

I have not run the search but in answer to your original question

Quote tcb:
Can anyone tell me what this variable is doing and how it acquires a value??


it seems to get it's value as an argument to this function. It's value is assigned right here.

Your EMEditor or whatever must be broken if it did not show you this.

Don't know where else it's used.

I certainly would think a search thru all files would illuminate how else it gets it's value. This example in common is certainly clear how it get's it's value in this case.

Now all you gotta do is do a search and see who calls security CCSecurityRediect() and what is put into the first parameter.


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


Posts: 942
Posted: 07/26/2009, 1:46 PM

I just noticed it is also an agument to this function

$ErrorType = CCSecurityAccessCheck($GroupsAccess);

This is probably the main use for this thing.

See also who calls this function. I bet you will be able to figure out what it is doing.

Datadoit pointed you to the exact place to start your investigation.




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


Posts: 942
Posted: 07/26/2009, 1:53 PM

BTW Take a look at

CCSecurityAccessCheck($GroupsAccess);


This might tell you what it does and why


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

Posts: 34
Posted: 07/26/2009, 2:16 PM

Quote jjrjr1:

See also who calls this function.

I am an idiot. :-/ :-( :-O

It's an integer (or null) passed by every single page.

I had it stuck in my mind that it was a global.

Oh, well, thanks everyone, and sorry for the waste of bandwidth ...
View profile  Send private message
jjrjr1


Posts: 942
Posted: 07/26/2009, 2:20 PM

No Problem

Glad to help.. Happens to me ALL the time...:-)

Sometimes it takes a nudge.

LOL

_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
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.

Web Database

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.