timeserver=Default time server,3,None
ntp_only=Only use NTP for time synchronization?,1,1-Yes,0-No
line2=System configuration,11
-hwtime=System supports hardware time,1,1-Yes,0-No
+hwtime=System supports hardware time,1,1-Yes,0-No,2-Detect automatically
seconds=System time setting format,1,1-MMDDHHMMYYYY.SS,0-MMDDHHMMYY,2-YYYYMMDDHHMM.SS
zone_style=Timezone configuration method,4,linux-Linux,freebsd-FreeBSD,solaris-Solaris,-<Not supported on this OS>
hwclock_flags=Command-line flags for hwclock,10,-None,sysconfig-From /etc/sysconfig/clock
&error( $text{ 'acl_error' } ) if( $access{ 'sysdate' } && $access{ 'hwdate' } );
-if (!$access{'sysdate'} && !$access{'hwdate'} && $config{'hwtime'}) {
+if (!$access{'sysdate'} && !$access{'hwdate'} && &support_hwtime()) {
$arr = "0,1";
}
else {
&ui_print_footer("/", $text{'index'});
exit;
}
-if (!$access{'hwdate'} && $config{'hwtime'} && !&has_command("hwclock")) {
+if (!$access{'hwdate'} && $config{'hwtime'} == 1 && !&has_command("hwclock")) {
print &text( 'error_cnf', "<tt>hwclock</tt>"),"<p>\n";
&ui_print_footer("/", $text{'index'});
exit;
print &ui_form_start("apply.cgi");
print &tabletime(&hlink($text{'sys_title'}, "system_time"), 0, %system_date);
print &ui_submit($text{'action_apply'}, "action");
- if ($config{'hwtime'}) {
+ if (&support_hwtime()) {
print &ui_submit($text{'action_sync'}, "action");
}
print &ui_form_end();
}
# Get the hardware time
-if ($config{'hwtime'}) {
+if (&support_hwtime()) {
local @tm = &get_hardware_time();
@tm || &error($get_hardware_time_error || $text{'index_eformat'});
$hw_date{ 'second' } = $tm[0];
print &tabletime(&hlink($text{'hw_title'}, "hardware_time"),
0, %hw_date);
print &ui_submit($text{'action_save'}, "action");
- if ($config{'hwtime'}) {
+ if (support_hwtime()) {
print &ui_submit($text{'action_sync_s'}, "action");
}
print &ui_form_end();
&ui_textbox("timeserver", $config{'timeserver'}, 60));
# Show hardware time checkbox
- if ($config{'hwtime'}) {
+ if (&support_hwtime()) {
print &ui_table_row(" ",
&ui_checkbox("hardware", 1, $text{'index_hardware2'},
$config{'timeserver_hardware'}));