index 0507b7074d215abdef09a812b7ee7836475753b7..56fe9ae35a6626d23a1953af9f66c9060801248a 100644 (file)
$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);
$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.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
}
}
+ /* 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");