X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_acl.inc;h=6aadfc637d5fb8258854dfaa1f4f0a9e091e630e;hb=06cc53394cf695b3bc663073e526d7d94e4bb2d6;hp=faeac26983282bd7c980f961ce8ed8cc7e0deed6;hpb=d72758e6357755e532597beb3902bf9c0b5c49c0;p=gosa.git
diff --git a/gosa-core/include/class_acl.inc b/gosa-core/include/class_acl.inc
index faeac2698..6aadfc637 100644
--- a/gosa-core/include/class_acl.inc
+++ b/gosa-core/include/class_acl.inc
@@ -92,11 +92,11 @@ class acl extends plugin
/* Groups */
$ldap->cd($config->current['BASE']);
- if ($tag == ""){
+# if ($tag == ""){
$ldap->search('(objectClass=posixGroup)', array('cn', 'description'));
- } else {
- $ldap->search('(&(objectClass=posixGroup)(gosaUnitTag='.$tag.'))', array('cn', 'description'));
- }
+# } else {
+# $ldap->search('(&(objectClass=posixGroup)(gosaUnitTag='.$tag.'))', array('cn', 'description'));
+# }
while ($attrs= $ldap->fetch()){
$dsc= "";
if (isset($attrs['description'][0])){
@@ -160,13 +160,14 @@ class acl extends plugin
/* Non numeric index means -> base object containing more informations */
if (preg_match('/^[0-9]+$/', $idx)){
+
if (!isset($this->ocMapping[$data])){
$this->ocMapping[$data]= array();
$this->ocMapping[$data][]= '0';
}
if(isset($cats[$data])){
- $this->myAclObjects[$idx.'/'.$class]= $acls['plDescription'];
+ $this->myAclObjects[$data.'/'.$class]= $acls['plDescription'];
}
$this->ocMapping[$data][]= $class;
} else {
@@ -321,25 +322,33 @@ class acl extends plugin
$this->aclContents = base64_decode($_POST['selected_role']);
}
}
-
- /* Only be interested in new acl's, if we're in the right _POST place */
- if ($aclDialog && $this->aclObject != "" && is_array($this->ocMapping[$this->aclObject])){
- foreach ($this->ocMapping[$this->aclObject] as $oc){
- unset($this->aclContents[$oc]);
- unset($this->aclContents[$this->aclObject.'/'.$oc]);
- if (isset($new_acl[$oc])){
- $this->aclContents[$oc]= $new_acl[$oc];
- }
- if (isset($new_acl[$this->aclObject.'/'.$oc])){
- $this->aclContents[$this->aclObject.'/'.$oc]= $new_acl[$this->aclObject.'/'.$oc];
+ if($this->acl_is_writeable("")){
+
+ /* Only be interested in new acl's, if we're in the right _POST place */
+ if ($aclDialog && $this->aclObject != "" && is_array($this->ocMapping[$this->aclObject])){
+
+ foreach ($this->ocMapping[$this->aclObject] as $oc){
+
+ if(isset($this->aclContents[$oc]) && is_array($this->aclContents)){
+ unset($this->aclContents[$oc]);
+ unset($this->aclContents[$this->aclObject.'/'.$oc]);
+ }else{
+# trigger_error("Huhm?");
+ }
+ if (isset($new_acl[$oc]) && is_array($new_acl)){
+ $this->aclContents[$oc]= $new_acl[$oc];
+ }
+ if (isset($new_acl[$this->aclObject.'/'.$oc]) && is_array($new_acl)){
+ $this->aclContents[$this->aclObject.'/'.$oc]= $new_acl[$this->aclObject.'/'.$oc];
+ }
}
}
- }
- /* Save new acl in case of base edit mode */
- if ($this->aclType == 'base' && !$firstedit){
- $this->aclContents= $new_acl;
+ /* Save new acl in case of base edit mode */
+ if ($this->aclType == 'base' && !$firstedit){
+ $this->aclContents= $new_acl;
+ }
}
/* Cancel new acl? */
@@ -408,9 +417,11 @@ class acl extends plugin
}
/* Save common values */
- foreach (array("aclType","aclFilter", "aclObject", "target") as $key){
- if (isset($_POST[$key])){
- $this->$key= validate($_POST[$key]);
+ if($this->acl_is_writeable("")){
+ foreach (array("aclType","aclFilter", "aclObject", "target") as $key){
+ if (isset($_POST[$key])){
+ $this->$key= validate($_POST[$key]);
+ }
}
}
@@ -424,12 +435,23 @@ class acl extends plugin
/* Fill in entries */
foreach ($this->gosaAclEntry as $key => $entry){
+ if(!$this->acl_is_readable("")) continue;
+
+ $action ="";
+
$field1= array("string" => $this->aclTypes[$entry['type']], "attach" => "style='width:150px'");
$field2= array("string" => $this->assembleAclSummary($entry));
- $action= "";
- $action.= "";
+
+ if($this->acl_is_writeable("")){
+ $action.= "";
+ $action.= "";
+ }
+
$action.= "";
- $action.= "";
+
+ if($this->acl_is_removeable()){
+ $action.= "";
+ }
$field3= array("string" => $action, "attach" => "style='border-right:0px;width:50px;text-align:right;'");
$aclList->AddEntry(array($field1, $field2, $field3));
@@ -541,6 +563,12 @@ class acl extends plugin
/* Show main page */
$smarty->assign("dialogState", $this->dialogState);
+
+ /* Assign acls */
+ $smarty->assign("acl_createable",$this->acl_is_createable());
+ $smarty->assign("acl_writeable" ,$this->acl_is_writeable(""));
+ $smarty->assign("acl_readable" ,$this->acl_is_readable(""));
+ $smarty->assign("acl_removeable",$this->acl_is_removeable());
return ($smarty->fetch (get_template_path('acl.tpl')));
}
@@ -612,33 +640,35 @@ class acl extends plugin
/* Add select all/none buttons */
$style = "style='width:100px;'";
- $display .= "";
- $display .= "";
- $display .= " - ";
- $display .= "";
- $display .= " - ";
-
- $display .= "";
- $display .= "";
-
- $display .= "
";
-
- $style = "style='width:50px;'";
- $display .= "";
- $display .= "";
- $display .= "";
- $display .= "";
- $display .= "";
- $display .= " - ";
- $display .= "";
- $display .= "";
- $display .= "";
- $display .= " - ";
-
- $display .= "";
- $display .= "";
- $display .= "";
- $display .= "";
+ if($this->acl_is_writeable("")){
+ $display .= "";
+ $display .= "";
+ $display .= " - ";
+ $display .= "";
+ $display .= " - ";
+
+ $display .= "";
+ $display .= "";
+
+ $display .= "
";
+
+ $style = "style='width:50px;'";
+ $display .= "";
+ $display .= "";
+ $display .= "";
+ $display .= "";
+ $display .= "";
+ $display .= " - ";
+ $display .= "";
+ $display .= "";
+ $display .= "";
+ $display .= " - ";
+
+ $display .= "";
+ $display .= "";
+ $display .= "";
+ $display .= "";
+ }
/* Build general objects */
$list =$this->sort_by_priority($list);
@@ -689,20 +719,20 @@ class acl extends plugin
/* Generate options */
$spc= " ";
- if ($this->isContainer && $this->aclType != 'base'){
+# if ($this->isContainer && $this->aclType != 'base'){
$options= $this->mkchkbx($key."_0_c", _("Create objects"), preg_match('/c/', $overall_acl)).$spc;
$options.= $this->mkchkbx($key."_0_m", _("Move objects"), preg_match('/m/', $overall_acl)).$spc;
$options.= $this->mkchkbx($key."_0_d", _("Remove objects"), preg_match('/d/', $overall_acl)).$spc;
if ($plist[preg_replace('%^.*/%', '', $key)]['plSelfModify']){
$options.= $this->mkchkbx($key."_0_s", _("Modifyable by owner"), preg_match('/s/', $overall_acl)).$spc;
}
- } else {
- $options= $this->mkchkbx($key."_0_m", _("Move object"), preg_match('/m/', $overall_acl)).$spc;
- $options.= $this->mkchkbx($key."_0_d", _("Remove object"), preg_match('/d/', $overall_acl)).$spc;
- if ($plist[preg_replace('%^.*/%', '', $key)]['plSelfModify']){
- $options.= $this->mkchkbx($key."_0_s", _("Modifyable by owner"), preg_match('/s/', $overall_acl)).$spc;
- }
- }
+ # } else {
+ # $options= $this->mkchkbx($key."_0_m", _("Move object"), preg_match('/m/', $overall_acl)).$spc;
+ # $options.= $this->mkchkbx($key."_0_d", _("Remove object"), preg_match('/d/', $overall_acl)).$spc;
+ # if ($plist[preg_replace('%^.*/%', '', $key)]['plSelfModify']){
+ # $options.= $this->mkchkbx($key."_0_s", _("Modifyable by owner"), preg_match('/s/', $overall_acl)).$spc;
+ # }
+ # }
/* Global options */
$more_options= $this->mkchkbx($key."_0_r", _("read"), preg_match('/r/', $overall_acl)).$spc;
@@ -716,7 +746,7 @@ class acl extends plugin
/* Walk through the list of attributes */
$cnt= 1;
$splist= $plist[preg_replace('%^.*/%', '', $key)]['plProvidedAcls'];
- asort($splist);
+# asort($splist);
if(session::get('js')) {
if(isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/gecko/i",$_SERVER['HTTP_USER_AGENT'])) {
$display.= "\n