summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 74975ea)
raw | patch | inline | side by side (parent: 74975ea)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 20 Oct 2008 07:30:52 +0000 (07:30 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 20 Oct 2008 07:30:52 +0000 (07:30 +0000) |
-Fixed ACL handling, gray out && cal category.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12735 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12735 594d385d-05f5-0310-b6e9-bd551577e9d8
index 3dce4dc8a4bdd8bbead85d803f3bd4c3d862f052..1a9b90cd69dce42d4dc2e003aab71eda705ef395 100644 (file)
</tr>
</table>
{$aclList}
+{render acl=$gosaAclEntryACL}
<input type="submit" name="new_acl" value="{t}New ACL{/t}">
+{/render}
{/if}
<p class="seperator"> </p>
<div style='text-align:right;margin-top:5px'>
+{render acl=$gosaAclEntryACL}
<input type="submit" name="submit_new_acl" value="{msgPool type=applyButton}">
+{/render}
<input type="submit" name="cancel_new_acl" value="{msgPool type=cancelButton}">
</div>
{/if}
<h1>{$headline}</h1>
+{render acl=$gosaAclEntryACL}
{$aclSelector}
+{/render}
<p class="seperator"> </p>
<div style='text-align:right;margin-top:5px'>
+{render acl=$gosaAclEntryACL}
<input type="submit" name="submit_edit_acl" value="{msgPool type=applyButton}">
+{/render}
<input type="submit" name="cancel_edit_acl" value="{msgPool type=cancelButton}">
</div>
diff --git a/gosa-core/plugins/admin/acl/class_aclManagement.inc b/gosa-core/plugins/admin/acl/class_aclManagement.inc
index 910a319864f690d22dc771efb389aa4c2113ebe4..6c7f5bd66312c7149fb1ac7324eb3f32d731964d 100644 (file)
var $start_pasting_copied_objects = FALSE;
var $dns = array();
- var $acl_module = array("acl","aclroles");
+ var $acl_module = array("acl");
function aclManagement(&$config, &$ui)
{
$this->dn= "new";
/* Check permissions */
- if(preg_match("/c/",$this->ui->get_permissions($this->DivListACL->selectedBase,"aclroles/aclrole"))){
+ if(preg_match("/c/",$this->ui->get_permissions($this->DivListACL->selectedBase,"acl/aclrole"))){
/* Register acltabs to trigger edit dialog */
$this->acltabs= new aclroletab($this->config, NULL,$this->dn);
$this->dn= $this->list[trim($s_entry)]['dn'];
if(in_array("gosaRole",$this->list[trim($s_entry)]['objectClass'])){
- $acl = "aclroles/aclrole";
+ $acl = "acl/aclrole";
}else{
$acl = "acl/acl";
}
foreach($ids as $id){
$dn = $this->list[$id]['dn'];
if(in_array("gosaRole",$this->list[$id]['objectClass'])){
- $acl = $this->ui->get_permissions($dn, "aclroles/aclrole");
+ $acl = $this->ui->get_permissions($dn, "acl/aclrole");
}else{
$acl = $this->ui->get_permissions($dn, "acl/acl");
}
*/
$dn = $this->list[$id]['dn'];
if(in_array("gosaRole",$this->list[$id]['objectClass'])){
- $acl = $this->ui->get_permissions($dn,"aclroles/aclrole");
+ $acl = $this->ui->get_permissions($dn,"acl/aclrole");
$name = _("ACL role");
}else{
$acl = $this->ui->get_permissions($dn,"acl/acl");
$dn = $this->list[$id]['dn'];
$this->dn = $dn;
if(in_array("gosaRole",$this->list[$id]['objectClass'])){
- $acl = $this->ui->get_permissions($dn,"aclroles/aclrole");
+ $acl = $this->ui->get_permissions($dn,"acl/aclrole");
$this->acltabs= new aclroletab($this->config,NULL, $this->dn);
}else{
$acl = $this->ui->get_permissions($dn,"acl/acl");
} else {
msg_dialog::display(_("Permission error"),msgPool::permDelete(), ERROR_DIALOG);
if(isset($this->ui->uid)){
- new log("security","aclroles/".get_class($this),$this->dn,array(),
+ new log("security","acl/".get_class($this),$this->dn,array(),
"Warning: '".$this->ui->uid."' tried to trick acl role deletion.");
}
}
/* We can only copy & cut roles */
if(isset($this->list[$s_entry]['objectClass']) && in_array("gosaRole",$this->list[$s_entry]['objectClass'])){
- if($s_action == "copy" && $ui->is_copyable($dn,"aclroles","aclrole")){
- $this->CopyPasteHandler->add_to_queue($dn,$s_action,"aclroletab","ACLROLETAB","aclroles");
+ if($s_action == "copy" && $ui->is_copyable($dn,"acl","aclrole")){
+ $this->CopyPasteHandler->add_to_queue($dn,$s_action,"aclroletab","ACLROLETAB","acl");
}
- if($s_action == "cut" && $ui->is_cutable($dn,"aclroles","aclrole")){
- $this->CopyPasteHandler->add_to_queue($dn,$s_action,"aclroletab","ACLROLETAB","aclroles");
+ if($s_action == "cut" && $ui->is_cutable($dn,"acl","aclrole")){
+ $this->CopyPasteHandler->add_to_queue($dn,$s_action,"aclroletab","ACLROLETAB","acl");
}
}
}
if(isset($this->list[$id]['objectClass']) && in_array("gosaRole",$this->list[$id]['objectClass'])){
- if($s_action == "copy_multiple" && $ui->is_copyable($dn,"aclroles","aclrole")){
- $this->CopyPasteHandler->add_to_queue($dn,"copy","aclroletab","ACLROLETAB","aclroles");
+ if($s_action == "copy_multiple" && $ui->is_copyable($dn,"acl","aclrole")){
+ $this->CopyPasteHandler->add_to_queue($dn,"copy","aclroletab","ACLROLETAB","acl");
}
- if($s_action == "cut_multiple" && $ui->is_cutable($dn,"aclroles","aclrole")){
- $this->CopyPasteHandler->add_to_queue($dn,"cut","aclroletab","ACLROLETAB","aclroles");
+ if($s_action == "cut_multiple" && $ui->is_cutable($dn,"acl","aclrole")){
+ $this->CopyPasteHandler->add_to_queue($dn,"cut","aclroletab","ACLROLETAB","acl");
}
}
}
diff --git a/gosa-core/plugins/admin/acl/class_aclRole.inc b/gosa-core/plugins/admin/acl/class_aclRole.inc
index 2f90c41900d5a5467948e1659901ff33d8cb1757..9deb2a94c3423c992185ddc28b6ba18477e01ce7 100644 (file)
$this->base = session::get('CurrentMainBase');
}else{
$this->base = preg_replace("/^[^,]+,[^,]+,/","",$this->dn);
- new log("view","aclroles/".get_class($this),$this->dn);
+ new log("view","acl/".get_class($this),$this->dn);
}
/* Load ACL's */
$plist= $tmp->info;
/* Handle posts */
- if (isset($_POST['new_acl'])){
+ if (isset($_POST['new_acl']) && $this->acl_is_writeable("gosaAclEntry")){
$this->dialogState= 'create';
$this->dialog= TRUE;
$this->currentIndex= count($this->gosaAclTemplate);
$this->loadAclEntry();
continue;
}
- if (preg_match('/^acl_del_.*_x/', $name)){
- unset($this->gosaAclTemplate[preg_replace('/^acl_del_([0-9]+).*$/', '\1', $name)]);
- continue;
- }
-
if (preg_match('/^cat_edit_.*_x/', $name)){
$this->aclObject= preg_replace('/^cat_edit_([^_]+)_.*$/', '\1', $name);
$this->dialogState= 'edit';
}
continue;
}
- if (preg_match('/^cat_del_.*_x/', $name)){
+
+ if(!$this->acl_is_writeable("gosaAclEntry")){
+ continue;
+ }
+
+ if (preg_match('/^acl_del_.*_x/', $name) && $this->acl_is_writeable("gosaAclEntry")){
+ unset($this->gosaAclTemplate[preg_replace('/^acl_del_([0-9]+).*$/', '\1', $name)]);
+ continue;
+ }
+
+ if (preg_match('/^cat_del_.*_x/', $name) && $this->acl_is_writeable("gosaAclEntry")){
$idx= preg_replace('/^cat_del_([^_]+)_.*$/', '\1', $name);
foreach ($this->ocMapping[$idx] as $key){
unset($this->aclContents["$idx/$key"]);
}
/* Sorting... */
- if (preg_match('/^sortup_.*_x/', $name)){
+ if (preg_match('/^sortup_.*_x/', $name) && $this->acl_is_writeable("gosaAclEntry")){
$index= preg_replace('/^sortup_([0-9]+).*$/', '\1', $name);
if ($index > 0){
$tmp= $this->gosaAclTemplate[$index];
}
continue;
}
- if (preg_match('/^sortdown_.*_x/', $name)){
+ if (preg_match('/^sortdown_.*_x/', $name) && $this->acl_is_writeable("gosaAclEntry")){
$index= preg_replace('/^sortdown_([0-9]+).*$/', '\1', $name);
if ($index < count($this->gosaAclTemplate)-1){
$tmp= $this->gosaAclTemplate[$index];
}
/* ACL saving... */
- if (preg_match('/^acl_.*_[^xy]$/', $name)){
+ if (preg_match('/^acl_.*_[^xy]$/', $name) && $this->acl_is_writeable("gosaAclEntry")){
$aclDialog= TRUE;
list($dummy, $object, $attribute, $value)= split('_', $name);
}
/* Store ACL in main object? */
- if (isset($_POST['submit_new_acl'])){
+ if (isset($_POST['submit_new_acl']) && $this->acl_is_writeable("gosaAclEntry")){
$this->gosaAclTemplate[$this->currentIndex]['type']= $this->aclType;
$this->gosaAclTemplate[$this->currentIndex]['members']= $this->recipients;
$this->gosaAclTemplate[$this->currentIndex]['acl']= $this->aclContents;
}
/* Save edit acl? */
- if (isset($_POST['submit_edit_acl'])){
+ if (isset($_POST['submit_edit_acl']) && $this->acl_is_writeable("gosaAclEntry")){
$this->dialogState= 'create';
}
/* Add acl? */
- if (isset($_POST['add_acl']) && $_POST['aclObject'] != ""){
+ if (isset($_POST['add_acl']) && $_POST['aclObject'] != "" && $this->acl_is_writeable("gosaAclEntry")){
$this->dialogState= 'edit';
$this->savedAclContents= array();
foreach ($this->ocMapping[$this->aclObject] as $oc){
/* Save common values */
foreach (array("aclType", "aclObject", "target") as $key){
- if (isset($_POST[$key])){
+ if (isset($_POST[$key]) && $this->acl_is_writeable("gosaAclEntry")){
$this->$key= validate($_POST[$key]);
}
}
/* Draw list */
$aclList= new divSelectBox("aclList");
$aclList->SetHeight(350);
-
+
/* Fill in entries */
foreach ($this->gosaAclTemplate as $key => $entry){
$field1= array("string" => $this->aclTypes[$entry['type']], "attach" => "style='width:100px'");
$field2= array("string" => $this->assembleAclSummary($entry));
- $action= "<input type='image' name='sortup_$key' alt='up' title='"._("Up")."' src='images/lists/sort-up.png' align='top'>";
- $action.= "<input type='image' name='sortdown_$key' alt='down' title='"._("Down")."' src='images/lists/sort-down.png'>";
- $action.= "<input class='center' type='image' src='images/lists/edit.png' alt='"._("Edit")."' name='acl_edit_$key' title='".msgPool::editButton(_("ACL"))."'>";
- $action.= "<input class='center' type='image' src='images/lists/trash.png' alt='"._("Delete")."' name='acl_del_$key' title='".msgPool::delButton(_("ACL"))."'>";
+
+ $action ="";
+ if($this->acl_is_writeable("gosaAclEntry")){
+ $action.= "<input type='image' name='sortup_$key' alt='up'
+ title='"._("Up")."' src='images/lists/sort-up.png' align='top'>";
+ $action.= "<input type='image' name='sortdown_$key' alt='down'
+ title='"._("Down")."' src='images/lists/sort-down.png'>";
+ }
+ if($this->acl_is_readable("gosaAclEntry")){
+ $action.= "<input class='center' type='image' src='images/lists/edit.png' alt='"._("Edit")."' name='acl_edit_$key'
+ title='".msgPool::editButton(_("ACL"))."'>";
+ }
+ if($this->acl_is_writeable("gosaAclEntry")){
+ $action.= "<input class='center' type='image' src='images/lists/trash.png' alt='"._("Delete")."' name='acl_del_$key'
+ title='".msgPool::delButton(_("ACL"))."'>";
+ }
$field3= array("string" => $action, "attach" => "style='border-right:0px;width:50px;text-align:right;'");
$aclList->AddEntry(array($field1, $field2, $field3));
$summary= sprintf(_("ACL for these objects: %s"), preg_replace('/, $/', '', $summary));
}
+ $action = "";
+ if($this->acl_is_readable("gosaAclEntry")){
+ $action.= "<input class='center' type='image' src='images/lists/edit.png'
+ alt='"._("Edit")."' name='cat_edit_$section' title='"._("Edit category ACL")."'>";
+ }
+ if($this->acl_is_writeable("gosaAclEntry")){
+ $action.= "<input class='center' type='image' src='images/lists/trash.png'
+ alt='"._("Delete")."' name='cat_del_$section' title='"._("Reset category ACL")."'>";
+ }
+
$field1= array("string" => $dsc, "attach" => "style='width:140px'");
$field2= array("string" => $summary);
- $action= "<input class='center' type='image' src='images/lists/edit.png' alt='"._("Edit")."' name='cat_edit_$section' title='"._("Edit category ACL")."'>";
- $action.= "<input class='center' type='image' src='images/lists/trash.png' alt='"._("Delete")."' name='cat_del_$section' title='"._("Reset category ACL")."'>";
$field3= array("string" => $action, "attach" => "style='border-right:0px;width:50px'");
$aclList->AddEntry(array($field1, $field2, $field3));
}
function aclPostHandler()
{
- if (isset($_POST['save_acl'])){
+ if (isset($_POST['save_acl']) && $this->acl_is_writeable("gosaAclEntry")){
$this->save();
return TRUE;
}
$ldap->cd($this->dn);
$this->cleanup();
$ldap->modify ($this->attrs);
- new log("modify","aclroles/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ new log("modify","acl/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
}else{
$ldap->cd($this->config->current['BASE']);
$ldap->create_missing_trees(preg_replace("/^[^,]+,/","",$this->dn));
$ldap->cd($this->dn);
$ldap->add($this->attrs);
- new log("create","aclroles/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ new log("create","acl/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
}
if (!$ldap->success()){
}
$ldap->rmDir($this->dn);
- new log("remove","aclroles/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ new log("remove","acl/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
if (!$ldap->success()){
msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, "", get_class()));
}
"plDepends" => array(),
"plPriority" => 0,
"plSection" => array("admin"),
- "plCategory" => array("aclroles" => array("objectClass" => "gosaRole", "description" => _("Access control roles"))),
-
+ "plCategory" => array("acl"),
"plProvidedAcls" => array(
"cn" => _("Name"),
"base" => _("Base"),
- "description" => _("Description"))
+ "description" => _("Description"),
+ "gosaAclEntry" => _("Permissions"))
));
}
diff --git a/gosa-core/plugins/admin/acl/class_divListACL.inc b/gosa-core/plugins/admin/acl/class_divListACL.inc
index a78d1c4e674abfb2083ac42f3df803e1c13e615e..d2af617e087fab0a9f2ff22b8b7a338abb0adba6 100644 (file)
function divListACL (&$config, &$parent)
{
- MultiSelectWindow::MultiSelectWindow($config, "ACL", array("acl","aclroles"));
+ MultiSelectWindow::MultiSelectWindow($config, "ACL", array("acl","acl"));
$this->parent = &$parent;
$this->ui = get_userinfo();
*/
if(in_array("gosaRole",$acl_entry['objectClass'])){
- $acl = $this->ui->get_permissions($acl_entry['dn'],"aclroles/aclRole");
- $acl_all = $this->ui->has_complete_category_acls($acl_entry['dn'],"aclroles");
+ $acl = $this->ui->get_permissions($acl_entry['dn'],"acl/aclrole");
+ $acl_all = $this->ui->has_complete_category_acls($acl_entry['dn'],"acl");
$editlink = "<a href='?plug=".$_GET['plug']."&id=%s&act=list_edit_role'>%s</a>";
$list_left_icon = "<img src='plugins/acl/images/role.png' alt='"._("Role")."'>";
}
/* Add copy & cut functionality */
- $action.= $this->parent->get_copypaste_action($acl_entry['dn'],"aclroles","aclRole");
+ $action.= $this->parent->get_copypaste_action($acl_entry['dn'],"acl","aclRole");
/* Add actions depending on acls */
if(preg_match("/r/", $acl)){
}
/* Add snapshot functionality */
- $action.= $this->parent->get_snapshot_action($acl_entry['dn'],"aclroles");
+ $action.= $this->parent->get_snapshot_action($acl_entry['dn'],"acl");
}else{