You are not logged in.
Pages: 1
May I humbly suggest the following couple of corrections to lines that otherwise would prevent ACLs from functioning?:
[eyeroot]/system/kernal/kernal.eyecode, Line 469:
if(preg_match($value,$servParams[$i])) {
...works better if it was...
if($value === $servParams[$i]) {
As this is a straight string comparison, preg_match() is not the best thing to use. Also as $value is not set up to be used as a regex pattern, it fails anyway.
[eyeroot]/system/kernal/kernal.eyecode, Line 469:
if($count == count($ruleParams[0]['param'])) {
...works better as...
if($count > 0) {
If the rule from acl.xml being tested has more than one param, this wouldn't ever become true.
This one is more of a nicety to the enduser than a critical bug fix, but worth including, I think:
When an ACL denies a user an action, it does so without telling that user that the action was just denied. The user, not knowing why the action they're doing isn't working, gets annoyed/frustrated/sad/perplexed (delete as required) and so may think less of the system than they should.
The following is code that produces a message simply informing the user that the action was denied:
After lines 410, 423, 436 (ie. just before each of the "return false")...
msgACLreject(array('task'=>$params[0],'func'=>$servfunc));
...and the function that they call, to be placed about line 505 (after the function loadACLTables(), before the call to createFunctionAlias())...
function msgACLreject($params = null) {
if($params == null || count($params) < 1 || !isset($params['func'])) {
errorCodes('setErrorCode',array(INCORRECT_PARAMS));
return false;
}
if ($params['func']==="launch") {
$disObj = $params['task'];
} else {
$disObj = $params['func'];
}
eyeX('messageBox',array('content'=>$disObj.' has been disabled by your admin'));
}
Enjoy!
Also, after spending time elbow-deep in the workings for ACLs (metaphorically speaking), I thought I'd write a guide on how to set up ACLs... If I hear no complaints, I'll post in the "Help & Support" forum when the first draft is complete.
Offline
s0600204, great job!
I'm going to review your bugfixes and commit them to SVN ;-)
Hey Lars, what about giving s0600204 an SVN account?
[EDIT]Bugfixes committed to SVN 7340. Many thanks!!![/EDIT]
PS = I'm sure that an howto would be greatly appreciated by a lot of users!!! As soon as you write it, please tell me here, so I will make that howto a sticky topic! (if you reply in this topic, I'll get an automatic email since I'm watching it, so I'll immediately have a look at it)
Last edited by lucaferrario (2012-02-03 02:43:50)
Offline
Thanks, Luca!
The first draft of the guide has been written, see http://forums.lars-sh.de/viewtopic.php?id=100 for details.
(P.S. I'm registered as 's0600204' on sourceforge if that helps Lars)
Offline
Great job!!!
I've already sticked that topic. I've fastly read it, and it seems really well made! When you make the final version (or if you find out that the draft is good enough to become the final version), please tell me: I'll create an article on the main lars-sh.de site and attach the file!
Offline
Pages: 1