Code

some tuning (ACL stuff, hide not needed fields) in phone setup ......
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 14 Jun 2005 10:43:27 +0000 (10:43 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 14 Jun 2005 10:43:27 +0000 (10:43 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@705 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_phoneGeneric.inc

index dddc9499a37c0315031b0baf4c7466b40dbbfee0..ddaeb30bfb4f321cde709cf8ee4d8817e4997abe 100644 (file)
@@ -102,18 +102,20 @@ class phoneGeneric extends plugin
 
     /* deativate all fields that are not used by the specified type */
     foreach($this->attributes as $att){
-      if(!in_array($att,$this->usedattrs[$this->selected_categorie])){
+      if((!in_array($att,$this->usedattrs[$this->selected_categorie]))||(chkacl($this->acl,$att)!="")){
         $smarty->assign($att."USED", "disabled" );
+        $smarty->assign($att, "");
       }else{
         $smarty->assign($att."USED", "" );
+        $smarty->assign($att, $this->$att);
       }
     }
-
+    
+    $smarty->assign("selected_categorie",$this->selected_categorie);
 
     /* Assign attributes */
     foreach ($this->attributes as $attr){
       $smarty->assign($attr."ACL", chkacl($this->acl, $attr));
-      $smarty->assign("$attr", $this->$attr);
     }
     $smarty->assign("base_select", $this->base);
     
@@ -213,9 +215,16 @@ class phoneGeneric extends plugin
 
     /* Remove all unwanted attrs */
     foreach($this->attributes as $att){
+      
+      /* Check all attributes, if they are needed for this type of phone */
       if(!in_array($att,$this->usedattrs[$mode])){
         $this->attrs[$att] = array();
       }
+    
+      /* Test rights of this user ... */
+      if(chkacl($this->acl,$att)!=""){
+        unset($this->attrs[$att]);
+      }
     }
 
     /* unset the categorie*/