From: hickert Date: Tue, 24 Apr 2007 05:44:56 +0000 (+0000) Subject: Updated divlists. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=15afcd78ef94ef7d9fc22a3100747fc8bfb67f3a;p=gosa.git Updated divlists. Set initial selectedBase to first available base, in header contruction. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6177 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/acl/class_aclRole.inc b/plugins/admin/acl/class_aclRole.inc index 62e81dbcd..ef54ec83f 100644 --- a/plugins/admin/acl/class_aclRole.inc +++ b/plugins/admin/acl/class_aclRole.inc @@ -790,7 +790,7 @@ class aclrole extends plugin { /* New entry gets presets... */ if ($new){ - $this->aclType= 'base'; + $this->aclType= 'sub'; $this->recipients= array(); $this->aclContents= array(); } else { diff --git a/plugins/admin/acl/class_divListACL.inc b/plugins/admin/acl/class_divListACL.inc index 0507b7074..56fe9ae35 100644 --- a/plugins/admin/acl/class_divListACL.inc +++ b/plugins/admin/acl/class_divListACL.inc @@ -70,6 +70,9 @@ class divListACL extends MultiSelectWindow $Copy_Paste = ""; /* Get all departments within this subtree */ + $ui= get_userinfo(); + $first = ""; + $found = FALSE; $base = $this->config->current['BASE']; $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", "acl", $base, array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH); @@ -80,6 +83,14 @@ class divListACL extends MultiSelectWindow $ids = $this->config->idepartments; foreach($deps as $dep){ if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ + + /* Keep first base dn in mind, we could need this + * info if no valid base was found + */ + if(empty($first)) { + $first = $dep['dn']; + } + $value = $ids[$dep['dn']]; if ($this->selectedBase == $dep['dn']){ $options.= ""; @@ -89,6 +100,13 @@ class divListACL extends MultiSelectWindow } } + /* The currently used base is not visible with your acl setup. + * Set base to first useable base. + */ + if(!$found){ + $this->selectedBase = $first; + } + /* Allow copy & paste for roles */ $acl_all = $ui->has_complete_category_acls($this->selectedBase,"acl"); $acl = $ui->get_permissions($this->selectedBase,"acl/acl"); diff --git a/plugins/admin/departments/class_divListDepartment.inc b/plugins/admin/departments/class_divListDepartment.inc index 2b7f58862..f8e56b0fa 100755 --- a/plugins/admin/departments/class_divListDepartment.inc +++ b/plugins/admin/departments/class_divListDepartment.inc @@ -65,6 +65,9 @@ class divListDepartment extends MultiSelectWindow $options= ""; /* Get all departments within this subtree */ + $ui= get_userinfo(); + $first = ""; + $found = FALSE; $base = $this->config->current['BASE']; $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH); @@ -78,6 +81,13 @@ class divListDepartment extends MultiSelectWindow foreach($deps as $dep){ if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ + /* Keep first base dn in mind, we could need this + * info if no valid base was found + */ + if(empty($first)) { + $first = $dep['dn']; + } + $value = $ids[$dep['dn']]; if ($this->selectedBase == $dep['dn']){ $options.= ""; @@ -87,6 +97,12 @@ class divListDepartment extends MultiSelectWindow } } + /* The currently used base is not visible with your acl setup. + * Set base to first useable base. + */ + if(!$found){ + $this->selectedBase = $first; + } /* Generate list head */ $ui = get_userinfo(); diff --git a/plugins/admin/fai/class_divListFai.inc b/plugins/admin/fai/class_divListFai.inc index 1a735a3a2..95e193f1d 100644 --- a/plugins/admin/fai/class_divListFai.inc +++ b/plugins/admin/fai/class_divListFai.inc @@ -106,6 +106,9 @@ class divListFai extends MultiSelectWindow $options= ""; /* Get all departments within this subtree */ + $ui= get_userinfo(); + $first = ""; + $found = FALSE; $base = $this->config->current['BASE']; $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH); @@ -116,6 +119,14 @@ class divListFai extends MultiSelectWindow $ids = $this->config->idepartments; foreach($deps as $dep){ if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ + + /* Keep first base dn in mind, we could need this + * info if no valid base was found + */ + if(empty($first)) { + $first = $dep['dn']; + } + $value = $ids[$dep['dn']]; if ($this->selectedBase == $dep['dn']){ $options.= ""; @@ -125,6 +136,13 @@ class divListFai extends MultiSelectWindow } } + /* The currently used base is not visible with your acl setup. + * Set base to first useable base. + */ + if(!$found){ + $this->selectedBase = $first; + } + /* Add seperator */ $add_sep = false; diff --git a/plugins/admin/groups/class_divListGroup.inc b/plugins/admin/groups/class_divListGroup.inc index 518e36740..a5056b283 100644 --- a/plugins/admin/groups/class_divListGroup.inc +++ b/plugins/admin/groups/class_divListGroup.inc @@ -88,6 +88,9 @@ class divListGroup extends MultiSelectWindow /* Get all departments within this subtree */ + $ui= get_userinfo(); + $first = ""; + $found = FALSE; $base = $this->config->current['BASE']; $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH); @@ -101,6 +104,13 @@ class divListGroup extends MultiSelectWindow foreach($deps as $dep){ if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ + /* Keep first base dn in mind, we could need this + * info if no valid base was found + */ + if(empty($first)) { + $first = $dep['dn']; + } + $value = $ids[$dep['dn']]; if ($this->selectedBase == $dep['dn']){ $options.= ""; @@ -110,6 +120,13 @@ class divListGroup extends MultiSelectWindow } } + /* The currently used base is not visible with your acl setup. + * Set base to first useable base. + */ + if(!$found){ + $this->selectedBase = $first; + } + /* Get acls */ $acls = $ui->get_permissions($this->selectedBase,"groups/group"); $acl_all= $ui->has_complete_category_acls($this->selectedBase,"groups"); diff --git a/plugins/admin/mimetypes/class_divListMimeTypes.inc b/plugins/admin/mimetypes/class_divListMimeTypes.inc index 8fbd5c225..cbda3fee7 100755 --- a/plugins/admin/mimetypes/class_divListMimeTypes.inc +++ b/plugins/admin/mimetypes/class_divListMimeTypes.inc @@ -50,8 +50,6 @@ class divListMimeTypes extends MultiSelectWindow $action_col_size += 38; } - - /* Toggle all selected / deselected */ $chk = ""; @@ -94,6 +92,9 @@ class divListMimeTypes extends MultiSelectWindow $options= ""; /* Get all departments within this subtree */ + $ui= get_userinfo(); + $first = ""; + $found = FALSE; $base = $this->config->current['BASE']; $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH); @@ -107,6 +108,13 @@ class divListMimeTypes extends MultiSelectWindow foreach($deps as $dep){ if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ + /* Keep first base dn in mind, we could need this + * info if no valid base was found + */ + if(empty($first)) { + $first = $dep['dn']; + } + $value = $ids[$dep['dn']]; if ($this->selectedBase == $dep['dn']){ $options.= ""; @@ -116,6 +124,13 @@ class divListMimeTypes extends MultiSelectWindow } } + /* The currently used base is not visible with your acl setup. + * Set base to first useable base. + */ + if(!$found){ + $this->selectedBase = $first; + } + /* Get acls */ $ui = get_userinfo(); $acl = $ui->get_permissions("cn=dummy,ou=mimetypes,".$this->selectedBase,"mimetypes/mimetype"); diff --git a/plugins/admin/ogroups/class_divListOGroup.inc b/plugins/admin/ogroups/class_divListOGroup.inc index 5ac05bc77..ed0e70025 100755 --- a/plugins/admin/ogroups/class_divListOGroup.inc +++ b/plugins/admin/ogroups/class_divListOGroup.inc @@ -92,6 +92,9 @@ class divListOGroup extends MultiSelectWindow $options= ""; /* Get all departments within this subtree */ + $ui= get_userinfo(); + $first = ""; + $found = FALSE; $base = $this->config->current['BASE']; $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH); @@ -105,6 +108,13 @@ class divListOGroup extends MultiSelectWindow foreach($deps as $dep){ if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ + /* Keep first base dn in mind, we could need this + * info if no valid base was found + */ + if(empty($first)) { + $first = $dep['dn']; + } + $value = $ids[$dep['dn']]; if ($this->selectedBase == $dep['dn']){ $options.= ""; @@ -114,6 +124,13 @@ class divListOGroup extends MultiSelectWindow } } + /* The currently used base is not visible with your acl setup. + * Set base to first useable base. + */ + if(!$found){ + $this->selectedBase = $first; + } + /* Add a seperator after displaying c&p and snapshot icons ? */ $add_sep = false; diff --git a/plugins/admin/systems/class_divListSystem.inc b/plugins/admin/systems/class_divListSystem.inc index 5615a0bd2..a5bc398d6 100644 --- a/plugins/admin/systems/class_divListSystem.inc +++ b/plugins/admin/systems/class_divListSystem.inc @@ -106,6 +106,8 @@ class divListSystem extends MultiSelectWindow /* Load possible departments */ $ui= get_userinfo(); + $first = ""; + $found = FALSE; $department = $departments = array(); foreach($this->module as $module){ $d = $ui->get_module_departments($module); @@ -119,6 +121,13 @@ class divListSystem extends MultiSelectWindow foreach($deps as $dep){ if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $departments)){ + /* Keep first base dn in mind, we could need this + * info if no valid base was found + */ + if(empty($first)) { + $first = $dep['dn']; + } + $value = $ids[$dep['dn']]; if ($this->selectedBase == $dep['dn']){ $options.= ""; @@ -128,6 +137,13 @@ class divListSystem extends MultiSelectWindow } } + /* The currently used base is not visible with your acl setup. + * Set base to first useable base. + */ + if(!$found){ + $this->selectedBase = $first; + } + /* If there is at least one c (Create) and one w (Write) acl in this combination display the snapshot paste icon. BUT check the correct acls in the management plugin */ $all_module_acls = ""; diff --git a/plugins/admin/users/class_divListUsers.inc b/plugins/admin/users/class_divListUsers.inc index 87ad2017a..ed888b8a0 100644 --- a/plugins/admin/users/class_divListUsers.inc +++ b/plugins/admin/users/class_divListUsers.inc @@ -99,6 +99,9 @@ class divListUsers extends MultiSelectWindow foreach($deps as $dep){ if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ + /* Keep first base dn in mind, we could need this + * info if no valid base was found + */ if(empty($first)) { $first = $dep['dn']; } @@ -112,6 +115,10 @@ class divListUsers extends MultiSelectWindow } } } + + /* The currently used base is not visible with your acl setup. + * Set base to first useable base. + */ if(!$found){ $this->selectedBase = $first; } diff --git a/plugins/gofax/blocklists/class_divListBlocklists.inc b/plugins/gofax/blocklists/class_divListBlocklists.inc index 02c616324..27ff3d696 100755 --- a/plugins/gofax/blocklists/class_divListBlocklists.inc +++ b/plugins/gofax/blocklists/class_divListBlocklists.inc @@ -82,11 +82,21 @@ class divListBlocklist extends MultiSelectWindow array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH); /* Load possible departments */ + $first = ""; + $found = FALSE; $ui= get_userinfo(); $tdeps= $ui->get_module_departments("gofaxlist"); $ids = $this->config->idepartments; foreach($deps as $dep){ if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ + + /* Keep first base dn in mind, we could need this + * info if no valid base was found + */ + if(empty($first)) { + $first = $dep['dn']; + } + $value = $ids[$dep['dn']]; if ($this->selectedBase == $dep['dn']){ $options.= ""; @@ -96,6 +106,13 @@ class divListBlocklist extends MultiSelectWindow } } + /* The currently used base is not visible with your acl setup. + * Set base to first useable base. + */ + if(!$found){ + $this->selectedBase = $first; + } + /* Get acls */ $ui = get_userinfo(); $acl = $ui->get_permissions($this->selectedBase,"gofaxlist/blocklist"); diff --git a/plugins/gofon/conference/class_divListConferences.inc b/plugins/gofon/conference/class_divListConferences.inc index 180cf03fd..c16d99d4e 100755 --- a/plugins/gofon/conference/class_divListConferences.inc +++ b/plugins/gofon/conference/class_divListConferences.inc @@ -81,11 +81,21 @@ class divListConference extends MultiSelectWindow /* Load possible departments */ $ui = get_userinfo(); + $first = ""; + $found = FALSE; $tdeps = $ui->get_module_departments("gofonconference"); $ids = $this->config->idepartments; foreach($deps as $dep){ if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ + + /* Keep first base dn in mind, we could need this + * info if no valid base was found + */ + if(empty($first)) { + $first = $dep['dn']; + } + $value = $ids[$dep['dn']]; if ($this->selectedBase == $dep['dn']){ $options.= ""; @@ -95,6 +105,13 @@ class divListConference extends MultiSelectWindow } } + /* The currently used base is not visible with your acl setup. + * Set base to first useable base. + */ + if(!$found){ + $this->selectedBase = $first; + } + /* Get acls */ $acls = $ui->get_permissions($this->selectedBase,"gofonconference/conference"); $acl_all = $ui->has_complete_category_acls($this->selectedBase,"gofonconference") ; diff --git a/plugins/gofon/macro/class_divListMacros.inc b/plugins/gofon/macro/class_divListMacros.inc index d3712660b..c759479a4 100755 --- a/plugins/gofon/macro/class_divListMacros.inc +++ b/plugins/gofon/macro/class_divListMacros.inc @@ -74,6 +74,8 @@ class divListMacro extends MultiSelectWindow /* Get all departments within this subtree */ $base = $this->config->current['BASE']; + $first = ""; + $found = FALSE; $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH); @@ -86,6 +88,13 @@ class divListMacro extends MultiSelectWindow foreach($deps as $dep){ if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ + /* Keep first base dn in mind, we could need this + * info if no valid base was found + */ + if(empty($first)) { + $first = $dep['dn']; + } + $value = $ids[$dep['dn']]; if ($this->selectedBase == $dep['dn']){ $options.= ""; @@ -95,6 +104,13 @@ class divListMacro extends MultiSelectWindow } } + /* The currently used base is not visible with your acl setup. + * Set base to first useable base. + */ + if(!$found){ + $this->selectedBase = $first; + } + $acls = $ui->get_permissions($this->selectedBase,"gofonmacro/macro"); /* Add default header */