diff --git a/plugins/admin/applications/class_applicationGeneric.inc b/plugins/admin/applications/class_applicationGeneric.inc
index 27cf79eb1084ccbf5b2b05857364cfb76b732f73..351d6e458cb1234aa8183e055ddd26173d6a8903 100644 (file)
$this->is_account= TRUE;
if ($this->dn == "new"){
- $ui= get_userinfo();
- $this->base= dn2base($ui->dn);
+ if(isset($_SESSION['appfilter']['depselect'])){
+ $this->base=$_SESSION['appfilter']['depselect'];
+ }else{
+ $ui= get_userinfo();
+ $this->base= dn2base($ui->dn);
+ }
} else {
$this->base= preg_replace ("/^[^,]+,[^,]+,/", "", $this->dn);
}
return($smarty->fetch (get_template_path('generic.tpl', TRUE)));
}
+
function remove_from_parent()
{
$ldap= $this->config->get_ldap_link();
unset($og->member[$this->dn]);
$og->save ();
}
+ $ldap->search ("(&(objectClass=posixGroup)(gosaMemberApplication=".$this->cn."))", array("cn"));
+ while ($attrs= $ldap->fetch()){
+ $ag= new appgroup($this->config, $ldap->getDN());
+ $ag->removeApp($this->cn);
+ $ag->save ();
+ }
}