Code

Some changes, no execute in save
[gosa.git] / plugins / gofon / macro / class_gofonMacro.inc
index 488a290a312b5f125f2ebe1c5c26b12b9c6d832b..373a4838e9df79a1103f0f8d5ae97f5de78a5c3f 100755 (executable)
@@ -48,7 +48,7 @@ class macro extends plugin
     /* Do we represent a valid group? */
     if (!$this->is_account && $this->parent == NULL){
       $display= "<img alt=\"\" src=\"images/stop.png\" align=\"middle\">&nbsp;<b>".
-        _("This 'dn' is no application.")."</b>";
+        _("This 'dn' is no phone macro.")."</b>";
       return ($display);
     }
 
@@ -80,7 +80,6 @@ class macro extends plugin
       }
     }
 
-
     /* Show main page */
     return($smarty->fetch (get_template_path('generic.tpl', TRUE)));
   }
@@ -97,11 +96,10 @@ class macro extends plugin
     $ldap->cd ($this->config->current['BASE']);
     $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".$this->dn."))", array("cn"));
     while ($ldap->fetch()){
-      $og= new ogroup($this->config, $ldap->getDN());
-      unset($og->member[$this->dn]);
-      $og->save ();
+        $og= new ogroup($this->config, $ldap->getDN());
+        unset($og->member[$this->dn]);
+        $og->save ();
     }
-
   }
 
 
@@ -129,7 +127,11 @@ class macro extends plugin
     if(($this->cn != strtolower($this->cn))||(empty($this->cn))){
       $message[] = "The attribute 'cn' must be lowercase and a least one char.";
     }
-
+    
+    if(count(split("\n",$this->goFonMacroContent))>100){
+      $message[] = _("Makro length must be lower than 100 lines");
+    }
+    
     return $message;
   }