Added check for empty timeservers field
authorJamie Cameron <jcameron@webmin.com>
Wed, 18 Apr 2007 18:40:42 +0000 (18:40 +0000)
committerJamie Cameron <jcameron@webmin.com>
Wed, 18 Apr 2007 18:40:42 +0000 (18:40 +0000)
time/CHANGELOG
time/apply.cgi
time/lang/en

index 9f861e3..251097f 100644 (file)
@@ -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.
index 3ae7fe8..3d1c2d5 100755 (executable)
@@ -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);
 
index dceeeb0..b4bf3c4 100644 (file)
@@ -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