summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 410fb8c)
raw | patch | inline | side by side (parent: 410fb8c)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 13 Dec 2006 11:35:59 +0000 (11:35 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 13 Dec 2006 11:35:59 +0000 (11:35 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5378 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/acl/class_aclManagement.inc | patch | blob | history | |
plugins/admin/acl/class_divListACL.inc | patch | blob | history |
index d21419fdb12b2bb7b764f46754fd47f296f42bce..2a849b1c72d719405eacc823799caa7252d16d06 100644 (file)
/* Get 'dn' from posted acl, must be unique */
$this->dn= $this->list[trim($s_entry)]['dn'];
- /* Check locking, save current plugin in 'back_plugin', so
- the dialog knows where to return. */
- if (($acl= get_lock($this->dn)) != ""){
- return(gen_locked_message ($acl, $this->dn));
- }
+ /* Check permissions */
+ if(preg_match("/r/",$this->ui->get_permissions($this->dn,"acl/aclManagement"))){
+
+ /* Check locking, save current plugin in 'back_plugin', so
+ the dialog knows where to return. */
+ if (($acl= get_lock($this->dn)) != ""){
+ return(gen_locked_message ($acl, $this->dn));
+ }
- /* Lock the current entry, so everyone will get the above dialog */
- add_lock ($this->dn, $this->ui->dn);
+ /* Lock the current entry, so everyone will get the above dialog */
+ add_lock ($this->dn, $this->ui->dn);
- /* Register acltabs to trigger edit dialog */
- $this->acltabs= new acl($this->config, NULL,$this->dn);
- $this->acltabs-> set_acl_base($this->dn);
- $this->acltabs-> set_acl_category("acl");
+ /* Register acltabs to trigger edit dialog */
+ $this->acltabs= new acl($this->config, NULL,$this->dn);
+ $this->acltabs-> set_acl_base($this->dn);
+ $this->acltabs-> set_acl_category("acl");
- /* Switch tab, if it was requested by user */
- $this->acltabs->current = $s_tab;
+ /* Switch tab, if it was requested by user */
+ $this->acltabs->current = $s_tab;
- /* Set ACL and move DN to the headline */
- $_SESSION['objectinfo']= $this->dn;
+ /* Set ACL and move DN to the headline */
+ $_SESSION['objectinfo']= $this->dn;
+ }else{
+ print_red(_("You are not allowed to edit this acl."));
+ }
}
/* Get 'dn' from posted acl */
$this->dn= $this->list[trim($s_entry)]['dn'];
-
- # FIXME CHECK ACLs here
- if(1 == 1 ){
+ /* Check permissions */
+ if(preg_match("/d/",$this->ui->get_permissions($this->dn,"acl/aclManagement"))){
/* Check locking, save current plugin in 'back_plugin', so
the dialog knows where to return. */
if (($acl= get_lock($this->dn)) != ""){
/* Confirmation for deletion has been passed. Acl should be deleted. */
if (isset($_POST['delete_acl_confirmed'])){
- /* Some nice guy may send this as POST, so we've to check
- for the permissions again. */
- if (chkacl($this->acl, "delete") == ""){
+ /* Check permissions */
+ if(preg_match("/d/",$this->ui->get_permissions($this->dn,"acl/aclManagement"))){
/* Delete request is permitted, perform LDAP action */
$this->acltabs= new acl($this->config, NULL,$this->dn);
}
- /* Return departments, that will be included within snapshot detection */
- function get_used_snapshot_bases()
- {
- return(array(get_people_ou().$this->DivListACL->selectedBase));
- }
-
-
function reload()
{
#FIXME Implement regex objectClass and so on ...
index ec12ec85617f7d1c3c4bdd1e1fbf70c26f457c2a..dbfe2434d588aeba773d7d0f0ea3ec9749656b12 100644 (file)
function GenHeader()
{
- /* Prepare departments,
+ /* Prepare departments,
which are shown in the listbox on top of the listbox
*/
$options= "";
- foreach ($this->config->idepartments as $key => $value){
- if ($this->selectedBase == $key){
- $options.= "<option selected='selected' value='$key'>$value</option>";
- } else {
- $options.= "<option value='$key'>$value</option>";
+
+ /* Get all departments within this subtree */
+ $base = $this->config->current['BASE'];
+ $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", "acl", $base,
+ array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH);
+
+ /* Load possible departments */
+ $ui = get_userinfo();
+ $tdeps = $ui->get_module_departments("acl");
+ $ids = $this->config->idepartments;
+ foreach($deps as $dep){
+ if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){
+ $value = $ids[$dep['dn']];
+ if ($this->selectedBase == $dep['dn']){
+ $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
+ } else {
+ $options.= "<option value='".$dep['dn']."'>$value</option>";
+ }
}
}
+ /* Get copy & paste icon */
+ $acl = $ui->get_permissions($this->selectedBase,"acl/aclManagement");
+
/* Create header with selected base */
$listhead = "<div style='background:#F0F0F9;padding:5px;'>".
" <input class='center' type='image' src='images/list_root.png' align='middle'
foreach($list as $key => $acl_entry){
- $action = "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."'
- name='list_acl_edit_%KEY%' title='"._("Edit system")."'>";
- $action.= "<input class='center' type='image' src='images/edittrash.png' alt='"._("delete")."'
- name='list_acl_del_%KEY%' title='"._("Delete system")."'>";
+ /* Get copy & paste icon */
+ $acl = $this->ui->get_permissions($acl_entry['dn'],"acl/aclManagement");
+
+ $action = "";
+
+ /* Add actions depending on acls */
+ if(preg_match("/r/", $acl)){
+ $action.= "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."'
+ name='list_acl_edit_%KEY%' title='"._("Edit system")."'>";
+ }
+ if(preg_match("/d/", $acl)){
+ $action.= "<input class='center' type='image' src='images/edittrash.png' alt='"._("delete")."'
+ name='list_acl_del_%KEY%' title='"._("Delete system")."'>";
+ }
$field1 = array("string" => $list_left_icon, "attach"=> "style='text-align:center;width:20px;'");
$field2 = array("string" => sprintf($editlink,$key,htmlentities(utf8_decode($acl_entry['dn'])))." ","attach" => "");