diff --git a/include/class_acl.inc b/include/class_acl.inc
index 522f10e3247a703a52c3b3bccd3aaf820afd149f..dec421bec554a299818248ac8a34567b071c4ee5 100644 (file)
--- a/include/class_acl.inc
+++ b/include/class_acl.inc
if (preg_match('/^cat_del_.*_x/', $name)){
$idx= preg_replace('/^cat_del_([^_]+)_.*$/', '\1', $name);
foreach ($this->ocMapping[$idx] as $key){
if (preg_match('/^cat_del_.*_x/', $name)){
$idx= preg_replace('/^cat_del_([^_]+)_.*$/', '\1', $name);
foreach ($this->ocMapping[$idx] as $key){
- unset($this->aclContents[$key]);
+ unset($this->aclContents["$idx/$key"]);
}
continue;
}
}
continue;
}
$aclDialog= TRUE;
list($dummy, $object, $attribute, $value)= split('_', $name);
$aclDialog= TRUE;
list($dummy, $object, $attribute, $value)= split('_', $name);
+ /* Skip for detection entry */
+ if ($object == 'dummy') {
+ continue;
+ }
+
/* Ordinary ACLs */
if (!isset($new_acl[$object])){
$new_acl[$object]= array();
/* Ordinary ACLs */
if (!isset($new_acl[$object])){
$new_acl[$object]= array();
}
/* Only be interested in new acl's, if we're in the right _POST place */
}
/* Only be interested in new acl's, if we're in the right _POST place */
- if ($aclDialog && isset($this->ocMapping[$this->aclObject])){
+ if ($aclDialog && is_array($this->ocMapping[$this->aclObject])){
+
foreach ($this->ocMapping[$this->aclObject] as $oc){
unset($this->aclContents[$oc]);
unset($this->aclContents[$this->aclObject.'/'.$oc]);
foreach ($this->ocMapping[$this->aclObject] as $oc){
unset($this->aclContents[$oc]);
unset($this->aclContents[$this->aclObject.'/'.$oc]);
return ($smarty->fetch (get_template_path('acl.tpl')));
}
return ($smarty->fetch (get_template_path('acl.tpl')));
}
-
+ function sort_by_priority($list)
+ {
+ $tmp= get_global('plist');
+ $plist= $tmp->info;
+ asort($plist);
+
+ foreach($list as $name => $translation){
+ $na = preg_replace("/^.*\//","",$name);
+ $prio= $plist[$na]['plPriority'] ;
+
+ $newSort[$name] = $prio;
+ }
+
+ asort($newSort);
+
+ $ret = array();
+ foreach($newSort as $name => $prio){
+ $ret[$name] = $list[$name];
+ }
+ return($ret);
+ }
+
function buildAclSelector($list)
{
function buildAclSelector($list)
{
- $display= "";
+ $display= "<input type='hidden' name='acl_dummy_0_0_0' value='1'>";
$cols= 3;
$tmp= get_global('plist');
$plist= $tmp->info;
asort($plist);
/* Build general objects */
$cols= 3;
$tmp= get_global('plist');
$plist= $tmp->info;
asort($plist);
/* Build general objects */
+
+ $list =$this->sort_by_priority($list);
foreach ($list as $key => $name){
/* Create sub acl if it does not exist */
foreach ($list as $key => $name){
/* Create sub acl if it does not exist */
"\n <tr>".
"\n <td style='background-color:#C8C8C8;height:1.8em;' colspan=".($cols-1)."><b>"._("Object").": $name</b></td>".
"\n <td align='right' style='background-color:#C8C8C8;height:1.8em;'>".
"\n <tr>".
"\n <td style='background-color:#C8C8C8;height:1.8em;' colspan=".($cols-1)."><b>"._("Object").": $name</b></td>".
"\n <td align='right' style='background-color:#C8C8C8;height:1.8em;'>".
- "\n <input type='button' onclick='divtoggle(\"$name\");' value='"._("Show/Hide Advanced Settings")."' /></td>".
+ "\n <input type='button' onclick='divtoggle(\"".preg_replace("/[^a-z0-9]/i","_",$name)."\");' value='"._("Show/Hide Advanced Settings")."' /></td>".
"\n </tr>";
} else {
$display.= "\n<table style='width:100%;border:1px solid #A0A0A0' cellspacing=0 cellpadding=2>".
"\n </tr>";
} else {
$display.= "\n<table style='width:100%;border:1px solid #A0A0A0' cellspacing=0 cellpadding=2>".