Code

Updated sudo
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 2 Apr 2008 10:36:34 +0000 (10:36 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 2 Apr 2008 10:36:34 +0000 (10:36 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10110 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/sudo/class_sudoGeneric.inc
gosa-core/plugins/admin/sudo/generic.tpl

index fdfb4d586ec3ddb42593bb076b31e1f507c0c8dc..d6426384a624e028b88164196b901043879f4ee5 100644 (file)
@@ -26,9 +26,29 @@ class sudo extends plugin
   var $cn= "";
   var $description= "";
 
+  var $sudoUser   = array();
+  var $sudoCommand= array();
+  var $sudoOption = array();
+  var $sudoHost   = array();
+  var $sudoRunas  = array();
+
+  var $objectclasses = array("top","sudoRole");
+  var $attributes    = array("cn","description","sudoUser","sudoCommand","sudoOption","sudoHost","sudoRunas");
+
   function sudo(&$config, $dn= NULL)
   {
     plugin::plugin ($config, $dn);
+
+    foreach(array("sudoUser","sudoCommand","sudoOption","sudoHost","sudoRunas") as $attr){
+      $this->$attr = array();
+      if(isset($this->attrs[$attr])){
+        $tmp = array();
+        for($i = 0 ; $i < $this->attrs[$attr]['count']; $i++){
+          $tmp[] = $this->attrs[$attr][$i];
+        }
+        $this->$attr = $tmp;
+      }
+    }
   }
 
   function execute()
@@ -36,6 +56,11 @@ class sudo extends plugin
     /* Call parent execute */
     plugin::execute();
     $smarty = get_smarty();
+
+    foreach($this->attributes as $attr){
+      $smart->assign($attr,$this->$attr);
+    }
+
     return($smarty->fetch(get_template_path('generic.tpl', TRUE)));
   }
 
index 8c692e3f97c4eafd1066eb91f70975228f7f7b48..72508bd1b8ffb151bbad91649adc80baecc7cf91 100644 (file)
@@ -1 +1,47 @@
 <h2>Sudo generic</h2>
+
+<table style="width: 100%;">
+ <tr>
+  <td style="width:50%"><b>Generic</b>
+   <table> 
+    <tr>
+     <td>
+      {t}Description{/t}
+     </td>
+     <td>
+      <input type="text" name="description" value="{descriptioncn}">
+     </td>
+    </tr>
+    <tr>
+     <td>
+      {t}Name{/t}
+     </td>
+     <td>
+      <input type="text" name="cn" value="{$cn}">
+     </td>
+    </tr>
+   </table>
+  </td>
+  <td style="border-left: solid 1px #AAAAAA;"><b>Commands</b>
+  </td>
+ </tr> 
+ <tr>
+  <td style="width:50%"><b>User / Groups</b>
+   {$sudoUser}
+  </td>
+  <td style="border-left: solid 1px #AAAAAA;"><b>Commands</b>
+  </td>
+ </tr> 
+ <tr><td colspan="2"><p class="seperator">&nbsp;</p></td></tr>
+ <tr>
+  <td colspan="2"><b>Flags</b>
+  </td>
+ </tr>
+ <tr><td colspan="2"><p class="seperator">&nbsp;</p></td></tr>
+ <tr>
+  <td><b>Hosts</b>
+  </td>
+  <td style="border-left: solid 1px #AAAAAA;"><b>Run as</b>
+  </td>
+ </tr>
+</table>