From: hickert Date: Wed, 2 Apr 2008 11:47:52 +0000 (+0000) Subject: Updated sudo stuff. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f92c7b6ed65dc39dbbe8c60a66a3d329c315c951;p=gosa.git Updated sudo stuff. -Object properties will be shown now. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10112 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 d6426384a..9fc173264 100644 --- a/gosa-core/plugins/admin/sudo/class_sudoGeneric.inc +++ b/gosa-core/plugins/admin/sudo/class_sudoGeneric.inc @@ -55,12 +55,58 @@ class sudo extends plugin { /* Call parent execute */ plugin::execute(); + + + + + + + + + + + + + $smarty = get_smarty(); foreach($this->attributes as $attr){ - $smart->assign($attr,$this->$attr); + $smarty->assign($attr,$this->$attr); + } + + $divlist_sudoUser = new divSelectBox("divlist_sudoUser"); + $divlist_sudoUser->SetHeight("90"); + $divlist_sudoHost = new divSelectBox("divlist_sudoHost"); + $divlist_sudoHost->Setheight("90"); + $divlist_sudoRunas = new divSelectBox("divlist_sudoRunas"); + $divlist_sudoRunas->Setheight("90"); + $divlist_sudoOption = new divSelectBox("divlist_sudoOption"); + $divlist_sudoOption->Setheight("90"); + $divlist_sudoCommand = new divSelectBox("divlist_sudoCommand"); + $divlist_sudoCommand->Setheight("90"); + + $neg_img= "!"; + $option = ""; + $option.= ""; + foreach(array("sudoUser","sudoCommand","sudoOption","sudoHost","sudoRunas") as $attr){ + foreach($this->$attr as $key => $entry){ + $entry = preg_replace("/^!/",$neg_img,$entry); + + $list_name = "divlist_".$attr; + $$list_name->AddEntry( + array( + array("string" => $entry), + array("string" => preg_replace(array("/%KEY%/","/%ATTR%/"),array($key,$attr),$option), + "attach" => "style='width:40px; border-right: 0px;'"))); + } } + $smarty->assign("divlist_sudoUser",$divlist_sudoUser->DrawList()); + $smarty->assign("divlist_sudoHost",$divlist_sudoHost->DrawList()); + $smarty->assign("divlist_sudoRunas",$divlist_sudoRunas->DrawList()); + $smarty->assign("divlist_sudoOption",$divlist_sudoOption->DrawList()); + $smarty->assign("divlist_sudoCommand",$divlist_sudoCommand->DrawList()); + 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 72508bd1b..6f13ff04a 100644 --- a/gosa-core/plugins/admin/sudo/generic.tpl +++ b/gosa-core/plugins/admin/sudo/generic.tpl @@ -1,47 +1,48 @@

Sudo generic

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

 

 

Flags + {$divlist_sudoOption}

 

 

Hosts + {$divlist_sudoHost} Run as + {$divlist_sudoRunas}