diff --git a/plugins/admin/applications/class_applicationGeneric.inc b/plugins/admin/applications/class_applicationGeneric.inc
index 4330a54e09bacfb89459e56a5c09215a966d2a23..351d6e458cb1234aa8183e055ddd26173d6a8903 100644 (file)
/* Load icon */
$ldap= $config->get_ldap_link();
- $this->iconData= $ldap->get_attribute($dn, "gosaApplicationIcon");
+ if ($dn != 'new'){
+ $this->iconData= $ldap->get_attribute($dn, "gosaApplicationIcon");
+ }
if ($this->iconData == ""){
$this->set_picture("");
}
/* This is always an account */
$this->is_account= TRUE;
- if ($this->dn == "new"){
- $ui= get_userinfo();
- $this->base= dn2base($ui->dn);
+ if ($this->dn == "new"){
+ 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);
- }
+ $this->base= preg_replace ("/^[^,]+,[^,]+,/", "", $this->dn);
+ }
}
function execute()
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 ();
+ }
}