summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b18d6cb)
raw | patch | inline | side by side (parent: b18d6cb)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 29 Sep 2010 14:04:43 +0000 (14:04 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 29 Sep 2010 14:04:43 +0000 (14:04 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19853 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/admin/systems/goto/Device/InstallRecipe.tpl | patch | blob | history | |
gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc | patch | blob | history |
diff --git a/gosa-plugins/goto/admin/systems/goto/Device/InstallRecipe.tpl b/gosa-plugins/goto/admin/systems/goto/Device/InstallRecipe.tpl
index e4693688e852c2889f8f8588a3d2a9a3ea134e7f..868d27971f4a121d872ab5ae42862cbff5764ce1 100644 (file)
<LABEL for="kickstartTimeUTC">{t}Use UTC{/t}</LABEL>
</td>
</tr>
- <tr>
- <td><LABEL for="kickstartNTPServer">{t}NTP server{/t}</LABEL></td>
- <td>
- <input type='text' name="kickstartNTPServer" id="kickstartNTPServer" value="{$kickstartNTPServer}">
- </td>
- </tr>
<tr>
<td><LABEL for="kickstartTimezone">{t}Timezone{/t}</LABEL></td>
<td>
</select>
</td>
</tr>
+ <tr>
+ <td colspan=2>
+ {t}NTP server{/t}
+ {$kickstartNTPServerList}
+ <input type='text' name="kickstartNTPServer_Input">
+ <button name='kickstartNTPServer_Add'>{msgPool type=addButton}</button>
+ </td>
+ </tr>
</table>
</td>
</tr>
diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc
index 40cdc4289decd61a703c250836ec05eefe0737a2..9d98c360116f65ff9c176bea75a3e88cbf4f77f9 100644 (file)
public $kickstartSystemLocale = "";
public $kickstartTimezone = "";
public $kickstartTimeUTC = "";
- public $kickstartNTPServer = "";
+ public $kickstartNTPServer = array();
public $kickstartMirrorDN = "";
public $kickstartRootEnabled = "";
public $kickstartRootPasswordHash = "";
public $setKickstartRootPasswordHash = FALSE;
+ private $kickstartNTPServerList = NULL;
+
function __construct(&$config, $dn)
{
plugin::plugin($config, $dn);
$this->hashes[$name] = $name;
}
$this->hash = $this->config->get_cfg_value("core","passwordDefaultHash");
+
+ // Get list of NTP servers
+ $this->kickstartNTPServer = array();
+ if(isset($this->attrs['kickstartNTPServer']['count'])){
+ for($i = 0; $i < $this->attrs['kickstartNTPServer']['count']; $i++){
+ $this->kickstartNTPServer[] = $this->attrs['kickstartNTPServer'][$i];
+ }
+ }
+
+ // Prepare NTP servers list
+ $this->kickstartNTPServerList= new sortableListing($this->kickstartNTPServer);
+ $this->kickstartNTPServerList->setDeleteable(true);
+ $this->kickstartNTPServerList->setEditable(false);
+ $this->kickstartNTPServerList->setColspecs(array('*'));
+ $this->kickstartNTPServerList->setWidth("100%");
+ $this->kickstartNTPServerList->setHeight("70px");
+
+
}
function execute()
return($smarty->fetch(get_template_path('goto/Device/SetPassword.tpl', TRUE)));
}
+ $this->kickstartNTPServerList->setAcl($this->getacl('kickstartNTPServer'));
+ $this->kickstartNTPServerList->update();
plugin::execute();
$smarty = get_smarty();
$smarty->assign('timezones', $this->timezones);
+ $smarty->assign('kickstartNTPServerList', $this->kickstartNTPServerList->render());
foreach($this->attributes as $attr){
$smarty->assign($attr, $this->$attr);
}
if(isset($_POST['setKickstartRootPasswordHash'])){
$this->setKickstartRootPasswordHash = true;
}
+
+ $this->kickstartNTPServerList->save_object();
+ $this->kickstartNTPServer = $this->kickstartNTPServerList->getMaintainedData();
+ if(isset($_POST['kickstartNTPServer_Input']) && isset($_POST['kickstartNTPServer_Add'])){
+ $add = get_post('kickstartNTPServer_Input');
+ if(!in_array($add, $this->kickstartNTPServer) && !empty($add)){
+ $this->kickstartNTPServer[] = $add;
+ }
+ }
+ $this->kickstartNTPServerList->setListData($this->kickstartNTPServer);
}
if(isset($_POST['cancelPassword'])) $this->setKickstartRootPasswordHash =false;
if(isset($_POST['setPassword'])) {