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
|
 |
 |
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 |
 |
 |
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.
|
 |
 |
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.
|
 |
 |
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 |
 |
 |
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 |
 |
 |
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 |
 |
 |
tcb
Posts: 34
|
| Posted: 07/26/2009, 2:16 PM |
|
Quote jjrjr1:
See also who calls this function.
I am an idiot. 
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 ...
|
 |
 |
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 |
 |
 |