From 23c100c8bb0049160a5c6c8f7777e70f65ad970b Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Wed, 18 Apr 2007 18:40:42 +0000 Subject: [PATCH] Added check for empty timeservers field --- time/CHANGELOG | 2 ++ time/apply.cgi | 1 + time/lang/en | 1 + 3 files changed, 4 insertions(+) diff --git a/time/CHANGELOG b/time/CHANGELOG index 9f861e3a8..251097f0e 100644 --- a/time/CHANGELOG +++ b/time/CHANGELOG @@ -9,3 +9,5 @@ Command-line options for the hwclock command can now be specified on the Module Added an API for getting and setting the system and hardware times, for calling by other modules. ---- Changes since 1.210 ---- When the hardware or system time is not editable due to module access control restrictions, the times are now displayed (but cannot be changed). +---- Changes since 1.340 ---- +Added check for empty timeservers field. diff --git a/time/apply.cgi b/time/apply.cgi index 3ae7fe874..3d1c2d570 100755 --- a/time/apply.cgi +++ b/time/apply.cgi @@ -50,6 +50,7 @@ if( $in{ 'action' } eq $text{ 'action_apply' } ) } elsif( $in{ 'action' } eq $text{ 'index_sync' }) { # Sync with a time server $access{'ntp'} || &error($text{'acl_nontp'}); + $in{'timeserver'} =~ /\S/ || &error($text{'error_etimeserver'}); $err = &sync_time($in{'timeserver'}, $in{'hardware'}); &error($err) if ($err); diff --git a/time/lang/en b/time/lang/en index dceeeb04f..b4bf3c4c3 100644 --- a/time/lang/en +++ b/time/lang/en @@ -43,6 +43,7 @@ error_hw=Can't set the hardware time : $1 error_sync=Can't sync with system time : $1 error_ediff=Time server different with local time is too large : $1 days error_entp=NTP time synchronization failed : $1 +error_etimeserver=No time servers to sync with entered log_set_date=Set system time to $1 log_set_hwclock=Set hardware clock to $1