diff --git a/trunk/gosa-core/plugins/admin/ogroups/class_ogroup.inc b/trunk/gosa-core/plugins/admin/ogroups/class_ogroup.inc
index d36a32fd5370ed5b9f7d62ceda7a1548853cff79..3c26c693af05d1bd11eb338bf17c3405c52091e6 100644 (file)
foreach($res as $og){
if($og['dn'] == $this->dn) continue;
$test = array_intersect($ws_dns,$og['member']);
- if(($og['gosaGroupObjects'] == "[W]" || $og['gosaGroupObjects'] == "[T]") && count($test)){
+ if(($og['gosaGroupObjects'][0] == "[W]" || $og['gosaGroupObjects'][0] == "[T]") && count($test)){
$this->used_workstations = array_merge($this->used_workstations,$test);
}
}
/* Add objects to group */
if (isset($_POST['add_object_finish']) && isset($_POST['objects'])){
-
+ $test = array_unique(array_intersect($this->used_workstations, $_POST['objects']));
+ if(count($test)) {
+ $str = "";
+ foreach($test as $dn) {
+ $str .= "<li>".$dn."</li>";
+ }
+ msg_dialog::display(_("Error"), sprintf(_("These systems are already configured by other object groups and cannot be added:")."<br><ul>%s</ul>", $str), ERROR_DIALOG);
+ }
$tmp = "";
foreach($this->memberList as $obj){
$tmp .= $obj['type'];
$skipped =TRUE;
}elseif(preg_match("/W/",$tmp) && $this->objects[$value]['type'] == "T"){
$skipped =TRUE;
+ }elseif(in_array($value, $this->used_workstations)) {
+ continue;
}else{
$this->memberList["$value"]= $this->objects[$value];
$this->member["$value"]= $value;
$new_dn= $this->dn;
}
- /* Check if we have workstations assigned, that are already assigned to
- another object group. */
- if ($this->gosaGroupObjects == "[W]" || $this->gosaGroupObjects == "[T]" ) {
- $test =array_intersect($this->used_workstations,$this->member);
- if(count($test)){
- $str = "";
- foreach($test as $dn){
- $str .= "<li>".$dn."</li>";
- }
- $message[] = sprintf(_("These systems are already configured by other object groups and cannot be added:")."<br><ul>%s</ul>",$str);
- }
- }
-
$ldap = $this->config->get_ldap_link();
if(LDAP::fix($this->dn) != LDAP::fix($new_dn)){
$ldap->cat ($new_dn, array('dn'));