Code

Page position will be saved in Lists now
[gosa.git] / plugins / admin / applications / class_applicationGeneric.inc
index 6330e399b8256407c20ffb5b108d8ee6b12eb531..8ef8bb24e0d53f0d4e88025103fb85007ea8a96f 100644 (file)
@@ -31,7 +31,9 @@ class application extends plugin
 
        /* 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("");
        }
@@ -41,19 +43,19 @@ class application extends plugin
        /* This is always an account */
        $this->is_account= TRUE;
 
-        if ($this->dn == "new"){
+       if ($this->dn == "new"){
                $ui= get_userinfo();
                $this->base= dn2base($ui->dn);
        } else {
-                $this->base= preg_replace ("/^[^,]+,[^,]+,/", "", $this->dn);
-        }
+               $this->base= preg_replace ("/^[^,]+,[^,]+,/", "", $this->dn);
+       }
   }
 
   function execute()
   {
        /* Do we represent a valid group? */
        if (!$this->is_account && $this->parent == NULL){
-                $display= "<img src=\"images/stop.png\" align=center>&nbsp;<b>".
+                $display= "<img alt=\"\" src=\"images/stop.png\" align=\"middle\">&nbsp;<b>".
                         _("This 'dn' is no application.")."</b>";
                 return ($display);
        }
@@ -96,6 +98,7 @@ class application extends plugin
        return($smarty->fetch (get_template_path('generic.tpl', TRUE)));
   }
 
+
   function remove_from_parent()
   {
        $ldap= $this->config->get_ldap_link();
@@ -112,6 +115,12 @@ class application extends plugin
                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 ();
+       }
 
   }