From: hickert Date: Wed, 2 Apr 2008 10:36:34 +0000 (+0000) Subject: Updated sudo X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b7d29c5dbc19266bc1451a59aa22fcbdba4740f5;p=gosa.git Updated sudo git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10110 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/admin/sudo/class_sudoGeneric.inc b/gosa-core/plugins/admin/sudo/class_sudoGeneric.inc index fdfb4d586..d6426384a 100644 --- a/gosa-core/plugins/admin/sudo/class_sudoGeneric.inc +++ b/gosa-core/plugins/admin/sudo/class_sudoGeneric.inc @@ -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))); } diff --git a/gosa-core/plugins/admin/sudo/generic.tpl b/gosa-core/plugins/admin/sudo/generic.tpl index 8c692e3f9..72508bd1b 100644 --- a/gosa-core/plugins/admin/sudo/generic.tpl +++ b/gosa-core/plugins/admin/sudo/generic.tpl @@ -1 +1,47 @@

Sudo generic

+ + + + + + + + + + + + + + + + + + + +
Generic + + + + + + + + + +
+ {t}Description{/t} + + +
+ {t}Name{/t} + + +
+
Commands +
User / Groups + {$sudoUser} + Commands +

 

Flags +

 

Hosts + Run as +