Code

Enabled missing attributes. Closes #561
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Oct 2008 13:41:06 +0000 (13:41 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Oct 2008 13:41:06 +0000 (13:41 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12620 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/ogroups/goto/class_termgroup.inc
gosa-plugins/goto/admin/ogroups/goto/termgroup.tpl

index 497a818453fe1736609281ec16347b5ba3aca0c5..7febba388d9efe13479059d2602518d37787aa60 100644 (file)
@@ -8,7 +8,8 @@ class termgroup extends plugin
   var $gotoMode           = "locked";
   var $gotoSyslogServer   = "";
   var $gotoNtpServer      = array();
-  var $gotoNtpServers     = array();
+  var $gotoTerminalPath   = array();
+  var $gotoSwapServer     = array();
   var $modes              = array();
   var $inheritTimeServer  = true;
   var $is_account                    = true; 
@@ -25,10 +26,13 @@ class termgroup extends plugin
                            # "sysinfo"         => "sysinfo"
                           );
 
-  var $attributes     = array("gotoMode","gotoSyslogServer", "gotoNtpServer");
+  var $attributes     = array("gotoMode","gotoSyslogServer", "gotoNtpServer", "gotoTerminalPath", "gotoSwapServer");
   var $objectclasses  = array("gotoWorkstationTemplate");
   var $CopyPasteVars  = array("gotoNtpServers","modes","inheritTimeServer","members");
   var $view_logged    = FALSE;
+  var $nfsservers     = array();
+  var $swapservers    = array();
+  var $member_of_ogroup= false;
 
 
   function termgroup (&$config, $dn= NULL, $parent= NULL)
@@ -86,6 +90,32 @@ class termgroup extends plugin
       }
     }
 
+    /* Get Share servers */
+    $tmp2 = array();
+    $tmp2['!']= _("Local swap");
+    foreach($this->config->data['SERVERS']['NBD'] as $server){
+      if($server != "default"){
+        $tmp2[$server]= $server;
+      }else{
+        if($this->member_of_ogroup){
+          $tmp2[$server]="["._("inherited")."]";
+        }
+      }
+    }
+    $this->swapservers= $tmp2;
+
+    $tmp2 = array();
+    foreach($this->config->data['SERVERS']['NFS'] as $server){
+      if($server != "default"){
+        $tmp2[$server]= $server;
+      }else{
+        if($this->member_of_ogroup){
+          $tmp2[$server]="["._("inherited")."]";
+        }
+      }
+    }
+    $this->nfsservers= $tmp2;
+
     /* Set inherit checkbox state */
     if(in_array("default",$this->gotoNtpServer)){
       $this->inheritTimeServer = true;
@@ -204,6 +234,12 @@ class termgroup extends plugin
     /* Set government mode */
     $smarty= get_smarty();
 
+    if (isset($this->parent->by_name['termstartup'])){
+       $smarty->assign("is_termgroup", "1");
+    } else {
+       $smarty->assign("is_termgroup", "0");
+    }
+
     $tmp = $this->plInfo();
     foreach($tmp['plProvidedAcls'] as $name => $translated) {
       $smarty->assign($name."ACL",$this->getacl($name));
@@ -238,9 +274,19 @@ class termgroup extends plugin
     }
 
     $smarty->assign("gotoNtpServers",$tmp); 
+
+    $smarty->assign("nfsservers",     $this->nfsservers);
+    $smarty->assign("swapservers",    $this->swapservers);
+
     $smarty->assign("syslogservers", $this->config->data['SERVERS']['SYSLOG']); 
     $smarty->assign("gotoSyslogServer_select", $this->gotoSyslogServer); 
 
+    /* Variables */
+    foreach(array("gotoTerminalPath", "gotoSwapServer") as $val){
+           $smarty->assign($val."_select", $this->$val);
+    }
+
+
     /* Show main page */
     return ($smarty->fetch (get_template_path('termgroup.tpl', TRUE, dirname(__FILE__))));
   }
@@ -332,7 +378,9 @@ class termgroup extends plugin
             "gotoMode"          => _("Mode"),     
             "gotoSyslogServer"  => _("Syslog server"), 
             "FAIstate"          => _("Action flag"), 
-            "gotoNtpServer"     => _("Ntp server"))
+            "gotoNtpServer"     => _("Ntp server"),
+            "gotoTerminalPath"    => _("Root server"),
+            "gotoSwapServer"      => _("Swap server"))
           ));
   }
 
index 64c41588ac06331b15e47095745bb66f26eda283..af2d0a5d7484722fca129037fa7546633c838b27 100644 (file)
 {/render}
                                 </td>
                                </tr>
-                               </table>
+                               {if $is_termgroup}
+                                   <tr>
+                                    <td><LABEL for="gotoTerminalPath">{t}Root server{/t}</LABEL></td>
+                                    <td>
+                               {render acl=$gotoTerminalPathACL}
+                                     <select name="gotoTerminalPath" id="gotoTerminalPath" title="{t}Select NFS root filesystem to use{/t}">
+                                      {html_options options=$nfsservers selected=$gotoTerminalPath_select}
+                                     </select>
+                               {/render}
+                                    </td>
+                                   </tr>
+                                   <tr>
+                                    <td><LABEL for="gotoSwapServer">{t}Swap server{/t}</LABEL></td>
+                                    <td>
+                               {render acl=$gotoSwapServerACL}
+                                     <select name="gotoSwapServer" id="gotoSwapServer" title="{t}Choose NFS filesystem to place swap files on{/t}">
+                                      {html_options options=$swapservers selected=$gotoSwapServer_select}
+                                     </select>
+                               {/render}
+                                    </td>
+                                   </tr>
+                               {/if}
+                                  </table>
                </td>
        </tr>
        <tr>