diff --git a/include/class_acl.inc b/include/class_acl.inc
index a3a169a06e8685555823cbd6b80a26dd014c64c0..41082b3106b9f17b2e92c18561030ced671d004b 100644 (file)
--- a/include/class_acl.inc
+++ b/include/class_acl.inc
var $wasNewEntry= FALSE;
var $ocMapping= array();
var $savedAclContents= array();
-
+ var $myAclObjects = array();
function acl ($config, $parent, $dn= NULL)
{
"one" => _("One level"),
"base" => _("Current object"),
"sub" => _("Complete subtree"),
- "psub" => _("Complete subtree (permanent)"));
- //"role" => _("Use ACL defined in role"));
+ "psub" => _("Complete subtree (permanent)"),
+ "role" => _("Use ACL defined in role"));
} else {
$this->aclTypes= array("base" => _("Current object"),
"role" => _("Use ACL defined in role"));
$new_acl= array();
$aclDialog= FALSE;
+ $firstedit= FALSE;
foreach($_POST as $name => $post){
/* Actions... */
if (preg_match('/^acl_edit_.*_x/', $name)){
$this->dialogState= 'create';
+ $firstedit= TRUE;
$this->dialog= TRUE;
$this->currentIndex= preg_replace('/^acl_edit_([0-9]+).*$/', '\1', $name);
$this->loadAclEntry();
}
/* Only be interested in new acl's, if we're in the right _POST place */
- if ($aclDialog && is_array($this->ocMapping[$this->aclObject])){
+ if ($aclDialog && $this->aclObject != "" && is_array($this->ocMapping[$this->aclObject])){
foreach ($this->ocMapping[$this->aclObject] as $oc){
unset($this->aclContents[$oc]);
}
/* Save new acl in case of base edit mode */
- if ($this->aclType == 'base'){
+ if ($this->aclType == 'base' && !$firstedit){
$this->aclContents= $new_acl;
}
if ($this->aclType == 'base'){
$smarty->assign('aclSelector', $this->buildAclSelector($this->myAclObjects));
}
+
+ /* Role selector if scope is base */
+ if ($this->aclType == 'role'){
+ $smarty->assign('roleSelector', "Role selector");#, $this->buildRoleSelector($this->myAclObjects));
+ }
}
if ($this->dialogState == 'edit'){
if ($this->aclObject == 'all'){
$aclObjects['all']= _("All objects in current subtree");
}
- $smarty->assign('aclSelector', $this->buildAclSelector($aclObjects));
+
+ /* Role selector if scope is base */
+ if ($this->aclType == 'role'){
+ $smarty->assign('roleSelector', "Role selector");#, $this->buildRoleSelector($this->myAclObjects));
+ } else {
+ $smarty->assign('aclSelector', $this->buildAclSelector($aclObjects));
+ }
}
/* Show main page */
$tmp= get_global('plist');
$plist= $tmp->info;
asort($plist);
+ $newSort = array();
foreach($list as $name => $translation){
$na = preg_replace("/^.*\//","",$name);
- $prio= $plist[$na]['plPriority'] ;
+ $prio = 0;
+ if(isset($plist[$na]['plPriority'])){
+ $prio= $plist[$na]['plPriority'] ;
+ }
$newSort[$name] = $prio;
}
$display .= "<input ".$style." type='button' name='set_false_all_read' onClick=\"acl_set_all('[^0]_r$',false);\" value='R-'>";
$display .= "<input ".$style." type='button' name='set_true_all_write' onClick=\"acl_set_all('[^0]_w$',true);\" value='W+'>";
$display .= "<input ".$style." type='button' name='set_false_all_write' onClick=\"acl_set_all('[^0]_w$',false);\" value='W-'>";
- /* Build general objects */
+ /* Build general objects */
$list =$this->sort_by_priority($list);
foreach ($list as $key => $name){
$display.= "\n <tr>".
"\n <td style='background-color:#E0E0E0' colspan=".($cols-1).">$options</td>".
- "\n <td style='background-color:#D4D4D4'> ".("Complete object:")." $more_options</td>".
+ "\n <td style='background-color:#D4D4D4'> "._("Complete object").": $more_options</td>".
"\n </tr>";
/* Walk through the list of attributes */
break;
case 'role':
- echo "Role";
+ echo "Role: $acl";
break;
case 'reset':