[LON-CAPA-cvs] cvs: loncom /interface domainprefs.pm
raeburn
lon-capa-cvs-allow@mail.lon-capa.org
Wed, 09 Jul 2008 21:34:27 -0000
raeburn Wed Jul 9 17:34:27 2008 EDT
Modified files:
/loncom/interface domainprefs.pm
Log:
- Using the provided method: is_valid_name() to validate selected default timezone for domain.
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.61 loncom/interface/domainprefs.pm:1.62
--- loncom/interface/domainprefs.pm:1.61 Mon Jul 7 23:04:23 2008
+++ loncom/interface/domainprefs.pm Wed Jul 9 17:34:27 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.61 2008/07/08 03:04:23 raeburn Exp $
+# $Id: domainprefs.pm,v 1.62 2008/07/09 21:34:27 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -41,6 +41,7 @@
use LONCAPA::Enrollment;
use File::Copy;
use Locale::Language;
+use DateTime::TimeZone;
sub handler {
my $r=shift;
@@ -4208,8 +4209,7 @@
}
} elsif ($item eq 'timezone_def') {
if ($newvalues{$item} ne '') {
- my @timezones = &DateTime::TimeZone->all_names;
- if (!grep(/^\Q$newvalues{$item}\E/,@timezones)) {
+ if (!DateTime::TimeZone->is_valid_name($newvalues{$item})) {
push(@errors,$item);
}
}